htt.h 815 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  216. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  217. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  218. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  219. * 3.100 Add htt_tx_wbm_completion_v3 def.
  220. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  221. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  222. */
  223. #define HTT_CURRENT_VERSION_MAJOR 3
  224. #define HTT_CURRENT_VERSION_MINOR 102
  225. #define HTT_NUM_TX_FRAG_DESC 1024
  226. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  227. #define HTT_CHECK_SET_VAL(field, val) \
  228. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  229. /* macros to assist in sign-extending fields from HTT messages */
  230. #define HTT_SIGN_BIT_MASK(field) \
  231. ((field ## _M + (1 << field ## _S)) >> 1)
  232. #define HTT_SIGN_BIT(_val, field) \
  233. (_val & HTT_SIGN_BIT_MASK(field))
  234. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  235. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  236. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  237. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  238. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  239. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  240. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  241. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  242. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  243. /*
  244. * TEMPORARY:
  245. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  246. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  247. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  248. * updated.
  249. */
  250. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  251. /*
  252. * TEMPORARY:
  253. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  254. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  255. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  256. * updated.
  257. */
  258. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  259. /*
  260. * htt_dbg_stats_type -
  261. * bit positions for each stats type within a stats type bitmask
  262. * The bitmask contains 24 bits.
  263. */
  264. enum htt_dbg_stats_type {
  265. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  266. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  267. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  268. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  269. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  270. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  271. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  272. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  273. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  274. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  275. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  276. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  277. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  278. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  279. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  280. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  281. /* bits 16-23 currently reserved */
  282. /* keep this last */
  283. HTT_DBG_NUM_STATS
  284. };
  285. /*=== HTT option selection TLVs ===
  286. * Certain HTT messages have alternatives or options.
  287. * For such cases, the host and target need to agree on which option to use.
  288. * Option specification TLVs can be appended to the VERSION_REQ and
  289. * VERSION_CONF messages to select options other than the default.
  290. * These TLVs are entirely optional - if they are not provided, there is a
  291. * well-defined default for each option. If they are provided, they can be
  292. * provided in any order. Each TLV can be present or absent independent of
  293. * the presence / absence of other TLVs.
  294. *
  295. * The HTT option selection TLVs use the following format:
  296. * |31 16|15 8|7 0|
  297. * |---------------------------------+----------------+----------------|
  298. * | value (payload) | length | tag |
  299. * |-------------------------------------------------------------------|
  300. * The value portion need not be only 2 bytes; it can be extended by any
  301. * integer number of 4-byte units. The total length of the TLV, including
  302. * the tag and length fields, must be a multiple of 4 bytes. The length
  303. * field specifies the total TLV size in 4-byte units. Thus, the typical
  304. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  305. * field, would store 0x1 in its length field, to show that the TLV occupies
  306. * a single 4-byte unit.
  307. */
  308. /*--- TLV header format - applies to all HTT option TLVs ---*/
  309. enum HTT_OPTION_TLV_TAGS {
  310. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  311. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  312. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  313. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  314. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  315. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  316. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  317. };
  318. PREPACK struct htt_option_tlv_header_t {
  319. A_UINT8 tag;
  320. A_UINT8 length;
  321. } POSTPACK;
  322. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  323. #define HTT_OPTION_TLV_TAG_S 0
  324. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  325. #define HTT_OPTION_TLV_LENGTH_S 8
  326. /*
  327. * value0 - 16 bit value field stored in word0
  328. * The TLV's value field may be longer than 2 bytes, in which case
  329. * the remainder of the value is stored in word1, word2, etc.
  330. */
  331. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  332. #define HTT_OPTION_TLV_VALUE0_S 16
  333. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  334. do { \
  335. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  336. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  337. } while (0)
  338. #define HTT_OPTION_TLV_TAG_GET(word) \
  339. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  340. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  341. do { \
  342. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  343. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  344. } while (0)
  345. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  346. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  347. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  350. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  351. } while (0)
  352. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  353. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  354. /*--- format of specific HTT option TLVs ---*/
  355. /*
  356. * HTT option TLV for specifying LL bus address size
  357. * Some chips require bus addresses used by the target to access buffers
  358. * within the host's memory to be 32 bits; others require bus addresses
  359. * used by the target to access buffers within the host's memory to be
  360. * 64 bits.
  361. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  362. * a suffix to the VERSION_CONF message to specify which bus address format
  363. * the target requires.
  364. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  365. * default to providing bus addresses to the target in 32-bit format.
  366. */
  367. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  368. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  369. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  370. };
  371. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  372. struct htt_option_tlv_header_t hdr;
  373. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  374. } POSTPACK;
  375. /*
  376. * HTT option TLV for specifying whether HL systems should indicate
  377. * over-the-air tx completion for individual frames, or should instead
  378. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  379. * requests an OTA tx completion for a particular tx frame.
  380. * This option does not apply to LL systems, where the TX_COMPL_IND
  381. * is mandatory.
  382. * This option is primarily intended for HL systems in which the tx frame
  383. * downloads over the host --> target bus are as slow as or slower than
  384. * the transmissions over the WLAN PHY. For cases where the bus is faster
  385. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  386. * and consquently will send one TX_COMPL_IND message that covers several
  387. * tx frames. For cases where the WLAN PHY is faster than the bus,
  388. * the target will end up transmitting very short A-MPDUs, and consequently
  389. * sending many TX_COMPL_IND messages, which each cover a very small number
  390. * of tx frames.
  391. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  392. * a suffix to the VERSION_REQ message to request whether the host desires to
  393. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  394. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  395. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  396. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  397. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  398. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  399. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  400. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  401. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  402. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  403. * TLV.
  404. */
  405. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  406. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  407. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  408. };
  409. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  410. struct htt_option_tlv_header_t hdr;
  411. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  412. } POSTPACK;
  413. /*
  414. * HTT option TLV for specifying how many tx queue groups the target
  415. * may establish.
  416. * This TLV specifies the maximum value the target may send in the
  417. * txq_group_id field of any TXQ_GROUP information elements sent by
  418. * the target to the host. This allows the host to pre-allocate an
  419. * appropriate number of tx queue group structs.
  420. *
  421. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  422. * a suffix to the VERSION_REQ message to specify whether the host supports
  423. * tx queue groups at all, and if so if there is any limit on the number of
  424. * tx queue groups that the host supports.
  425. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  426. * a suffix to the VERSION_CONF message. If the host has specified in the
  427. * VER_REQ message a limit on the number of tx queue groups the host can
  428. * supprt, the target shall limit its specification of the maximum tx groups
  429. * to be no larger than this host-specified limit.
  430. *
  431. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  432. * shall preallocate 4 tx queue group structs, and the target shall not
  433. * specify a txq_group_id larger than 3.
  434. */
  435. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  436. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  437. /*
  438. * values 1 through N specify the max number of tx queue groups
  439. * the sender supports
  440. */
  441. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  442. };
  443. /* TEMPORARY backwards-compatibility alias for a typo fix -
  444. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  445. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  446. * to support the old name (with the typo) until all references to the
  447. * old name are replaced with the new name.
  448. */
  449. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  450. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  451. struct htt_option_tlv_header_t hdr;
  452. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  453. } POSTPACK;
  454. /*
  455. * HTT option TLV for specifying whether the target supports an extended
  456. * version of the HTT tx descriptor. If the target provides this TLV
  457. * and specifies in the TLV that the target supports an extended version
  458. * of the HTT tx descriptor, the target must check the "extension" bit in
  459. * the HTT tx descriptor, and if the extension bit is set, to expect a
  460. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  461. * descriptor. Furthermore, the target must provide room for the HTT
  462. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  463. * This option is intended for systems where the host needs to explicitly
  464. * control the transmission parameters such as tx power for individual
  465. * tx frames.
  466. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  467. * as a suffix to the VERSION_CONF message to explicitly specify whether
  468. * the target supports the HTT tx MSDU extension descriptor.
  469. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  470. * by the host as lack of target support for the HTT tx MSDU extension
  471. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  472. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  473. * the HTT tx MSDU extension descriptor.
  474. * The host is not required to provide the HTT tx MSDU extension descriptor
  475. * just because the target supports it; the target must check the
  476. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  477. * extension descriptor is present.
  478. */
  479. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  480. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  481. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  482. };
  483. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  484. struct htt_option_tlv_header_t hdr;
  485. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  486. } POSTPACK;
  487. /*
  488. * For the tcl data command V2 and higher support added a new
  489. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  490. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  491. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  492. * HTT option TLV for specifying which version of the TCL metadata struct
  493. * should be used:
  494. * V1 -> use htt_tx_tcl_metadata struct
  495. * V2 -> use htt_tx_tcl_metadata_v2 struct
  496. * Old FW will only support V1.
  497. * New FW will support V2. New FW will still support V1, at least during
  498. * a transition period.
  499. * Similarly, old host will only support V1, and new host will support V1 + V2.
  500. *
  501. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  502. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  503. * of TCL metadata the host supports. If the host doesn't provide a
  504. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  505. * is implicitly understood that the host only supports V1.
  506. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  507. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  508. * the host shall use. The target shall only select one of the versions
  509. * supported by the host. If the target doesn't provide a
  510. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  511. * is implicitly understood that the V1 TCL metadata shall be used.
  512. */
  513. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  514. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  515. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  516. };
  517. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  518. struct htt_option_tlv_header_t hdr;
  519. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  520. } POSTPACK;
  521. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  522. HTT_OPTION_TLV_VALUE0_SET(word, value)
  523. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  524. HTT_OPTION_TLV_VALUE0_GET(word)
  525. typedef struct {
  526. union {
  527. /* BIT [11 : 0] :- tag
  528. * BIT [23 : 12] :- length
  529. * BIT [31 : 24] :- reserved
  530. */
  531. A_UINT32 tag__length;
  532. /*
  533. * The following struct is not endian-portable.
  534. * It is suitable for use within the target, which is known to be
  535. * little-endian.
  536. * The host should use the above endian-portable macros to access
  537. * the tag and length bitfields in an endian-neutral manner.
  538. */
  539. struct {
  540. A_UINT32 tag : 12, /* BIT [11 : 0] */
  541. length : 12, /* BIT [23 : 12] */
  542. reserved : 8; /* BIT [31 : 24] */
  543. };
  544. };
  545. } htt_tlv_hdr_t;
  546. typedef enum {
  547. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  548. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  549. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  550. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  551. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  552. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  553. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  554. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  555. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  556. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  557. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  558. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  559. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  560. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  561. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  562. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  563. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  564. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  565. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  566. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  567. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  568. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  569. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  570. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  571. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  572. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  573. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  574. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  575. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  576. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  577. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  578. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  579. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  580. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  581. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  582. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  583. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  584. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  585. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  586. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  587. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  588. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  589. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  590. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  591. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  592. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  593. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  594. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  595. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  596. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  597. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  598. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  599. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  600. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  601. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  602. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  603. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  604. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  605. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  606. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  607. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  608. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  609. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  610. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  611. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  612. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  613. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  614. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  615. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  616. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  617. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  618. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  619. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  620. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  621. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  622. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  623. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  624. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  625. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  626. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  627. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  628. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  629. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  630. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  631. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  632. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  633. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  634. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  635. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  636. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  637. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  638. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  639. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  640. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  641. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  642. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  643. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  644. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  645. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  646. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  647. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  648. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  649. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  650. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  651. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  652. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  653. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  654. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  655. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  656. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  657. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  658. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  659. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  660. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  661. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  662. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  663. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  664. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  665. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  666. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  667. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  668. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  669. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  670. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  671. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  672. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  673. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  674. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  675. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  676. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  677. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  678. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  679. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  680. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  681. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  682. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  683. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  684. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  685. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  686. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  687. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  688. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  689. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  690. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  691. HTT_STATS_MAX_TAG,
  692. } htt_tlv_tag_t;
  693. #define HTT_STATS_TLV_TAG_M 0x00000fff
  694. #define HTT_STATS_TLV_TAG_S 0
  695. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  696. #define HTT_STATS_TLV_LENGTH_S 12
  697. #define HTT_STATS_TLV_TAG_GET(_var) \
  698. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  699. HTT_STATS_TLV_TAG_S)
  700. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  701. do { \
  702. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  703. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  704. } while (0)
  705. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  706. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  707. HTT_STATS_TLV_LENGTH_S)
  708. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  709. do { \
  710. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  711. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  712. } while (0)
  713. /*=== host -> target messages ===============================================*/
  714. enum htt_h2t_msg_type {
  715. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  716. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  717. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  718. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  719. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  720. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  721. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  722. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  723. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  724. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  725. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  726. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  727. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  728. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  729. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  730. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  731. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  732. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  733. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  734. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  735. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  736. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  737. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  738. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  739. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  740. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  741. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  742. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  743. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  744. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  745. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  746. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  747. /* keep this last */
  748. HTT_H2T_NUM_MSGS
  749. };
  750. /*
  751. * HTT host to target message type -
  752. * stored in bits 7:0 of the first word of the message
  753. */
  754. #define HTT_H2T_MSG_TYPE_M 0xff
  755. #define HTT_H2T_MSG_TYPE_S 0
  756. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  757. do { \
  758. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  759. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  760. } while (0)
  761. #define HTT_H2T_MSG_TYPE_GET(word) \
  762. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  763. /**
  764. * @brief host -> target version number request message definition
  765. *
  766. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  767. *
  768. *
  769. * |31 24|23 16|15 8|7 0|
  770. * |----------------+----------------+----------------+----------------|
  771. * | reserved | msg type |
  772. * |-------------------------------------------------------------------|
  773. * : option request TLV (optional) |
  774. * :...................................................................:
  775. *
  776. * The VER_REQ message may consist of a single 4-byte word, or may be
  777. * extended with TLVs that specify which HTT options the host is requesting
  778. * from the target.
  779. * The following option TLVs may be appended to the VER_REQ message:
  780. * - HL_SUPPRESS_TX_COMPL_IND
  781. * - HL_MAX_TX_QUEUE_GROUPS
  782. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  783. * may be appended to the VER_REQ message (but only one TLV of each type).
  784. *
  785. * Header fields:
  786. * - MSG_TYPE
  787. * Bits 7:0
  788. * Purpose: identifies this as a version number request message
  789. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  790. */
  791. #define HTT_VER_REQ_BYTES 4
  792. /* TBDXXX: figure out a reasonable number */
  793. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  794. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  795. /**
  796. * @brief HTT tx MSDU descriptor
  797. *
  798. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  799. *
  800. * @details
  801. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  802. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  803. * the target firmware needs for the FW's tx processing, particularly
  804. * for creating the HW msdu descriptor.
  805. * The same HTT tx descriptor is used for HL and LL systems, though
  806. * a few fields within the tx descriptor are used only by LL or
  807. * only by HL.
  808. * The HTT tx descriptor is defined in two manners: by a struct with
  809. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  810. * definitions.
  811. * The target should use the struct def, for simplicitly and clarity,
  812. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  813. * neutral. Specifically, the host shall use the get/set macros built
  814. * around the mask + shift defs.
  815. */
  816. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  817. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  818. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  819. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  820. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  821. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  822. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  823. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  824. #define HTT_TX_VDEV_ID_WORD 0
  825. #define HTT_TX_VDEV_ID_MASK 0x3f
  826. #define HTT_TX_VDEV_ID_SHIFT 16
  827. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  828. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  829. #define HTT_TX_MSDU_LEN_DWORD 1
  830. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  831. /*
  832. * HTT_VAR_PADDR macros
  833. * Allow physical / bus addresses to be either a single 32-bit value,
  834. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  835. */
  836. #define HTT_VAR_PADDR32(var_name) \
  837. A_UINT32 var_name
  838. #define HTT_VAR_PADDR64_LE(var_name) \
  839. struct { \
  840. /* little-endian: lo precedes hi */ \
  841. A_UINT32 lo; \
  842. A_UINT32 hi; \
  843. } var_name
  844. /*
  845. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  846. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  847. * addresses are stored in a XXX-bit field.
  848. * This macro is used to define both htt_tx_msdu_desc32_t and
  849. * htt_tx_msdu_desc64_t structs.
  850. */
  851. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  852. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  853. { \
  854. /* DWORD 0: flags and meta-data */ \
  855. A_UINT32 \
  856. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  857. \
  858. /* pkt_subtype - \
  859. * Detailed specification of the tx frame contents, extending the \
  860. * general specification provided by pkt_type. \
  861. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  862. * pkt_type | pkt_subtype \
  863. * ============================================================== \
  864. * 802.3 | bit 0:3 - Reserved \
  865. * | bit 4: 0x0 - Copy-Engine Classification Results \
  866. * | not appended to the HTT message \
  867. * | 0x1 - Copy-Engine Classification Results \
  868. * | appended to the HTT message in the \
  869. * | format: \
  870. * | [HTT tx desc, frame header, \
  871. * | CE classification results] \
  872. * | The CE classification results begin \
  873. * | at the next 4-byte boundary after \
  874. * | the frame header. \
  875. * ------------+------------------------------------------------- \
  876. * Eth2 | bit 0:3 - Reserved \
  877. * | bit 4: 0x0 - Copy-Engine Classification Results \
  878. * | not appended to the HTT message \
  879. * | 0x1 - Copy-Engine Classification Results \
  880. * | appended to the HTT message. \
  881. * | See the above specification of the \
  882. * | CE classification results location. \
  883. * ------------+------------------------------------------------- \
  884. * native WiFi | bit 0:3 - Reserved \
  885. * | bit 4: 0x0 - Copy-Engine Classification Results \
  886. * | not appended to the HTT message \
  887. * | 0x1 - Copy-Engine Classification Results \
  888. * | appended to the HTT message. \
  889. * | See the above specification of the \
  890. * | CE classification results location. \
  891. * ------------+------------------------------------------------- \
  892. * mgmt | 0x0 - 802.11 MAC header absent \
  893. * | 0x1 - 802.11 MAC header present \
  894. * ------------+------------------------------------------------- \
  895. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  896. * | 0x1 - 802.11 MAC header present \
  897. * | bit 1: 0x0 - allow aggregation \
  898. * | 0x1 - don't allow aggregation \
  899. * | bit 2: 0x0 - perform encryption \
  900. * | 0x1 - don't perform encryption \
  901. * | bit 3: 0x0 - perform tx classification / queuing \
  902. * | 0x1 - don't perform tx classification; \
  903. * | insert the frame into the "misc" \
  904. * | tx queue \
  905. * | bit 4: 0x0 - Copy-Engine Classification Results \
  906. * | not appended to the HTT message \
  907. * | 0x1 - Copy-Engine Classification Results \
  908. * | appended to the HTT message. \
  909. * | See the above specification of the \
  910. * | CE classification results location. \
  911. */ \
  912. pkt_subtype: 5, \
  913. \
  914. /* pkt_type - \
  915. * General specification of the tx frame contents. \
  916. * The htt_pkt_type enum should be used to specify and check the \
  917. * value of this field. \
  918. */ \
  919. pkt_type: 3, \
  920. \
  921. /* vdev_id - \
  922. * ID for the vdev that is sending this tx frame. \
  923. * For certain non-standard packet types, e.g. pkt_type == raw \
  924. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  925. * This field is used primarily for determining where to queue \
  926. * broadcast and multicast frames. \
  927. */ \
  928. vdev_id: 6, \
  929. /* ext_tid - \
  930. * The extended traffic ID. \
  931. * If the TID is unknown, the extended TID is set to \
  932. * HTT_TX_EXT_TID_INVALID. \
  933. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  934. * value of the QoS TID. \
  935. * If the tx frame is non-QoS data, then the extended TID is set to \
  936. * HTT_TX_EXT_TID_NON_QOS. \
  937. * If the tx frame is multicast or broadcast, then the extended TID \
  938. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  939. */ \
  940. ext_tid: 5, \
  941. \
  942. /* postponed - \
  943. * This flag indicates whether the tx frame has been downloaded to \
  944. * the target before but discarded by the target, and now is being \
  945. * downloaded again; or if this is a new frame that is being \
  946. * downloaded for the first time. \
  947. * This flag allows the target to determine the correct order for \
  948. * transmitting new vs. old frames. \
  949. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  950. * This flag only applies to HL systems, since in LL systems, \
  951. * the tx flow control is handled entirely within the target. \
  952. */ \
  953. postponed: 1, \
  954. \
  955. /* extension - \
  956. * This flag indicates whether a HTT tx MSDU extension descriptor \
  957. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  958. * \
  959. * 0x0 - no extension MSDU descriptor is present \
  960. * 0x1 - an extension MSDU descriptor immediately follows the \
  961. * regular MSDU descriptor \
  962. */ \
  963. extension: 1, \
  964. \
  965. /* cksum_offload - \
  966. * This flag indicates whether checksum offload is enabled or not \
  967. * for this frame. Target FW use this flag to turn on HW checksumming \
  968. * 0x0 - No checksum offload \
  969. * 0x1 - L3 header checksum only \
  970. * 0x2 - L4 checksum only \
  971. * 0x3 - L3 header checksum + L4 checksum \
  972. */ \
  973. cksum_offload: 2, \
  974. \
  975. /* tx_comp_req - \
  976. * This flag indicates whether Tx Completion \
  977. * from fw is required or not. \
  978. * This flag is only relevant if tx completion is not \
  979. * universally enabled. \
  980. * For all LL systems, tx completion is mandatory, \
  981. * so this flag will be irrelevant. \
  982. * For HL systems tx completion is optional, but HL systems in which \
  983. * the bus throughput exceeds the WLAN throughput will \
  984. * probably want to always use tx completion, and thus \
  985. * would not check this flag. \
  986. * This flag is required when tx completions are not used universally, \
  987. * but are still required for certain tx frames for which \
  988. * an OTA delivery acknowledgment is needed by the host. \
  989. * In practice, this would be for HL systems in which the \
  990. * bus throughput is less than the WLAN throughput. \
  991. * \
  992. * 0x0 - Tx Completion Indication from Fw not required \
  993. * 0x1 - Tx Completion Indication from Fw is required \
  994. */ \
  995. tx_compl_req: 1; \
  996. \
  997. \
  998. /* DWORD 1: MSDU length and ID */ \
  999. A_UINT32 \
  1000. len: 16, /* MSDU length, in bytes */ \
  1001. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1002. * and this id is used to calculate fragmentation \
  1003. * descriptor pointer inside the target based on \
  1004. * the base address, configured inside the target. \
  1005. */ \
  1006. \
  1007. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1008. /* frags_desc_ptr - \
  1009. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1010. * where the tx frame's fragments reside in memory. \
  1011. * This field only applies to LL systems, since in HL systems the \
  1012. * (degenerate single-fragment) fragmentation descriptor is created \
  1013. * within the target. \
  1014. */ \
  1015. _paddr__frags_desc_ptr_; \
  1016. \
  1017. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1018. /* \
  1019. * Peer ID : Target can use this value to know which peer-id packet \
  1020. * destined to. \
  1021. * It's intended to be specified by host in case of NAWDS. \
  1022. */ \
  1023. A_UINT16 peerid; \
  1024. \
  1025. /* \
  1026. * Channel frequency: This identifies the desired channel \
  1027. * frequency (in mhz) for tx frames. This is used by FW to help \
  1028. * determine when it is safe to transmit or drop frames for \
  1029. * off-channel operation. \
  1030. * The default value of zero indicates to FW that the corresponding \
  1031. * VDEV's home channel (if there is one) is the desired channel \
  1032. * frequency. \
  1033. */ \
  1034. A_UINT16 chanfreq; \
  1035. \
  1036. /* Reason reserved is commented is increasing the htt structure size \
  1037. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1038. * A_UINT32 reserved_dword3_bits0_31; \
  1039. */ \
  1040. } POSTPACK
  1041. /* define a htt_tx_msdu_desc32_t type */
  1042. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1043. /* define a htt_tx_msdu_desc64_t type */
  1044. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1045. /*
  1046. * Make htt_tx_msdu_desc_t be an alias for either
  1047. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1048. */
  1049. #if HTT_PADDR64
  1050. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1051. #else
  1052. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1053. #endif
  1054. /* decriptor information for Management frame*/
  1055. /*
  1056. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1057. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1058. */
  1059. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1060. extern A_UINT32 mgmt_hdr_len;
  1061. PREPACK struct htt_mgmt_tx_desc_t {
  1062. A_UINT32 msg_type;
  1063. #if HTT_PADDR64
  1064. A_UINT64 frag_paddr; /* DMAble address of the data */
  1065. #else
  1066. A_UINT32 frag_paddr; /* DMAble address of the data */
  1067. #endif
  1068. A_UINT32 desc_id; /* returned to host during completion
  1069. * to free the meory*/
  1070. A_UINT32 len; /* Fragment length */
  1071. A_UINT32 vdev_id; /* virtual device ID*/
  1072. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1073. } POSTPACK;
  1074. PREPACK struct htt_mgmt_tx_compl_ind {
  1075. A_UINT32 desc_id;
  1076. A_UINT32 status;
  1077. } POSTPACK;
  1078. /*
  1079. * This SDU header size comes from the summation of the following:
  1080. * 1. Max of:
  1081. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1082. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1083. * b. 802.11 header, for raw frames: 36 bytes
  1084. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1085. * QoS header, HT header)
  1086. * c. 802.3 header, for ethernet frames: 14 bytes
  1087. * (destination address, source address, ethertype / length)
  1088. * 2. Max of:
  1089. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1090. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1091. * 3. 802.1Q VLAN header: 4 bytes
  1092. * 4. LLC/SNAP header: 8 bytes
  1093. */
  1094. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1095. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1096. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1097. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1098. A_COMPILE_TIME_ASSERT(
  1099. htt_encap_hdr_size_max_check_nwifi,
  1100. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1101. A_COMPILE_TIME_ASSERT(
  1102. htt_encap_hdr_size_max_check_enet,
  1103. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1104. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1105. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1106. #define HTT_TX_HDR_SIZE_802_1Q 4
  1107. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1108. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1109. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1110. HTT_TX_HDR_SIZE_802_1Q + \
  1111. HTT_TX_HDR_SIZE_LLC_SNAP)
  1112. #define HTT_HL_TX_FRM_HDR_LEN \
  1113. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1114. #define HTT_LL_TX_FRM_HDR_LEN \
  1115. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1116. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1117. /* dword 0 */
  1118. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1119. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1120. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1121. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1122. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1123. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1124. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1125. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1126. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1127. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1128. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1129. #define HTT_TX_DESC_PKT_TYPE_S 13
  1130. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1131. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1132. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1133. #define HTT_TX_DESC_VDEV_ID_S 16
  1134. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1135. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1136. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1137. #define HTT_TX_DESC_EXT_TID_S 22
  1138. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1139. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1140. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1141. #define HTT_TX_DESC_POSTPONED_S 27
  1142. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1143. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1144. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1145. #define HTT_TX_DESC_EXTENSION_S 28
  1146. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1147. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1148. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1149. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1150. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1151. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1152. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1153. #define HTT_TX_DESC_TX_COMP_S 31
  1154. /* dword 1 */
  1155. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1156. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1157. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1158. #define HTT_TX_DESC_FRM_LEN_S 0
  1159. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1160. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1161. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1162. #define HTT_TX_DESC_FRM_ID_S 16
  1163. /* dword 2 */
  1164. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1165. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1166. /* for systems using 64-bit format for bus addresses */
  1167. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1168. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1169. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1170. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1171. /* for systems using 32-bit format for bus addresses */
  1172. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1173. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1174. /* dword 3 */
  1175. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1176. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1177. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1178. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1179. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1180. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1181. #if HTT_PADDR64
  1182. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1183. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1184. #else
  1185. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1186. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1187. #endif
  1188. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1189. #define HTT_TX_DESC_PEER_ID_S 0
  1190. /*
  1191. * TEMPORARY:
  1192. * The original definitions for the PEER_ID fields contained typos
  1193. * (with _DESC_PADDR appended to this PEER_ID field name).
  1194. * Retain deprecated original names for PEER_ID fields until all code that
  1195. * refers to them has been updated.
  1196. */
  1197. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1198. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1199. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1200. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1201. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1202. HTT_TX_DESC_PEER_ID_M
  1203. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1204. HTT_TX_DESC_PEER_ID_S
  1205. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1206. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1207. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1208. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1209. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1210. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1211. #if HTT_PADDR64
  1212. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1213. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1214. #else
  1215. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1216. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1217. #endif
  1218. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1219. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1220. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1221. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1222. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1226. } while (0)
  1227. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1229. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1236. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1240. } while (0)
  1241. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1242. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1243. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1247. } while (0)
  1248. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1249. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1250. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1254. } while (0)
  1255. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1256. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1257. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1261. } while (0)
  1262. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1263. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1264. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1268. } while (0)
  1269. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1270. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1271. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1275. } while (0)
  1276. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1277. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1278. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1282. } while (0)
  1283. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1285. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1292. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1299. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1306. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1310. } while (0)
  1311. /* enums used in the HTT tx MSDU extension descriptor */
  1312. enum {
  1313. htt_tx_guard_interval_regular = 0,
  1314. htt_tx_guard_interval_short = 1,
  1315. };
  1316. enum {
  1317. htt_tx_preamble_type_ofdm = 0,
  1318. htt_tx_preamble_type_cck = 1,
  1319. htt_tx_preamble_type_ht = 2,
  1320. htt_tx_preamble_type_vht = 3,
  1321. };
  1322. enum {
  1323. htt_tx_bandwidth_5MHz = 0,
  1324. htt_tx_bandwidth_10MHz = 1,
  1325. htt_tx_bandwidth_20MHz = 2,
  1326. htt_tx_bandwidth_40MHz = 3,
  1327. htt_tx_bandwidth_80MHz = 4,
  1328. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1329. };
  1330. /**
  1331. * @brief HTT tx MSDU extension descriptor
  1332. * @details
  1333. * If the target supports HTT tx MSDU extension descriptors, the host has
  1334. * the option of appending the following struct following the regular
  1335. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1336. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1337. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1338. * tx specs for each frame.
  1339. */
  1340. PREPACK struct htt_tx_msdu_desc_ext_t {
  1341. /* DWORD 0: flags */
  1342. A_UINT32
  1343. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1344. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1345. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1346. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1347. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1348. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1349. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1350. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1351. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1352. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1353. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1354. /* DWORD 1: tx power, tx rate, tx BW */
  1355. A_UINT32
  1356. /* pwr -
  1357. * Specify what power the tx frame needs to be transmitted at.
  1358. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1359. * The value needs to be appropriately sign-extended when extracting
  1360. * the value from the message and storing it in a variable that is
  1361. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1362. * automatically handles this sign-extension.)
  1363. * If the transmission uses multiple tx chains, this power spec is
  1364. * the total transmit power, assuming incoherent combination of
  1365. * per-chain power to produce the total power.
  1366. */
  1367. pwr: 8,
  1368. /* mcs_mask -
  1369. * Specify the allowable values for MCS index (modulation and coding)
  1370. * to use for transmitting the frame.
  1371. *
  1372. * For HT / VHT preamble types, this mask directly corresponds to
  1373. * the HT or VHT MCS indices that are allowed. For each bit N set
  1374. * within the mask, MCS index N is allowed for transmitting the frame.
  1375. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1376. * rates versus OFDM rates, so the host has the option of specifying
  1377. * that the target must transmit the frame with CCK or OFDM rates
  1378. * (not HT or VHT), but leaving the decision to the target whether
  1379. * to use CCK or OFDM.
  1380. *
  1381. * For CCK and OFDM, the bits within this mask are interpreted as
  1382. * follows:
  1383. * bit 0 -> CCK 1 Mbps rate is allowed
  1384. * bit 1 -> CCK 2 Mbps rate is allowed
  1385. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1386. * bit 3 -> CCK 11 Mbps rate is allowed
  1387. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1388. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1389. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1390. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1391. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1392. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1393. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1394. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1395. *
  1396. * The MCS index specification needs to be compatible with the
  1397. * bandwidth mask specification. For example, a MCS index == 9
  1398. * specification is inconsistent with a preamble type == VHT,
  1399. * Nss == 1, and channel bandwidth == 20 MHz.
  1400. *
  1401. * Furthermore, the host has only a limited ability to specify to
  1402. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1403. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1404. */
  1405. mcs_mask: 12,
  1406. /* nss_mask -
  1407. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1408. * Each bit in this mask corresponds to a Nss value:
  1409. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1410. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1411. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1412. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1413. * The values in the Nss mask must be suitable for the recipient, e.g.
  1414. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1415. * recipient which only supports 2x2 MIMO.
  1416. */
  1417. nss_mask: 4,
  1418. /* guard_interval -
  1419. * Specify a htt_tx_guard_interval enum value to indicate whether
  1420. * the transmission should use a regular guard interval or a
  1421. * short guard interval.
  1422. */
  1423. guard_interval: 1,
  1424. /* preamble_type_mask -
  1425. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1426. * may choose from for transmitting this frame.
  1427. * The bits in this mask correspond to the values in the
  1428. * htt_tx_preamble_type enum. For example, to allow the target
  1429. * to transmit the frame as either CCK or OFDM, this field would
  1430. * be set to
  1431. * (1 << htt_tx_preamble_type_ofdm) |
  1432. * (1 << htt_tx_preamble_type_cck)
  1433. */
  1434. preamble_type_mask: 4,
  1435. reserved1_31_29: 3; /* unused, set to 0x0 */
  1436. /* DWORD 2: tx chain mask, tx retries */
  1437. A_UINT32
  1438. /* chain_mask - specify which chains to transmit from */
  1439. chain_mask: 4,
  1440. /* retry_limit -
  1441. * Specify the maximum number of transmissions, including the
  1442. * initial transmission, to attempt before giving up if no ack
  1443. * is received.
  1444. * If the tx rate is specified, then all retries shall use the
  1445. * same rate as the initial transmission.
  1446. * If no tx rate is specified, the target can choose whether to
  1447. * retain the original rate during the retransmissions, or to
  1448. * fall back to a more robust rate.
  1449. */
  1450. retry_limit: 4,
  1451. /* bandwidth_mask -
  1452. * Specify what channel widths may be used for the transmission.
  1453. * A value of zero indicates "don't care" - the target may choose
  1454. * the transmission bandwidth.
  1455. * The bits within this mask correspond to the htt_tx_bandwidth
  1456. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1457. * The bandwidth_mask must be consistent with the preamble_type_mask
  1458. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1459. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1460. */
  1461. bandwidth_mask: 6,
  1462. reserved2_31_14: 18; /* unused, set to 0x0 */
  1463. /* DWORD 3: tx expiry time (TSF) LSBs */
  1464. A_UINT32 expire_tsf_lo;
  1465. /* DWORD 4: tx expiry time (TSF) MSBs */
  1466. A_UINT32 expire_tsf_hi;
  1467. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1468. } POSTPACK;
  1469. /* DWORD 0 */
  1470. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1490. /* DWORD 1 */
  1491. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1492. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1493. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1494. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1495. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1496. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1497. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1498. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1499. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1500. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1501. /* DWORD 2 */
  1502. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1503. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1504. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1505. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1506. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1507. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1508. /* DWORD 0 */
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1510. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1511. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1513. do { \
  1514. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1515. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1516. } while (0)
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1518. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1519. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1521. do { \
  1522. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1523. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1524. } while (0)
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1526. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1527. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1529. do { \
  1530. HTT_CHECK_SET_VAL( \
  1531. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1532. ((_var) |= ((_val) \
  1533. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1534. } while (0)
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1536. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1537. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1539. do { \
  1540. HTT_CHECK_SET_VAL( \
  1541. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1542. ((_var) |= ((_val) \
  1543. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1544. } while (0)
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1546. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1547. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1549. do { \
  1550. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1551. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1552. } while (0)
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1554. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1555. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1556. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1557. do { \
  1558. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1559. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1560. } while (0)
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1563. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1567. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1584. } while (0)
  1585. /* DWORD 1 */
  1586. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1588. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1589. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1590. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1591. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1592. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1593. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1594. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1595. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1597. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1598. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1621. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1622. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1626. } while (0)
  1627. /* DWORD 2 */
  1628. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1630. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1631. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1635. } while (0)
  1636. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1638. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1639. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1651. } while (0)
  1652. typedef enum {
  1653. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1654. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1655. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1656. } htt_11ax_ltf_subtype_t;
  1657. typedef enum {
  1658. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1659. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1660. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1661. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1662. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1663. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1664. } htt_tx_ext2_preamble_type_t;
  1665. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1666. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1667. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1668. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1669. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1670. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1671. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1672. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1677. /**
  1678. * @brief HTT tx MSDU extension descriptor v2
  1679. * @details
  1680. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1681. * is received as tcl_exit_base->host_meta_info in firmware.
  1682. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1683. * are already part of tcl_exit_base.
  1684. */
  1685. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1686. /* DWORD 0: flags */
  1687. A_UINT32
  1688. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1689. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1690. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1691. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1692. valid_retries : 1, /* if set, tx retries spec is valid */
  1693. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1694. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1695. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1696. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1697. valid_key_flags : 1, /* if set, key flags is valid */
  1698. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1699. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1700. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1701. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1702. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1703. 1 = ENCRYPT,
  1704. 2 ~ 3 - Reserved */
  1705. /* retry_limit -
  1706. * Specify the maximum number of transmissions, including the
  1707. * initial transmission, to attempt before giving up if no ack
  1708. * is received.
  1709. * If the tx rate is specified, then all retries shall use the
  1710. * same rate as the initial transmission.
  1711. * If no tx rate is specified, the target can choose whether to
  1712. * retain the original rate during the retransmissions, or to
  1713. * fall back to a more robust rate.
  1714. */
  1715. retry_limit : 4,
  1716. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1717. * Valid only for 11ax preamble types HE_SU
  1718. * and HE_EXT_SU
  1719. */
  1720. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1721. * Valid only for 11ax preamble types HE_SU
  1722. * and HE_EXT_SU
  1723. */
  1724. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1725. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1726. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1727. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1728. */
  1729. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1730. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1731. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1732. * Use cases:
  1733. * Any time firmware uses TQM-BYPASS for Data
  1734. * TID, firmware expect host to set this bit.
  1735. */
  1736. /* DWORD 1: tx power, tx rate */
  1737. A_UINT32
  1738. power : 8, /* unit of the power field is 0.5 dbm
  1739. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1740. * signed value ranging from -64dbm to 63.5 dbm
  1741. */
  1742. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1743. * Setting more than one MCS isn't currently
  1744. * supported by the target (but is supported
  1745. * in the interface in case in the future
  1746. * the target supports specifications of
  1747. * a limited set of MCS values.
  1748. */
  1749. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1750. * Setting more than one Nss isn't currently
  1751. * supported by the target (but is supported
  1752. * in the interface in case in the future
  1753. * the target supports specifications of
  1754. * a limited set of Nss values.
  1755. */
  1756. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1757. update_peer_cache : 1; /* When set these custom values will be
  1758. * used for all packets, until the next
  1759. * update via this ext header.
  1760. * This is to make sure not all packets
  1761. * need to include this header.
  1762. */
  1763. /* DWORD 2: tx chain mask, tx retries */
  1764. A_UINT32
  1765. /* chain_mask - specify which chains to transmit from */
  1766. chain_mask : 8,
  1767. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1768. * TODO: Update Enum values for key_flags
  1769. */
  1770. /*
  1771. * Channel frequency: This identifies the desired channel
  1772. * frequency (in MHz) for tx frames. This is used by FW to help
  1773. * determine when it is safe to transmit or drop frames for
  1774. * off-channel operation.
  1775. * The default value of zero indicates to FW that the corresponding
  1776. * VDEV's home channel (if there is one) is the desired channel
  1777. * frequency.
  1778. */
  1779. chanfreq : 16;
  1780. /* DWORD 3: tx expiry time (TSF) LSBs */
  1781. A_UINT32 expire_tsf_lo;
  1782. /* DWORD 4: tx expiry time (TSF) MSBs */
  1783. A_UINT32 expire_tsf_hi;
  1784. /* DWORD 5: flags to control routing / processing of the MSDU */
  1785. A_UINT32
  1786. /* learning_frame
  1787. * When this flag is set, this frame will be dropped by FW
  1788. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1789. */
  1790. learning_frame : 1,
  1791. /* send_as_standalone
  1792. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1793. * i.e. with no A-MSDU or A-MPDU aggregation.
  1794. * The scope is extended to other use-cases.
  1795. */
  1796. send_as_standalone : 1,
  1797. /* is_host_opaque_valid
  1798. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1799. * with valid information.
  1800. */
  1801. is_host_opaque_valid : 1,
  1802. rsvd0 : 29;
  1803. /* DWORD 6 : Host opaque cookie for special frames */
  1804. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1805. rsvd1 : 16;
  1806. /*
  1807. * This structure can be expanded further up to 40 bytes
  1808. * by adding further DWORDs as needed.
  1809. */
  1810. } POSTPACK;
  1811. /* DWORD 0 */
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1838. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1839. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1840. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1841. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1842. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1843. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1844. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1845. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1846. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1847. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1848. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1849. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1850. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1851. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1852. /* DWORD 1 */
  1853. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1854. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1855. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1856. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1857. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1858. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1859. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1860. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1861. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1862. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1863. /* DWORD 2 */
  1864. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1865. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1866. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1867. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1868. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1869. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1870. /* DWORD 5 */
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1877. /* DWORD 6 */
  1878. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1879. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1880. /* DWORD 0 */
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1882. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1883. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1887. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1888. } while (0)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1890. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1891. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1896. } while (0)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1898. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1899. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1904. } while (0)
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1906. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1907. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL( \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1912. ((_var) |= ((_val) \
  1913. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1914. } while (0)
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1916. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1917. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1919. do { \
  1920. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1921. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1922. } while (0)
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1924. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1925. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1927. do { \
  1928. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1929. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1930. } while (0)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1932. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1935. do { \
  1936. HTT_CHECK_SET_VAL( \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1938. ((_var) |= ((_val) \
  1939. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1988. } while (0)
  1989. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1990. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1991. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1992. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1996. } while (0)
  1997. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1998. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1999. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2000. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2004. } while (0)
  2005. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2006. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2007. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2008. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2012. } while (0)
  2013. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2014. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2015. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2016. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2020. } while (0)
  2021. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2044. } while (0)
  2045. /* DWORD 1 */
  2046. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2047. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2048. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2049. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2050. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2051. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2052. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2053. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2054. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2055. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2056. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2057. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2058. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2059. do { \
  2060. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2061. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2062. } while (0)
  2063. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2064. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2065. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2066. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2070. } while (0)
  2071. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2072. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2073. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2074. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2078. } while (0)
  2079. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2081. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2082. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2086. } while (0)
  2087. /* DWORD 2 */
  2088. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2089. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2090. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2091. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2095. } while (0)
  2096. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2103. } while (0)
  2104. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2105. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2106. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2107. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2111. } while (0)
  2112. /* DWORD 5 */
  2113. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2114. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2115. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2116. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2117. do { \
  2118. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2119. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2120. } while (0)
  2121. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2122. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2123. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2124. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2128. } while (0)
  2129. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2130. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2131. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2132. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2133. do { \
  2134. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2135. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2136. } while (0)
  2137. /* DWORD 6 */
  2138. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2139. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2140. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2141. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2142. do { \
  2143. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2144. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2145. } while (0)
  2146. typedef enum {
  2147. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2148. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2149. } htt_tcl_metadata_type;
  2150. /**
  2151. * @brief HTT TCL command number format
  2152. * @details
  2153. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2154. * available to firmware as tcl_exit_base->tcl_status_number.
  2155. * For regular / multicast packets host will send vdev and mac id and for
  2156. * NAWDS packets, host will send peer id.
  2157. * A_UINT32 is used to avoid endianness conversion problems.
  2158. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2159. */
  2160. typedef struct {
  2161. A_UINT32
  2162. type: 1, /* vdev_id based or peer_id based */
  2163. rsvd: 31;
  2164. } htt_tx_tcl_vdev_or_peer_t;
  2165. typedef struct {
  2166. A_UINT32
  2167. type: 1, /* vdev_id based or peer_id based */
  2168. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2169. vdev_id: 8,
  2170. pdev_id: 2,
  2171. host_inspected:1,
  2172. rsvd: 19;
  2173. } htt_tx_tcl_vdev_metadata;
  2174. typedef struct {
  2175. A_UINT32
  2176. type: 1, /* vdev_id based or peer_id based */
  2177. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2178. peer_id: 14,
  2179. rsvd: 16;
  2180. } htt_tx_tcl_peer_metadata;
  2181. PREPACK struct htt_tx_tcl_metadata {
  2182. union {
  2183. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2184. htt_tx_tcl_vdev_metadata vdev_meta;
  2185. htt_tx_tcl_peer_metadata peer_meta;
  2186. };
  2187. } POSTPACK;
  2188. /* DWORD 0 */
  2189. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2190. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2191. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2192. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2193. /* VDEV metadata */
  2194. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2195. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2196. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2197. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2198. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2199. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2200. /* PEER metadata */
  2201. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2202. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2203. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2204. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2205. HTT_TX_TCL_METADATA_TYPE_S)
  2206. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2207. do { \
  2208. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2209. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2210. } while (0)
  2211. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2212. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2213. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2214. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2215. do { \
  2216. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2217. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2218. } while (0)
  2219. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2220. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2221. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2222. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2223. do { \
  2224. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2225. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2226. } while (0)
  2227. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2228. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2229. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2230. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2231. do { \
  2232. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2233. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2234. } while (0)
  2235. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2236. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2237. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2238. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2239. do { \
  2240. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2241. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2242. } while (0)
  2243. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2244. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2245. HTT_TX_TCL_METADATA_PEER_ID_S)
  2246. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2247. do { \
  2248. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2249. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2250. } while (0)
  2251. /*------------------------------------------------------------------
  2252. * V2 Version of TCL Data Command
  2253. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2254. * MLO global_seq all flavours of TCL Data Cmd.
  2255. *-----------------------------------------------------------------*/
  2256. typedef enum {
  2257. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2258. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2259. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2260. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2261. } htt_tcl_metadata_type_v2;
  2262. /**
  2263. * @brief HTT TCL command number format
  2264. * @details
  2265. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2266. * available to firmware as tcl_exit_base->tcl_status_number.
  2267. * A_UINT32 is used to avoid endianness conversion problems.
  2268. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2269. */
  2270. typedef struct {
  2271. A_UINT32
  2272. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2273. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2274. vdev_id: 8,
  2275. pdev_id: 2,
  2276. host_inspected:1,
  2277. rsvd: 2,
  2278. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2279. } htt_tx_tcl_vdev_metadata_v2;
  2280. typedef struct {
  2281. A_UINT32
  2282. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2283. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2284. peer_id: 13,
  2285. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2286. } htt_tx_tcl_peer_metadata_v2;
  2287. typedef struct {
  2288. A_UINT32
  2289. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2290. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2291. svc_class_id: 8,
  2292. rsvd: 5,
  2293. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2294. } htt_tx_tcl_svc_class_id_metadata;
  2295. typedef struct {
  2296. A_UINT32
  2297. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2298. host_inspected: 1,
  2299. global_seq_no: 12,
  2300. rsvd: 1,
  2301. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2302. } htt_tx_tcl_global_seq_metadata;
  2303. PREPACK struct htt_tx_tcl_metadata_v2 {
  2304. union {
  2305. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2306. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2307. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2308. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2309. };
  2310. } POSTPACK;
  2311. /* DWORD 0 */
  2312. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2313. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2314. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2315. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2316. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2317. /* VDEV V2 metadata */
  2318. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2319. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2320. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2321. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2322. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2323. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2324. /* PEER V2 metadata */
  2325. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2326. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2327. /* SVC_CLASS_ID metadata */
  2328. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2329. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2330. /* Global Seq no metadata */
  2331. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2332. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2333. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2334. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2335. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2336. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2337. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2338. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2339. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2340. do { \
  2341. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2342. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2343. } while (0)
  2344. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2345. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2346. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2347. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2351. } while (0)
  2352. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2353. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2354. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2355. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2356. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2360. } while (0)
  2361. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2362. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2363. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2364. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2368. } while (0)
  2369. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2370. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2371. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2372. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2373. do { \
  2374. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2375. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2376. } while (0)
  2377. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2378. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2379. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2380. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2381. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2382. do { \
  2383. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2384. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2385. } while (0)
  2386. /*----- Get and Set V2 type field in Service Class fields ----*/
  2387. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2388. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2389. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2390. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2391. do { \
  2392. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2393. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2394. } while (0)
  2395. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2396. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2397. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2398. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2399. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2403. } while (0)
  2404. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2406. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2407. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2411. } while (0)
  2412. /*------------------------------------------------------------------
  2413. * End V2 Version of TCL Data Command
  2414. *-----------------------------------------------------------------*/
  2415. typedef enum {
  2416. HTT_TX_FW2WBM_TX_STATUS_OK,
  2417. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2418. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2419. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2420. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2421. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2422. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2423. HTT_TX_FW2WBM_TX_STATUS_MAX
  2424. } htt_tx_fw2wbm_tx_status_t;
  2425. typedef enum {
  2426. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2427. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2428. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2429. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2430. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2431. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2432. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2433. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2434. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2435. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2436. } htt_tx_fw2wbm_reinject_reason_t;
  2437. /**
  2438. * @brief HTT TX WBM Completion from firmware to host
  2439. * @details
  2440. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2441. * DWORD 3 and 4 for software based completions (Exception frames and
  2442. * TQM bypass frames)
  2443. * For software based completions, wbm_release_ring->release_source_module will
  2444. * be set to release_source_fw
  2445. */
  2446. PREPACK struct htt_tx_wbm_completion {
  2447. A_UINT32
  2448. sch_cmd_id: 24,
  2449. exception_frame: 1, /* If set, this packet was queued via exception path */
  2450. rsvd0_31_25: 7;
  2451. A_UINT32
  2452. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2453. * reception of an ACK or BA, this field indicates
  2454. * the RSSI of the received ACK or BA frame.
  2455. * When the frame is removed as result of a direct
  2456. * remove command from the SW, this field is set
  2457. * to 0x0 (which is never a valid value when real
  2458. * RSSI is available).
  2459. * Units: dB w.r.t noise floor
  2460. */
  2461. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2462. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2463. rsvd1_31_16: 16;
  2464. } POSTPACK;
  2465. /* DWORD 0 */
  2466. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2467. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2468. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2469. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2470. /* DWORD 1 */
  2471. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2472. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2473. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2474. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2475. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2476. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2477. /* DWORD 0 */
  2478. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2479. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2480. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2481. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2482. do { \
  2483. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2484. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2485. } while (0)
  2486. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2487. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2488. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2489. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2492. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2493. } while (0)
  2494. /* DWORD 1 */
  2495. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2496. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2497. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2498. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2499. do { \
  2500. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2501. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2502. } while (0)
  2503. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2504. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2505. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2506. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2507. do { \
  2508. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2509. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2510. } while (0)
  2511. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2512. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2513. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2514. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2515. do { \
  2516. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2517. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2518. } while (0)
  2519. /**
  2520. * @brief HTT TX WBM Completion from firmware to host
  2521. * @details
  2522. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2523. * (WBM) offload HW.
  2524. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2525. * For software based completions, release_source_module will
  2526. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2527. * struct wbm_release_ring and then switch to this after looking at
  2528. * release_source_module.
  2529. */
  2530. PREPACK struct htt_tx_wbm_completion_v2 {
  2531. A_UINT32
  2532. used_by_hw0; /* Refer to struct wbm_release_ring */
  2533. A_UINT32
  2534. used_by_hw1; /* Refer to struct wbm_release_ring */
  2535. A_UINT32
  2536. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2537. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2538. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2539. exception_frame: 1,
  2540. rsvd0: 12, /* For future use */
  2541. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2542. rsvd1: 1; /* For future use */
  2543. A_UINT32
  2544. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2545. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2546. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2547. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2548. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2549. */
  2550. A_UINT32
  2551. data1: 32;
  2552. A_UINT32
  2553. data2: 32;
  2554. A_UINT32
  2555. used_by_hw3; /* Refer to struct wbm_release_ring */
  2556. } POSTPACK;
  2557. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2558. /* DWORD 3 */
  2559. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2560. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2561. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2562. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2563. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2564. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2565. /* DWORD 3 */
  2566. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2567. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2568. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2569. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2572. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2573. } while (0)
  2574. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2575. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2576. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2577. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2578. do { \
  2579. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2580. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2581. } while (0)
  2582. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2583. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2584. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2585. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2586. do { \
  2587. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2588. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2589. } while (0)
  2590. /**
  2591. * @brief HTT TX WBM Completion from firmware to host (V3)
  2592. * @details
  2593. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2594. * (WBM) offload HW.
  2595. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2596. * For software based completions, release_source_module will
  2597. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2598. * struct wbm_release_ring and then switch to this after looking at
  2599. * release_source_module.
  2600. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2601. * by new generations of targets.
  2602. */
  2603. PREPACK struct htt_tx_wbm_completion_v3 {
  2604. A_UINT32
  2605. used_by_hw0; /* Refer to struct wbm_release_ring */
  2606. A_UINT32
  2607. used_by_hw1; /* Refer to struct wbm_release_ring */
  2608. A_UINT32
  2609. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2610. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2611. used_by_hw3: 15;
  2612. A_UINT32
  2613. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2614. exception_frame: 1,
  2615. rsvd0: 27; /* For future use */
  2616. A_UINT32
  2617. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2618. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2619. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2620. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2621. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2622. */
  2623. A_UINT32
  2624. data1: 32;
  2625. A_UINT32
  2626. data2: 32;
  2627. A_UINT32
  2628. rsvd1: 20,
  2629. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2630. } POSTPACK;
  2631. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2632. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2633. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2634. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2635. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2636. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2637. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2638. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2639. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2640. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2641. do { \
  2642. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2643. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2644. } while (0)
  2645. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2646. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2647. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2648. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2652. } while (0)
  2653. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2654. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2655. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2656. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2657. do { \
  2658. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2659. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2660. } while (0)
  2661. typedef enum {
  2662. TX_FRAME_TYPE_UNDEFINED = 0,
  2663. TX_FRAME_TYPE_EAPOL = 1,
  2664. } htt_tx_wbm_status_frame_type;
  2665. /**
  2666. * @brief HTT TX WBM transmit status from firmware to host
  2667. * @details
  2668. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2669. * (WBM) offload HW.
  2670. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2671. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2672. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2673. */
  2674. PREPACK struct htt_tx_wbm_transmit_status {
  2675. A_UINT32
  2676. sch_cmd_id: 24,
  2677. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2678. * reception of an ACK or BA, this field indicates
  2679. * the RSSI of the received ACK or BA frame.
  2680. * When the frame is removed as result of a direct
  2681. * remove command from the SW, this field is set
  2682. * to 0x0 (which is never a valid value when real
  2683. * RSSI is available).
  2684. * Units: dB w.r.t noise floor
  2685. */
  2686. A_UINT32
  2687. sw_peer_id: 16,
  2688. tid_num: 5,
  2689. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2690. * and tid_num fields contain valid data.
  2691. * If this "valid" flag is not set, the
  2692. * sw_peer_id and tid_num fields must be ignored.
  2693. */
  2694. mcast: 1,
  2695. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2696. * contains valid data.
  2697. */
  2698. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2699. reserved: 4;
  2700. A_UINT32
  2701. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2702. * packets in the wbm completion path
  2703. */
  2704. } POSTPACK;
  2705. /* DWORD 4 */
  2706. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2707. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2708. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2709. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2710. /* DWORD 5 */
  2711. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2712. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2713. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2714. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2715. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2716. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2717. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2718. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2719. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2720. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2721. /* DWORD 4 */
  2722. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2723. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2724. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2725. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2726. do { \
  2727. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2728. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2729. } while (0)
  2730. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2731. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2732. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2733. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2734. do { \
  2735. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2736. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2737. } while (0)
  2738. /* DWORD 5 */
  2739. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2740. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2741. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2742. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2745. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2746. } while (0)
  2747. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2748. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2749. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2750. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2753. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2754. } while (0)
  2755. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2756. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2757. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2758. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2761. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2762. } while (0)
  2763. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2764. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2765. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2766. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2769. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2770. } while (0)
  2771. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2772. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2773. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2774. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2777. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2778. } while (0)
  2779. /**
  2780. * @brief HTT TX WBM reinject status from firmware to host
  2781. * @details
  2782. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2783. * (WBM) offload HW.
  2784. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2785. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2786. */
  2787. PREPACK struct htt_tx_wbm_reinject_status {
  2788. A_UINT32
  2789. reserved0: 32;
  2790. A_UINT32
  2791. reserved1: 32;
  2792. A_UINT32
  2793. reserved2: 32;
  2794. } POSTPACK;
  2795. /**
  2796. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2797. * @details
  2798. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2799. * (WBM) offload HW.
  2800. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2801. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2802. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2803. * STA side.
  2804. */
  2805. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2806. A_UINT32
  2807. mec_sa_addr_31_0;
  2808. A_UINT32
  2809. mec_sa_addr_47_32: 16,
  2810. sa_ast_index: 16;
  2811. A_UINT32
  2812. vdev_id: 8,
  2813. reserved0: 24;
  2814. } POSTPACK;
  2815. /* DWORD 4 - mec_sa_addr_31_0 */
  2816. /* DWORD 5 */
  2817. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2818. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2819. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2820. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2821. /* DWORD 6 */
  2822. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2823. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2824. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2825. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2826. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2827. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2830. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2831. } while (0)
  2832. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2833. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2834. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2835. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2838. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2839. } while (0)
  2840. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2841. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2842. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2843. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2846. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2847. } while (0)
  2848. typedef enum {
  2849. TX_FLOW_PRIORITY_BE,
  2850. TX_FLOW_PRIORITY_HIGH,
  2851. TX_FLOW_PRIORITY_LOW,
  2852. } htt_tx_flow_priority_t;
  2853. typedef enum {
  2854. TX_FLOW_LATENCY_SENSITIVE,
  2855. TX_FLOW_LATENCY_INSENSITIVE,
  2856. } htt_tx_flow_latency_t;
  2857. typedef enum {
  2858. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2859. TX_FLOW_INTERACTIVE_TRAFFIC,
  2860. TX_FLOW_PERIODIC_TRAFFIC,
  2861. TX_FLOW_BURSTY_TRAFFIC,
  2862. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2863. } htt_tx_flow_traffic_pattern_t;
  2864. /**
  2865. * @brief HTT TX Flow search metadata format
  2866. * @details
  2867. * Host will set this metadata in flow table's flow search entry along with
  2868. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2869. * firmware and TQM ring if the flow search entry wins.
  2870. * This metadata is available to firmware in that first MSDU's
  2871. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2872. * to one of the available flows for specific tid and returns the tqm flow
  2873. * pointer as part of htt_tx_map_flow_info message.
  2874. */
  2875. PREPACK struct htt_tx_flow_metadata {
  2876. A_UINT32
  2877. rsvd0_1_0: 2,
  2878. tid: 4,
  2879. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2880. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2881. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2882. * Else choose final tid based on latency, priority.
  2883. */
  2884. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2885. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2886. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2887. } POSTPACK;
  2888. /* DWORD 0 */
  2889. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2890. #define HTT_TX_FLOW_METADATA_TID_S 2
  2891. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2892. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2893. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2894. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2895. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2896. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2897. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2898. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2899. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2900. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2901. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2902. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2903. /* DWORD 0 */
  2904. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2905. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2906. HTT_TX_FLOW_METADATA_TID_S)
  2907. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2910. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2911. } while (0)
  2912. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2913. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2914. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2915. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2918. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2919. } while (0)
  2920. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2921. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2922. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2923. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2926. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2927. } while (0)
  2928. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2929. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2930. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2931. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2934. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2935. } while (0)
  2936. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2937. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2938. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2939. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2942. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2943. } while (0)
  2944. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2945. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2946. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2947. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2950. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2951. } while (0)
  2952. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2953. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2954. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2955. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2958. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2959. } while (0)
  2960. /**
  2961. * @brief host -> target ADD WDS Entry
  2962. *
  2963. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2964. *
  2965. * @brief host -> target DELETE WDS Entry
  2966. *
  2967. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2968. *
  2969. * @details
  2970. * HTT wds entry from source port learning
  2971. * Host will learn wds entries from rx and send this message to firmware
  2972. * to enable firmware to configure/delete AST entries for wds clients.
  2973. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2974. * and when SA's entry is deleted, firmware removes this AST entry
  2975. *
  2976. * The message would appear as follows:
  2977. *
  2978. * |31 30|29 |17 16|15 8|7 0|
  2979. * |----------------+----------------+----------------+----------------|
  2980. * | rsvd0 |PDVID| vdev_id | msg_type |
  2981. * |-------------------------------------------------------------------|
  2982. * | sa_addr_31_0 |
  2983. * |-------------------------------------------------------------------|
  2984. * | | ta_peer_id | sa_addr_47_32 |
  2985. * |-------------------------------------------------------------------|
  2986. * Where PDVID = pdev_id
  2987. *
  2988. * The message is interpreted as follows:
  2989. *
  2990. * dword0 - b'0:7 - msg_type: This will be set to
  2991. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2992. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2993. *
  2994. * dword0 - b'8:15 - vdev_id
  2995. *
  2996. * dword0 - b'16:17 - pdev_id
  2997. *
  2998. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2999. *
  3000. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3001. *
  3002. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3003. *
  3004. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3005. */
  3006. PREPACK struct htt_wds_entry {
  3007. A_UINT32
  3008. msg_type: 8,
  3009. vdev_id: 8,
  3010. pdev_id: 2,
  3011. rsvd0: 14;
  3012. A_UINT32 sa_addr_31_0;
  3013. A_UINT32
  3014. sa_addr_47_32: 16,
  3015. ta_peer_id: 14,
  3016. rsvd2: 2;
  3017. } POSTPACK;
  3018. /* DWORD 0 */
  3019. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3020. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3021. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3022. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3023. /* DWORD 2 */
  3024. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3025. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3026. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3027. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3028. /* DWORD 0 */
  3029. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3030. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3031. HTT_WDS_ENTRY_VDEV_ID_S)
  3032. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3033. do { \
  3034. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3035. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3036. } while (0)
  3037. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3038. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3039. HTT_WDS_ENTRY_PDEV_ID_S)
  3040. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3041. do { \
  3042. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3043. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3044. } while (0)
  3045. /* DWORD 2 */
  3046. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3047. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3048. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3049. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3050. do { \
  3051. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3052. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3053. } while (0)
  3054. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3055. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3056. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3057. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3058. do { \
  3059. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3060. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3061. } while (0)
  3062. /**
  3063. * @brief MAC DMA rx ring setup specification
  3064. *
  3065. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3066. *
  3067. * @details
  3068. * To allow for dynamic rx ring reconfiguration and to avoid race
  3069. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3070. * it uses. Instead, it sends this message to the target, indicating how
  3071. * the rx ring used by the host should be set up and maintained.
  3072. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3073. * specifications.
  3074. *
  3075. * |31 16|15 8|7 0|
  3076. * |---------------------------------------------------------------|
  3077. * header: | reserved | num rings | msg type |
  3078. * |---------------------------------------------------------------|
  3079. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3080. #if HTT_PADDR64
  3081. * | FW_IDX shadow register physical address (bits 63:32) |
  3082. #endif
  3083. * |---------------------------------------------------------------|
  3084. * | rx ring base physical address (bits 31:0) |
  3085. #if HTT_PADDR64
  3086. * | rx ring base physical address (bits 63:32) |
  3087. #endif
  3088. * |---------------------------------------------------------------|
  3089. * | rx ring buffer size | rx ring length |
  3090. * |---------------------------------------------------------------|
  3091. * | FW_IDX initial value | enabled flags |
  3092. * |---------------------------------------------------------------|
  3093. * | MSDU payload offset | 802.11 header offset |
  3094. * |---------------------------------------------------------------|
  3095. * | PPDU end offset | PPDU start offset |
  3096. * |---------------------------------------------------------------|
  3097. * | MPDU end offset | MPDU start offset |
  3098. * |---------------------------------------------------------------|
  3099. * | MSDU end offset | MSDU start offset |
  3100. * |---------------------------------------------------------------|
  3101. * | frag info offset | rx attention offset |
  3102. * |---------------------------------------------------------------|
  3103. * payload 2, if present, has the same format as payload 1
  3104. * Header fields:
  3105. * - MSG_TYPE
  3106. * Bits 7:0
  3107. * Purpose: identifies this as an rx ring configuration message
  3108. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3109. * - NUM_RINGS
  3110. * Bits 15:8
  3111. * Purpose: indicates whether the host is setting up one rx ring or two
  3112. * Value: 1 or 2
  3113. * Payload:
  3114. * for systems using 64-bit format for bus addresses:
  3115. * - IDX_SHADOW_REG_PADDR_LO
  3116. * Bits 31:0
  3117. * Value: lower 4 bytes of physical address of the host's
  3118. * FW_IDX shadow register
  3119. * - IDX_SHADOW_REG_PADDR_HI
  3120. * Bits 31:0
  3121. * Value: upper 4 bytes of physical address of the host's
  3122. * FW_IDX shadow register
  3123. * - RING_BASE_PADDR_LO
  3124. * Bits 31:0
  3125. * Value: lower 4 bytes of physical address of the host's rx ring
  3126. * - RING_BASE_PADDR_HI
  3127. * Bits 31:0
  3128. * Value: uppper 4 bytes of physical address of the host's rx ring
  3129. * for systems using 32-bit format for bus addresses:
  3130. * - IDX_SHADOW_REG_PADDR
  3131. * Bits 31:0
  3132. * Value: physical address of the host's FW_IDX shadow register
  3133. * - RING_BASE_PADDR
  3134. * Bits 31:0
  3135. * Value: physical address of the host's rx ring
  3136. * - RING_LEN
  3137. * Bits 15:0
  3138. * Value: number of elements in the rx ring
  3139. * - RING_BUF_SZ
  3140. * Bits 31:16
  3141. * Value: size of the buffers referenced by the rx ring, in byte units
  3142. * - ENABLED_FLAGS
  3143. * Bits 15:0
  3144. * Value: 1-bit flags to show whether different rx fields are enabled
  3145. * bit 0: 802.11 header enabled (1) or disabled (0)
  3146. * bit 1: MSDU payload enabled (1) or disabled (0)
  3147. * bit 2: PPDU start enabled (1) or disabled (0)
  3148. * bit 3: PPDU end enabled (1) or disabled (0)
  3149. * bit 4: MPDU start enabled (1) or disabled (0)
  3150. * bit 5: MPDU end enabled (1) or disabled (0)
  3151. * bit 6: MSDU start enabled (1) or disabled (0)
  3152. * bit 7: MSDU end enabled (1) or disabled (0)
  3153. * bit 8: rx attention enabled (1) or disabled (0)
  3154. * bit 9: frag info enabled (1) or disabled (0)
  3155. * bit 10: unicast rx enabled (1) or disabled (0)
  3156. * bit 11: multicast rx enabled (1) or disabled (0)
  3157. * bit 12: ctrl rx enabled (1) or disabled (0)
  3158. * bit 13: mgmt rx enabled (1) or disabled (0)
  3159. * bit 14: null rx enabled (1) or disabled (0)
  3160. * bit 15: phy data rx enabled (1) or disabled (0)
  3161. * - IDX_INIT_VAL
  3162. * Bits 31:16
  3163. * Purpose: Specify the initial value for the FW_IDX.
  3164. * Value: the number of buffers initially present in the host's rx ring
  3165. * - OFFSET_802_11_HDR
  3166. * Bits 15:0
  3167. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3168. * - OFFSET_MSDU_PAYLOAD
  3169. * Bits 31:16
  3170. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3171. * - OFFSET_PPDU_START
  3172. * Bits 15:0
  3173. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3174. * - OFFSET_PPDU_END
  3175. * Bits 31:16
  3176. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3177. * - OFFSET_MPDU_START
  3178. * Bits 15:0
  3179. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3180. * - OFFSET_MPDU_END
  3181. * Bits 31:16
  3182. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3183. * - OFFSET_MSDU_START
  3184. * Bits 15:0
  3185. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3186. * - OFFSET_MSDU_END
  3187. * Bits 31:16
  3188. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3189. * - OFFSET_RX_ATTN
  3190. * Bits 15:0
  3191. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3192. * - OFFSET_FRAG_INFO
  3193. * Bits 31:16
  3194. * Value: offset in QUAD-bytes of frag info table
  3195. */
  3196. /* header fields */
  3197. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3198. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3199. /* payload fields */
  3200. /* for systems using a 64-bit format for bus addresses */
  3201. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3202. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3203. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3204. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3205. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3206. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3207. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3208. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3209. /* for systems using a 32-bit format for bus addresses */
  3210. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3212. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3213. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3214. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3215. #define HTT_RX_RING_CFG_LEN_S 0
  3216. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3217. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3218. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3219. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3220. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3221. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3222. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3223. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3224. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3225. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3226. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3227. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3228. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3229. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3230. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3231. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3232. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3233. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3234. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3235. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3236. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3237. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3238. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3239. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3240. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3241. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3242. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3243. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3244. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3245. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3246. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3247. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3248. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3249. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3250. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3251. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3252. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3253. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3254. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3255. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3256. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3257. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3258. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3259. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3260. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3261. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3262. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3263. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3264. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3265. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3266. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3267. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3268. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3269. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3270. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3271. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3272. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3273. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3274. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3275. #if HTT_PADDR64
  3276. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3277. #else
  3278. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3279. #endif
  3280. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3281. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3282. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3283. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3284. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3285. do { \
  3286. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3287. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3288. } while (0)
  3289. /* degenerate case for 32-bit fields */
  3290. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3291. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3292. ((_var) = (_val))
  3293. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3294. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3295. ((_var) = (_val))
  3296. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3297. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3298. ((_var) = (_val))
  3299. /* degenerate case for 32-bit fields */
  3300. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3301. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3302. ((_var) = (_val))
  3303. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3304. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3305. ((_var) = (_val))
  3306. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3307. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3308. ((_var) = (_val))
  3309. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3310. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3311. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3312. do { \
  3313. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3314. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3315. } while (0)
  3316. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3317. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3318. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3321. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3322. } while (0)
  3323. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3324. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3325. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3326. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3327. do { \
  3328. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3329. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3330. } while (0)
  3331. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3332. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3333. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3334. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3337. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3338. } while (0)
  3339. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3340. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3341. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3342. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3343. do { \
  3344. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3345. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3346. } while (0)
  3347. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3348. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3349. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3350. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3351. do { \
  3352. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3353. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3354. } while (0)
  3355. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3356. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3357. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3358. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3359. do { \
  3360. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3361. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3362. } while (0)
  3363. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3364. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3365. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3366. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3367. do { \
  3368. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3369. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3370. } while (0)
  3371. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3372. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3373. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3374. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3377. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3378. } while (0)
  3379. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3380. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3381. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3382. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3385. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3386. } while (0)
  3387. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3388. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3389. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3390. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3391. do { \
  3392. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3393. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3394. } while (0)
  3395. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3396. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3397. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3398. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3401. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3402. } while (0)
  3403. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3404. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3405. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3406. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3413. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3414. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3461. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3462. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3469. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3470. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3477. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3478. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3485. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3486. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3493. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3494. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3501. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3502. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3509. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3510. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3517. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3518. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3525. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3526. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3533. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3534. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3538. } while (0)
  3539. /**
  3540. * @brief host -> target FW statistics retrieve
  3541. *
  3542. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3543. *
  3544. * @details
  3545. * The following field definitions describe the format of the HTT host
  3546. * to target FW stats retrieve message. The message specifies the type of
  3547. * stats host wants to retrieve.
  3548. *
  3549. * |31 24|23 16|15 8|7 0|
  3550. * |-----------------------------------------------------------|
  3551. * | stats types request bitmask | msg type |
  3552. * |-----------------------------------------------------------|
  3553. * | stats types reset bitmask | reserved |
  3554. * |-----------------------------------------------------------|
  3555. * | stats type | config value |
  3556. * |-----------------------------------------------------------|
  3557. * | cookie LSBs |
  3558. * |-----------------------------------------------------------|
  3559. * | cookie MSBs |
  3560. * |-----------------------------------------------------------|
  3561. * Header fields:
  3562. * - MSG_TYPE
  3563. * Bits 7:0
  3564. * Purpose: identifies this is a stats upload request message
  3565. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3566. * - UPLOAD_TYPES
  3567. * Bits 31:8
  3568. * Purpose: identifies which types of FW statistics to upload
  3569. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3570. * - RESET_TYPES
  3571. * Bits 31:8
  3572. * Purpose: identifies which types of FW statistics to reset
  3573. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3574. * - CFG_VAL
  3575. * Bits 23:0
  3576. * Purpose: give an opaque configuration value to the specified stats type
  3577. * Value: stats-type specific configuration value
  3578. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3579. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3580. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3581. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3582. * - CFG_STAT_TYPE
  3583. * Bits 31:24
  3584. * Purpose: specify which stats type (if any) the config value applies to
  3585. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3586. * a valid configuration specification
  3587. * - COOKIE_LSBS
  3588. * Bits 31:0
  3589. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3590. * message with its preceding host->target stats request message.
  3591. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3592. * - COOKIE_MSBS
  3593. * Bits 31:0
  3594. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3595. * message with its preceding host->target stats request message.
  3596. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3597. */
  3598. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3599. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3600. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3601. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3602. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3603. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3604. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3605. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3606. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3607. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3608. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3609. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3610. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3611. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3614. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3615. } while (0)
  3616. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3617. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3618. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3619. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3622. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3623. } while (0)
  3624. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3625. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3626. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3627. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3630. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3631. } while (0)
  3632. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3633. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3634. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3635. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3638. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3639. } while (0)
  3640. /**
  3641. * @brief host -> target HTT out-of-band sync request
  3642. *
  3643. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3644. *
  3645. * @details
  3646. * The HTT SYNC tells the target to suspend processing of subsequent
  3647. * HTT host-to-target messages until some other target agent locally
  3648. * informs the target HTT FW that the current sync counter is equal to
  3649. * or greater than (in a modulo sense) the sync counter specified in
  3650. * the SYNC message.
  3651. * This allows other host-target components to synchronize their operation
  3652. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3653. * security key has been downloaded to and activated by the target.
  3654. * In the absence of any explicit synchronization counter value
  3655. * specification, the target HTT FW will use zero as the default current
  3656. * sync value.
  3657. *
  3658. * |31 24|23 16|15 8|7 0|
  3659. * |-----------------------------------------------------------|
  3660. * | reserved | sync count | msg type |
  3661. * |-----------------------------------------------------------|
  3662. * Header fields:
  3663. * - MSG_TYPE
  3664. * Bits 7:0
  3665. * Purpose: identifies this as a sync message
  3666. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3667. * - SYNC_COUNT
  3668. * Bits 15:8
  3669. * Purpose: specifies what sync value the HTT FW will wait for from
  3670. * an out-of-band specification to resume its operation
  3671. * Value: in-band sync counter value to compare against the out-of-band
  3672. * counter spec.
  3673. * The HTT target FW will suspend its host->target message processing
  3674. * as long as
  3675. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3676. */
  3677. #define HTT_H2T_SYNC_MSG_SZ 4
  3678. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3679. #define HTT_H2T_SYNC_COUNT_S 8
  3680. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3681. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3682. HTT_H2T_SYNC_COUNT_S)
  3683. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3686. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3687. } while (0)
  3688. /**
  3689. * @brief host -> target HTT aggregation configuration
  3690. *
  3691. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3692. */
  3693. #define HTT_AGGR_CFG_MSG_SZ 4
  3694. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3695. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3696. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3697. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3698. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3699. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3700. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3701. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3704. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3705. } while (0)
  3706. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3707. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3708. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3709. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3712. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3713. } while (0)
  3714. /**
  3715. * @brief host -> target HTT configure max amsdu info per vdev
  3716. *
  3717. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3718. *
  3719. * @details
  3720. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3721. *
  3722. * |31 21|20 16|15 8|7 0|
  3723. * |-----------------------------------------------------------|
  3724. * | reserved | vdev id | max amsdu | msg type |
  3725. * |-----------------------------------------------------------|
  3726. * Header fields:
  3727. * - MSG_TYPE
  3728. * Bits 7:0
  3729. * Purpose: identifies this as a aggr cfg ex message
  3730. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3731. * - MAX_NUM_AMSDU_SUBFRM
  3732. * Bits 15:8
  3733. * Purpose: max MSDUs per A-MSDU
  3734. * - VDEV_ID
  3735. * Bits 20:16
  3736. * Purpose: ID of the vdev to which this limit is applied
  3737. */
  3738. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3739. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3740. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3741. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3742. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3743. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3744. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3745. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3746. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3749. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3750. } while (0)
  3751. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3752. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3753. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3754. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3757. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3758. } while (0)
  3759. /**
  3760. * @brief HTT WDI_IPA Config Message
  3761. *
  3762. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3763. *
  3764. * @details
  3765. * The HTT WDI_IPA config message is created/sent by host at driver
  3766. * init time. It contains information about data structures used on
  3767. * WDI_IPA TX and RX path.
  3768. * TX CE ring is used for pushing packet metadata from IPA uC
  3769. * to WLAN FW
  3770. * TX Completion ring is used for generating TX completions from
  3771. * WLAN FW to IPA uC
  3772. * RX Indication ring is used for indicating RX packets from FW
  3773. * to IPA uC
  3774. * RX Ring2 is used as either completion ring or as second
  3775. * indication ring. when Ring2 is used as completion ring, IPA uC
  3776. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3777. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3778. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3779. * indicated in RX Indication ring. Please see WDI_IPA specification
  3780. * for more details.
  3781. * |31 24|23 16|15 8|7 0|
  3782. * |----------------+----------------+----------------+----------------|
  3783. * | tx pkt pool size | Rsvd | msg_type |
  3784. * |-------------------------------------------------------------------|
  3785. * | tx comp ring base (bits 31:0) |
  3786. #if HTT_PADDR64
  3787. * | tx comp ring base (bits 63:32) |
  3788. #endif
  3789. * |-------------------------------------------------------------------|
  3790. * | tx comp ring size |
  3791. * |-------------------------------------------------------------------|
  3792. * | tx comp WR_IDX physical address (bits 31:0) |
  3793. #if HTT_PADDR64
  3794. * | tx comp WR_IDX physical address (bits 63:32) |
  3795. #endif
  3796. * |-------------------------------------------------------------------|
  3797. * | tx CE WR_IDX physical address (bits 31:0) |
  3798. #if HTT_PADDR64
  3799. * | tx CE WR_IDX physical address (bits 63:32) |
  3800. #endif
  3801. * |-------------------------------------------------------------------|
  3802. * | rx indication ring base (bits 31:0) |
  3803. #if HTT_PADDR64
  3804. * | rx indication ring base (bits 63:32) |
  3805. #endif
  3806. * |-------------------------------------------------------------------|
  3807. * | rx indication ring size |
  3808. * |-------------------------------------------------------------------|
  3809. * | rx ind RD_IDX physical address (bits 31:0) |
  3810. #if HTT_PADDR64
  3811. * | rx ind RD_IDX physical address (bits 63:32) |
  3812. #endif
  3813. * |-------------------------------------------------------------------|
  3814. * | rx ind WR_IDX physical address (bits 31:0) |
  3815. #if HTT_PADDR64
  3816. * | rx ind WR_IDX physical address (bits 63:32) |
  3817. #endif
  3818. * |-------------------------------------------------------------------|
  3819. * |-------------------------------------------------------------------|
  3820. * | rx ring2 base (bits 31:0) |
  3821. #if HTT_PADDR64
  3822. * | rx ring2 base (bits 63:32) |
  3823. #endif
  3824. * |-------------------------------------------------------------------|
  3825. * | rx ring2 size |
  3826. * |-------------------------------------------------------------------|
  3827. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3833. #if HTT_PADDR64
  3834. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3835. #endif
  3836. * |-------------------------------------------------------------------|
  3837. *
  3838. * Header fields:
  3839. * Header fields:
  3840. * - MSG_TYPE
  3841. * Bits 7:0
  3842. * Purpose: Identifies this as WDI_IPA config message
  3843. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3844. * - TX_PKT_POOL_SIZE
  3845. * Bits 15:0
  3846. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3847. * WDI_IPA TX path
  3848. * For systems using 32-bit format for bus addresses:
  3849. * - TX_COMP_RING_BASE_ADDR
  3850. * Bits 31:0
  3851. * Purpose: TX Completion Ring base address in DDR
  3852. * - TX_COMP_RING_SIZE
  3853. * Bits 31:0
  3854. * Purpose: TX Completion Ring size (must be power of 2)
  3855. * - TX_COMP_WR_IDX_ADDR
  3856. * Bits 31:0
  3857. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3858. * updates the Write Index for WDI_IPA TX completion ring
  3859. * - TX_CE_WR_IDX_ADDR
  3860. * Bits 31:0
  3861. * Purpose: DDR address where IPA uC
  3862. * updates the WR Index for TX CE ring
  3863. * (needed for fusion platforms)
  3864. * - RX_IND_RING_BASE_ADDR
  3865. * Bits 31:0
  3866. * Purpose: RX Indication Ring base address in DDR
  3867. * - RX_IND_RING_SIZE
  3868. * Bits 31:0
  3869. * Purpose: RX Indication Ring size
  3870. * - RX_IND_RD_IDX_ADDR
  3871. * Bits 31:0
  3872. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3873. * RX indication ring
  3874. * - RX_IND_WR_IDX_ADDR
  3875. * Bits 31:0
  3876. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3877. * updates the Write Index for WDI_IPA RX indication ring
  3878. * - RX_RING2_BASE_ADDR
  3879. * Bits 31:0
  3880. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3881. * - RX_RING2_SIZE
  3882. * Bits 31:0
  3883. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3884. * - RX_RING2_RD_IDX_ADDR
  3885. * Bits 31:0
  3886. * Purpose: If Second RX ring is Indication ring, DDR address where
  3887. * IPA uC updates the Read Index for Ring2.
  3888. * If Second RX ring is completion ring, this is NOT used
  3889. * - RX_RING2_WR_IDX_ADDR
  3890. * Bits 31:0
  3891. * Purpose: If Second RX ring is Indication ring, DDR address where
  3892. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3893. * If second RX ring is completion ring, DDR address where
  3894. * IPA uC updates the Write Index for Ring 2.
  3895. * For systems using 64-bit format for bus addresses:
  3896. * - TX_COMP_RING_BASE_ADDR_LO
  3897. * Bits 31:0
  3898. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3899. * - TX_COMP_RING_BASE_ADDR_HI
  3900. * Bits 31:0
  3901. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3902. * - TX_COMP_RING_SIZE
  3903. * Bits 31:0
  3904. * Purpose: TX Completion Ring size (must be power of 2)
  3905. * - TX_COMP_WR_IDX_ADDR_LO
  3906. * Bits 31:0
  3907. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3908. * Lower 4 bytes of DDR address where WIFI FW
  3909. * updates the Write Index for WDI_IPA TX completion ring
  3910. * - TX_COMP_WR_IDX_ADDR_HI
  3911. * Bits 31:0
  3912. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3913. * Higher 4 bytes of DDR address where WIFI FW
  3914. * updates the Write Index for WDI_IPA TX completion ring
  3915. * - TX_CE_WR_IDX_ADDR_LO
  3916. * Bits 31:0
  3917. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3918. * updates the WR Index for TX CE ring
  3919. * (needed for fusion platforms)
  3920. * - TX_CE_WR_IDX_ADDR_HI
  3921. * Bits 31:0
  3922. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3923. * updates the WR Index for TX CE ring
  3924. * (needed for fusion platforms)
  3925. * - RX_IND_RING_BASE_ADDR_LO
  3926. * Bits 31:0
  3927. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3928. * - RX_IND_RING_BASE_ADDR_HI
  3929. * Bits 31:0
  3930. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3931. * - RX_IND_RING_SIZE
  3932. * Bits 31:0
  3933. * Purpose: RX Indication Ring size
  3934. * - RX_IND_RD_IDX_ADDR_LO
  3935. * Bits 31:0
  3936. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3937. * for WDI_IPA RX indication ring
  3938. * - RX_IND_RD_IDX_ADDR_HI
  3939. * Bits 31:0
  3940. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3941. * for WDI_IPA RX indication ring
  3942. * - RX_IND_WR_IDX_ADDR_LO
  3943. * Bits 31:0
  3944. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3945. * Lower 4 bytes of DDR address where WIFI FW
  3946. * updates the Write Index for WDI_IPA RX indication ring
  3947. * - RX_IND_WR_IDX_ADDR_HI
  3948. * Bits 31:0
  3949. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3950. * Higher 4 bytes of DDR address where WIFI FW
  3951. * updates the Write Index for WDI_IPA RX indication ring
  3952. * - RX_RING2_BASE_ADDR_LO
  3953. * Bits 31:0
  3954. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3955. * - RX_RING2_BASE_ADDR_HI
  3956. * Bits 31:0
  3957. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3958. * - RX_RING2_SIZE
  3959. * Bits 31:0
  3960. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3961. * - RX_RING2_RD_IDX_ADDR_LO
  3962. * Bits 31:0
  3963. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3964. * DDR address where IPA uC updates the Read Index for Ring2.
  3965. * If Second RX ring is completion ring, this is NOT used
  3966. * - RX_RING2_RD_IDX_ADDR_HI
  3967. * Bits 31:0
  3968. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3969. * DDR address where IPA uC updates the Read Index for Ring2.
  3970. * If Second RX ring is completion ring, this is NOT used
  3971. * - RX_RING2_WR_IDX_ADDR_LO
  3972. * Bits 31:0
  3973. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3974. * DDR address where WIFI FW updates the Write Index
  3975. * for WDI_IPA RX ring2
  3976. * If second RX ring is completion ring, lower 4 bytes of
  3977. * DDR address where IPA uC updates the Write Index for Ring 2.
  3978. * - RX_RING2_WR_IDX_ADDR_HI
  3979. * Bits 31:0
  3980. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3981. * DDR address where WIFI FW updates the Write Index
  3982. * for WDI_IPA RX ring2
  3983. * If second RX ring is completion ring, higher 4 bytes of
  3984. * DDR address where IPA uC updates the Write Index for Ring 2.
  3985. */
  3986. #if HTT_PADDR64
  3987. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3988. #else
  3989. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3990. #endif
  3991. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3992. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3993. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3994. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3995. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3996. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3997. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3998. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3999. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4007. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4008. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4009. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4010. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4011. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4012. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4013. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4014. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4015. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4016. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4017. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4018. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4019. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4027. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4029. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4031. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4033. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4035. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4037. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4054. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4055. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4056. do { \
  4057. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4058. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4059. } while (0)
  4060. /* for systems using 32-bit format for bus addr */
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4062. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4064. do { \
  4065. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4066. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4067. } while (0)
  4068. /* for systems using 64-bit format for bus addr */
  4069. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4070. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4071. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4072. do { \
  4073. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4074. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4075. } while (0)
  4076. /* for systems using 64-bit format for bus addr */
  4077. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4078. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4079. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4080. do { \
  4081. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4082. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4083. } while (0)
  4084. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4085. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4087. do { \
  4088. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4089. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4090. } while (0)
  4091. /* for systems using 32-bit format for bus addr */
  4092. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4093. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4094. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4097. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4098. } while (0)
  4099. /* for systems using 64-bit format for bus addr */
  4100. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4101. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4102. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4105. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4106. } while (0)
  4107. /* for systems using 64-bit format for bus addr */
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4109. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4113. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4114. } while (0)
  4115. /* for systems using 32-bit format for bus addr */
  4116. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4118. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4122. } while (0)
  4123. /* for systems using 64-bit format for bus addr */
  4124. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4125. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4126. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4129. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4130. } while (0)
  4131. /* for systems using 64-bit format for bus addr */
  4132. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4133. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4134. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4137. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4138. } while (0)
  4139. /* for systems using 32-bit format for bus addr */
  4140. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4141. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4142. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4145. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4146. } while (0)
  4147. /* for systems using 64-bit format for bus addr */
  4148. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4149. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4150. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4153. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4154. } while (0)
  4155. /* for systems using 64-bit format for bus addr */
  4156. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4157. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4158. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4161. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4162. } while (0)
  4163. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4165. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4169. } while (0)
  4170. /* for systems using 32-bit format for bus addr */
  4171. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4172. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4173. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4176. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4177. } while (0)
  4178. /* for systems using 64-bit format for bus addr */
  4179. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4180. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4181. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4184. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4185. } while (0)
  4186. /* for systems using 64-bit format for bus addr */
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4193. } while (0)
  4194. /* for systems using 32-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4197. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4201. } while (0)
  4202. /* for systems using 64-bit format for bus addr */
  4203. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4204. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4208. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4209. } while (0)
  4210. /* for systems using 64-bit format for bus addr */
  4211. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4212. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4213. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4216. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4217. } while (0)
  4218. /* for systems using 32-bit format for bus addr */
  4219. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4220. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4221. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4224. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4225. } while (0)
  4226. /* for systems using 64-bit format for bus addr */
  4227. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4228. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4229. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4232. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4233. } while (0)
  4234. /* for systems using 64-bit format for bus addr */
  4235. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4236. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4237. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4240. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4241. } while (0)
  4242. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4244. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4248. } while (0)
  4249. /* for systems using 32-bit format for bus addr */
  4250. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4251. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4252. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4255. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4256. } while (0)
  4257. /* for systems using 64-bit format for bus addr */
  4258. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4259. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4260. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4263. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4264. } while (0)
  4265. /* for systems using 64-bit format for bus addr */
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4272. } while (0)
  4273. /* for systems using 32-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4280. } while (0)
  4281. /* for systems using 64-bit format for bus addr */
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4283. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4287. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4288. } while (0)
  4289. /* for systems using 64-bit format for bus addr */
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4291. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4295. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4296. } while (0)
  4297. /*
  4298. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4299. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4300. * addresses are stored in a XXX-bit field.
  4301. * This macro is used to define both htt_wdi_ipa_config32_t and
  4302. * htt_wdi_ipa_config64_t structs.
  4303. */
  4304. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4305. _paddr__tx_comp_ring_base_addr_, \
  4306. _paddr__tx_comp_wr_idx_addr_, \
  4307. _paddr__tx_ce_wr_idx_addr_, \
  4308. _paddr__rx_ind_ring_base_addr_, \
  4309. _paddr__rx_ind_rd_idx_addr_, \
  4310. _paddr__rx_ind_wr_idx_addr_, \
  4311. _paddr__rx_ring2_base_addr_,\
  4312. _paddr__rx_ring2_rd_idx_addr_,\
  4313. _paddr__rx_ring2_wr_idx_addr_) \
  4314. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4315. { \
  4316. /* DWORD 0: flags and meta-data */ \
  4317. A_UINT32 \
  4318. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4319. reserved: 8, \
  4320. tx_pkt_pool_size: 16;\
  4321. /* DWORD 1 */\
  4322. _paddr__tx_comp_ring_base_addr_;\
  4323. /* DWORD 2 (or 3)*/\
  4324. A_UINT32 tx_comp_ring_size;\
  4325. /* DWORD 3 (or 4)*/\
  4326. _paddr__tx_comp_wr_idx_addr_;\
  4327. /* DWORD 4 (or 6)*/\
  4328. _paddr__tx_ce_wr_idx_addr_;\
  4329. /* DWORD 5 (or 8)*/\
  4330. _paddr__rx_ind_ring_base_addr_;\
  4331. /* DWORD 6 (or 10)*/\
  4332. A_UINT32 rx_ind_ring_size;\
  4333. /* DWORD 7 (or 11)*/\
  4334. _paddr__rx_ind_rd_idx_addr_;\
  4335. /* DWORD 8 (or 13)*/\
  4336. _paddr__rx_ind_wr_idx_addr_;\
  4337. /* DWORD 9 (or 15)*/\
  4338. _paddr__rx_ring2_base_addr_;\
  4339. /* DWORD 10 (or 17) */\
  4340. A_UINT32 rx_ring2_size;\
  4341. /* DWORD 11 (or 18) */\
  4342. _paddr__rx_ring2_rd_idx_addr_;\
  4343. /* DWORD 12 (or 20) */\
  4344. _paddr__rx_ring2_wr_idx_addr_;\
  4345. } POSTPACK
  4346. /* define a htt_wdi_ipa_config32_t type */
  4347. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  4348. /* define a htt_wdi_ipa_config64_t type */
  4349. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  4350. #if HTT_PADDR64
  4351. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4352. #else
  4353. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4354. #endif
  4355. enum htt_wdi_ipa_op_code {
  4356. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4357. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4358. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4359. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4360. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4361. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4362. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4363. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4364. /* keep this last */
  4365. HTT_WDI_IPA_OPCODE_MAX
  4366. };
  4367. /**
  4368. * @brief HTT WDI_IPA Operation Request Message
  4369. *
  4370. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4371. *
  4372. * @details
  4373. * HTT WDI_IPA Operation Request message is sent by host
  4374. * to either suspend or resume WDI_IPA TX or RX path.
  4375. * |31 24|23 16|15 8|7 0|
  4376. * |----------------+----------------+----------------+----------------|
  4377. * | op_code | Rsvd | msg_type |
  4378. * |-------------------------------------------------------------------|
  4379. *
  4380. * Header fields:
  4381. * - MSG_TYPE
  4382. * Bits 7:0
  4383. * Purpose: Identifies this as WDI_IPA Operation Request message
  4384. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4385. * - OP_CODE
  4386. * Bits 31:16
  4387. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4388. * value: = enum htt_wdi_ipa_op_code
  4389. */
  4390. PREPACK struct htt_wdi_ipa_op_request_t
  4391. {
  4392. /* DWORD 0: flags and meta-data */
  4393. A_UINT32
  4394. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4395. reserved: 8,
  4396. op_code: 16;
  4397. } POSTPACK;
  4398. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4399. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4400. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4401. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4402. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4403. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4404. do { \
  4405. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4406. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4407. } while (0)
  4408. /*
  4409. * @brief host -> target HTT_MSI_SETUP message
  4410. *
  4411. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4412. *
  4413. * @details
  4414. * After target is booted up, host can send MSI setup message so that
  4415. * target sets up HW registers based on setup message.
  4416. *
  4417. * The message would appear as follows:
  4418. * |31 24|23 16|15|14 8|7 0|
  4419. * |---------------+-----------------+-----------------+-----------------|
  4420. * | reserved | msi_type | pdev_id | msg_type |
  4421. * |---------------------------------------------------------------------|
  4422. * | msi_addr_lo |
  4423. * |---------------------------------------------------------------------|
  4424. * | msi_addr_hi |
  4425. * |---------------------------------------------------------------------|
  4426. * | msi_data |
  4427. * |---------------------------------------------------------------------|
  4428. *
  4429. * The message is interpreted as follows:
  4430. * dword0 - b'0:7 - msg_type: This will be set to
  4431. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4432. * b'8:15 - pdev_id:
  4433. * 0 (for rings at SOC/UMAC level),
  4434. * 1/2/3 mac id (for rings at LMAC level)
  4435. * b'16:23 - msi_type: identify which msi registers need to be setup
  4436. * more details can be got from enum htt_msi_setup_type
  4437. * b'24:31 - reserved
  4438. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4439. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4440. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4441. */
  4442. PREPACK struct htt_msi_setup_t {
  4443. A_UINT32 msg_type: 8,
  4444. pdev_id: 8,
  4445. msi_type: 8,
  4446. reserved: 8;
  4447. A_UINT32 msi_addr_lo;
  4448. A_UINT32 msi_addr_hi;
  4449. A_UINT32 msi_data;
  4450. } POSTPACK;
  4451. enum htt_msi_setup_type {
  4452. HTT_PPDU_END_MSI_SETUP_TYPE,
  4453. /* Insert new types here*/
  4454. };
  4455. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4456. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4457. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4458. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4459. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4460. HTT_MSI_SETUP_PDEV_ID_S)
  4461. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4462. do { \
  4463. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4464. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4465. } while (0)
  4466. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4467. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4468. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4469. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4470. HTT_MSI_SETUP_MSI_TYPE_S)
  4471. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4472. do { \
  4473. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4474. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4475. } while (0)
  4476. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4477. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4478. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4479. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4480. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4481. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4482. do { \
  4483. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4484. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4485. } while (0)
  4486. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4487. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4488. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4489. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4490. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4491. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4494. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4495. } while (0)
  4496. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4497. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4498. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4499. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4500. HTT_MSI_SETUP_MSI_DATA_S)
  4501. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4502. do { \
  4503. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4504. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4505. } while (0)
  4506. /*
  4507. * @brief host -> target HTT_SRING_SETUP message
  4508. *
  4509. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4510. *
  4511. * @details
  4512. * After target is booted up, Host can send SRING setup message for
  4513. * each host facing LMAC SRING. Target setups up HW registers based
  4514. * on setup message and confirms back to Host if response_required is set.
  4515. * Host should wait for confirmation message before sending new SRING
  4516. * setup message
  4517. *
  4518. * The message would appear as follows:
  4519. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4520. * |--------------- +-----------------+-----------------+-----------------|
  4521. * | ring_type | ring_id | pdev_id | msg_type |
  4522. * |----------------------------------------------------------------------|
  4523. * | ring_base_addr_lo |
  4524. * |----------------------------------------------------------------------|
  4525. * | ring_base_addr_hi |
  4526. * |----------------------------------------------------------------------|
  4527. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4528. * |----------------------------------------------------------------------|
  4529. * | ring_head_offset32_remote_addr_lo |
  4530. * |----------------------------------------------------------------------|
  4531. * | ring_head_offset32_remote_addr_hi |
  4532. * |----------------------------------------------------------------------|
  4533. * | ring_tail_offset32_remote_addr_lo |
  4534. * |----------------------------------------------------------------------|
  4535. * | ring_tail_offset32_remote_addr_hi |
  4536. * |----------------------------------------------------------------------|
  4537. * | ring_msi_addr_lo |
  4538. * |----------------------------------------------------------------------|
  4539. * | ring_msi_addr_hi |
  4540. * |----------------------------------------------------------------------|
  4541. * | ring_msi_data |
  4542. * |----------------------------------------------------------------------|
  4543. * | intr_timer_th |IM| intr_batch_counter_th |
  4544. * |----------------------------------------------------------------------|
  4545. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4546. * |----------------------------------------------------------------------|
  4547. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4548. * |----------------------------------------------------------------------|
  4549. * Where
  4550. * IM = sw_intr_mode
  4551. * RR = response_required
  4552. * PTCF = prefetch_timer_cfg
  4553. * IP = IPA drop flag
  4554. *
  4555. * The message is interpreted as follows:
  4556. * dword0 - b'0:7 - msg_type: This will be set to
  4557. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4558. * b'8:15 - pdev_id:
  4559. * 0 (for rings at SOC/UMAC level),
  4560. * 1/2/3 mac id (for rings at LMAC level)
  4561. * b'16:23 - ring_id: identify which ring is to setup,
  4562. * more details can be got from enum htt_srng_ring_id
  4563. * b'24:31 - ring_type: identify type of host rings,
  4564. * more details can be got from enum htt_srng_ring_type
  4565. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4566. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4567. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4568. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4569. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4570. * SW_TO_HW_RING.
  4571. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4572. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4573. * Lower 32 bits of memory address of the remote variable
  4574. * storing the 4-byte word offset that identifies the head
  4575. * element within the ring.
  4576. * (The head offset variable has type A_UINT32.)
  4577. * Valid for HW_TO_SW and SW_TO_SW rings.
  4578. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4579. * Upper 32 bits of memory address of the remote variable
  4580. * storing the 4-byte word offset that identifies the head
  4581. * element within the ring.
  4582. * (The head offset variable has type A_UINT32.)
  4583. * Valid for HW_TO_SW and SW_TO_SW rings.
  4584. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4585. * Lower 32 bits of memory address of the remote variable
  4586. * storing the 4-byte word offset that identifies the tail
  4587. * element within the ring.
  4588. * (The tail offset variable has type A_UINT32.)
  4589. * Valid for HW_TO_SW and SW_TO_SW rings.
  4590. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4591. * Upper 32 bits of memory address of the remote variable
  4592. * storing the 4-byte word offset that identifies the tail
  4593. * element within the ring.
  4594. * (The tail offset variable has type A_UINT32.)
  4595. * Valid for HW_TO_SW and SW_TO_SW rings.
  4596. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4597. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4598. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4599. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4600. * dword10 - b'0:31 - ring_msi_data: MSI data
  4601. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4602. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4603. * dword11 - b'0:14 - intr_batch_counter_th:
  4604. * batch counter threshold is in units of 4-byte words.
  4605. * HW internally maintains and increments batch count.
  4606. * (see SRING spec for detail description).
  4607. * When batch count reaches threshold value, an interrupt
  4608. * is generated by HW.
  4609. * b'15 - sw_intr_mode:
  4610. * This configuration shall be static.
  4611. * Only programmed at power up.
  4612. * 0: generate pulse style sw interrupts
  4613. * 1: generate level style sw interrupts
  4614. * b'16:31 - intr_timer_th:
  4615. * The timer init value when timer is idle or is
  4616. * initialized to start downcounting.
  4617. * In 8us units (to cover a range of 0 to 524 ms)
  4618. * dword12 - b'0:15 - intr_low_threshold:
  4619. * Used only by Consumer ring to generate ring_sw_int_p.
  4620. * Ring entries low threshold water mark, that is used
  4621. * in combination with the interrupt timer as well as
  4622. * the the clearing of the level interrupt.
  4623. * b'16:18 - prefetch_timer_cfg:
  4624. * Used only by Consumer ring to set timer mode to
  4625. * support Application prefetch handling.
  4626. * The external tail offset/pointer will be updated
  4627. * at following intervals:
  4628. * 3'b000: (Prefetch feature disabled; used only for debug)
  4629. * 3'b001: 1 usec
  4630. * 3'b010: 4 usec
  4631. * 3'b011: 8 usec (default)
  4632. * 3'b100: 16 usec
  4633. * Others: Reserverd
  4634. * b'19 - response_required:
  4635. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4636. * b'20 - ipa_drop_flag:
  4637. Indicates that host will config ipa drop threshold percentage
  4638. * b'21:31 - reserved: reserved for future use
  4639. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4640. * b'8:15 - ipa drop high threshold percentage:
  4641. * b'16:31 - Reserved
  4642. */
  4643. PREPACK struct htt_sring_setup_t {
  4644. A_UINT32 msg_type: 8,
  4645. pdev_id: 8,
  4646. ring_id: 8,
  4647. ring_type: 8;
  4648. A_UINT32 ring_base_addr_lo;
  4649. A_UINT32 ring_base_addr_hi;
  4650. A_UINT32 ring_size: 16,
  4651. ring_entry_size: 8,
  4652. ring_misc_cfg_flag: 8;
  4653. A_UINT32 ring_head_offset32_remote_addr_lo;
  4654. A_UINT32 ring_head_offset32_remote_addr_hi;
  4655. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4656. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4657. A_UINT32 ring_msi_addr_lo;
  4658. A_UINT32 ring_msi_addr_hi;
  4659. A_UINT32 ring_msi_data;
  4660. A_UINT32 intr_batch_counter_th: 15,
  4661. sw_intr_mode: 1,
  4662. intr_timer_th: 16;
  4663. A_UINT32 intr_low_threshold: 16,
  4664. prefetch_timer_cfg: 3,
  4665. response_required: 1,
  4666. ipa_drop_flag: 1,
  4667. reserved1: 11;
  4668. A_UINT32 ipa_drop_low_threshold: 8,
  4669. ipa_drop_high_threshold: 8,
  4670. reserved: 16;
  4671. } POSTPACK;
  4672. enum htt_srng_ring_type {
  4673. HTT_HW_TO_SW_RING = 0,
  4674. HTT_SW_TO_HW_RING,
  4675. HTT_SW_TO_SW_RING,
  4676. /* Insert new ring types above this line */
  4677. };
  4678. enum htt_srng_ring_id {
  4679. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4680. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4681. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4682. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4683. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4684. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4685. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4686. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4687. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4688. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4689. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4690. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4691. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4692. /* Add Other SRING which can't be directly configured by host software above this line */
  4693. };
  4694. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4695. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4696. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4697. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4698. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4699. HTT_SRING_SETUP_PDEV_ID_S)
  4700. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4701. do { \
  4702. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4703. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4704. } while (0)
  4705. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4706. #define HTT_SRING_SETUP_RING_ID_S 16
  4707. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4708. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4709. HTT_SRING_SETUP_RING_ID_S)
  4710. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4711. do { \
  4712. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4713. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4714. } while (0)
  4715. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4716. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4717. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4718. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4719. HTT_SRING_SETUP_RING_TYPE_S)
  4720. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4721. do { \
  4722. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4723. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4724. } while (0)
  4725. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4726. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4727. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4728. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4729. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4730. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4731. do { \
  4732. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4733. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4734. } while (0)
  4735. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4736. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4737. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4738. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4739. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4740. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4741. do { \
  4742. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4743. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4744. } while (0)
  4745. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4746. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4747. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4748. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4749. HTT_SRING_SETUP_RING_SIZE_S)
  4750. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4751. do { \
  4752. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4753. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4754. } while (0)
  4755. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4756. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4757. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4758. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4759. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4760. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4761. do { \
  4762. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4763. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4764. } while (0)
  4765. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4766. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4767. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4768. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4769. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4770. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4771. do { \
  4772. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4773. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4774. } while (0)
  4775. /* This control bit is applicable to only Producer, which updates Ring ID field
  4776. * of each descriptor before pushing into the ring.
  4777. * 0: updates ring_id(default)
  4778. * 1: ring_id updating disabled */
  4779. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4780. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4781. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4782. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4783. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4784. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4787. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4788. } while (0)
  4789. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4790. * of each descriptor before pushing into the ring.
  4791. * 0: updates Loopcnt(default)
  4792. * 1: Loopcnt updating disabled */
  4793. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4794. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4795. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4796. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4797. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4798. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4799. do { \
  4800. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4801. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4802. } while (0)
  4803. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4804. * into security_id port of GXI/AXI. */
  4805. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4806. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4807. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4808. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4809. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4810. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4811. do { \
  4812. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4813. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4814. } while (0)
  4815. /* During MSI write operation, SRNG drives value of this register bit into
  4816. * swap bit of GXI/AXI. */
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4818. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4819. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4820. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4821. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4822. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4825. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4826. } while (0)
  4827. /* During Pointer write operation, SRNG drives value of this register bit into
  4828. * swap bit of GXI/AXI. */
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4832. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4833. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4834. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4835. do { \
  4836. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4837. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4838. } while (0)
  4839. /* During any data or TLV write operation, SRNG drives value of this register
  4840. * bit into swap bit of GXI/AXI. */
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4844. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4845. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4847. do { \
  4848. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4849. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4850. } while (0)
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4853. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4854. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4855. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4856. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4857. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4858. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4859. do { \
  4860. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4861. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4862. } while (0)
  4863. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4864. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4865. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4866. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4867. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4868. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4871. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4872. } while (0)
  4873. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4874. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4875. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4876. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4877. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4878. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4879. do { \
  4880. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4881. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4882. } while (0)
  4883. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4884. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4885. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4886. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4887. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4888. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4889. do { \
  4890. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4891. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4892. } while (0)
  4893. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4894. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4895. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4896. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4897. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4898. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4899. do { \
  4900. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4901. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4902. } while (0)
  4903. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4904. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4905. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4906. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4907. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4908. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4909. do { \
  4910. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4911. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4912. } while (0)
  4913. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4914. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4915. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4916. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4917. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4918. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4919. do { \
  4920. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4921. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4922. } while (0)
  4923. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4924. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4925. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4926. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4927. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4928. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4929. do { \
  4930. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4931. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4932. } while (0)
  4933. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4934. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4935. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4936. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4937. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4938. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4939. do { \
  4940. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4941. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4942. } while (0)
  4943. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4944. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4945. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4946. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4947. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4948. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4949. do { \
  4950. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4951. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4952. } while (0)
  4953. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4954. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4955. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4956. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4957. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4958. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4959. do { \
  4960. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4961. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4962. } while (0)
  4963. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4964. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4965. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4966. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4967. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4968. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4969. do { \
  4970. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4971. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4972. } while (0)
  4973. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4974. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4975. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4976. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4977. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4978. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4979. do { \
  4980. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4981. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4982. } while (0)
  4983. /**
  4984. * @brief host -> target RX ring selection config message
  4985. *
  4986. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4987. *
  4988. * @details
  4989. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4990. * configure RXDMA rings.
  4991. * The configuration is per ring based and includes both packet subtypes
  4992. * and PPDU/MPDU TLVs.
  4993. *
  4994. * The message would appear as follows:
  4995. *
  4996. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4997. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4998. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4999. * |-------------------------------------------------------------------|
  5000. * | rsvd2 | ring_buffer_size |
  5001. * |-------------------------------------------------------------------|
  5002. * | packet_type_enable_flags_0 |
  5003. * |-------------------------------------------------------------------|
  5004. * | packet_type_enable_flags_1 |
  5005. * |-------------------------------------------------------------------|
  5006. * | packet_type_enable_flags_2 |
  5007. * |-------------------------------------------------------------------|
  5008. * | packet_type_enable_flags_3 |
  5009. * |-------------------------------------------------------------------|
  5010. * | tlv_filter_in_flags |
  5011. * |-------------------------------------------------------------------|
  5012. * | rx_header_offset | rx_packet_offset |
  5013. * |-------------------------------------------------------------------|
  5014. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5015. * |-------------------------------------------------------------------|
  5016. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5017. * |-------------------------------------------------------------------|
  5018. * | rsvd3 | rx_attention_offset |
  5019. * |-------------------------------------------------------------------|
  5020. * | rsvd4 | mo| fp| rx_drop_threshold |
  5021. * | |ndp|ndp| |
  5022. * |-------------------------------------------------------------------|
  5023. * Where:
  5024. * PS = pkt_swap
  5025. * SS = status_swap
  5026. * OV = rx_offsets_valid
  5027. * DT = drop_thresh_valid
  5028. * The message is interpreted as follows:
  5029. * dword0 - b'0:7 - msg_type: This will be set to
  5030. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5031. * b'8:15 - pdev_id:
  5032. * 0 (for rings at SOC/UMAC level),
  5033. * 1/2/3 mac id (for rings at LMAC level)
  5034. * b'16:23 - ring_id : Identify the ring to configure.
  5035. * More details can be got from enum htt_srng_ring_id
  5036. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5037. * BUF_RING_CFG_0 defs within HW .h files,
  5038. * e.g. wmac_top_reg_seq_hwioreg.h
  5039. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5040. * BUF_RING_CFG_0 defs within HW .h files,
  5041. * e.g. wmac_top_reg_seq_hwioreg.h
  5042. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5043. * configuration fields are valid
  5044. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5045. * rx_drop_threshold field is valid
  5046. * b'28:31 - rsvd1: reserved for future use
  5047. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5048. * in byte units.
  5049. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5050. * - b'16:31 - rsvd2: Reserved for future use
  5051. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5052. * Enable MGMT packet from 0b0000 to 0b1001
  5053. * bits from low to high: FP, MD, MO - 3 bits
  5054. * FP: Filter_Pass
  5055. * MD: Monitor_Direct
  5056. * MO: Monitor_Other
  5057. * 10 mgmt subtypes * 3 bits -> 30 bits
  5058. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5059. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5060. * Enable MGMT packet from 0b1010 to 0b1111
  5061. * bits from low to high: FP, MD, MO - 3 bits
  5062. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5063. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5064. * Enable CTRL packet from 0b0000 to 0b1001
  5065. * bits from low to high: FP, MD, MO - 3 bits
  5066. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5067. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5068. * Enable CTRL packet from 0b1010 to 0b1111,
  5069. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5070. * bits from low to high: FP, MD, MO - 3 bits
  5071. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5072. * dword6 - b'0:31 - tlv_filter_in_flags:
  5073. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5074. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5075. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5076. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5077. * A value of 0 will be considered as ignore this config.
  5078. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5079. * e.g. wmac_top_reg_seq_hwioreg.h
  5080. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5081. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5082. * A value of 0 will be considered as ignore this config.
  5083. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5084. * e.g. wmac_top_reg_seq_hwioreg.h
  5085. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5086. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5087. * A value of 0 will be considered as ignore this config.
  5088. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5089. * e.g. wmac_top_reg_seq_hwioreg.h
  5090. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5091. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5092. * A value of 0 will be considered as ignore this config.
  5093. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5094. * e.g. wmac_top_reg_seq_hwioreg.h
  5095. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5096. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5097. * A value of 0 will be considered as ignore this config.
  5098. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5099. * e.g. wmac_top_reg_seq_hwioreg.h
  5100. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5101. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5102. * A value of 0 will be considered as ignore this config.
  5103. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5104. * e.g. wmac_top_reg_seq_hwioreg.h
  5105. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5106. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5107. * A value of 0 will be considered as ignore this config.
  5108. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5109. * e.g. wmac_top_reg_seq_hwioreg.h
  5110. * - b'16:31 - rsvd3 for future use
  5111. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5112. * to source rings. Consumer drops packets if the available
  5113. * words in the ring falls below the configured threshold
  5114. * value.
  5115. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5116. * by host. 1 -> subscribed
  5117. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5118. * by host. 1 -> subscribed
  5119. * - b`12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5120. * subscribed by host. 1 -> subscribed
  5121. * - b`13:14 - fp_phy_err_buf_src: This indicates the source ring
  5122. * selection for the FP PHY ERR status tlv.
  5123. * 0 - wbm2rxdma_buf_source_ring
  5124. * 1 - fw2rxdma_buf_source_ring
  5125. * 2 - sw2rxdma_buf_source_ring
  5126. * 3 - no_buffer_ring
  5127. * - b`15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5128. * selection for the FP PHY ERR status tlv.
  5129. * 0 - rxdma_release_ring
  5130. * 1 - rxdma2fw_ring
  5131. * 2 - rxdma2sw_ring
  5132. * 3 - rxdma2reo_ring
  5133. * dword12 - b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5134. * which have to be posted to host from phy.
  5135. * Corresponding to errors defined in
  5136. * phyrx_abort_request_reason enums 0 to 31.
  5137. * Refer to RXPCU register definition header files for the
  5138. * phyrx_abort_request_reason enum definition.
  5139. * dword13 - b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5140. * errors which have to be posted to host from phy.
  5141. * Corresponding to errors defined in
  5142. * phyrx_abort_request_reason enums 32 to 63.
  5143. * Refer to RXPCU register definition header files for the
  5144. * phyrx_abort_request_reason enum definition.
  5145. */
  5146. PREPACK struct htt_rx_ring_selection_cfg_t {
  5147. A_UINT32 msg_type: 8,
  5148. pdev_id: 8,
  5149. ring_id: 8,
  5150. status_swap: 1,
  5151. pkt_swap: 1,
  5152. rx_offsets_valid: 1,
  5153. drop_thresh_valid: 1,
  5154. rsvd1: 4;
  5155. A_UINT32 ring_buffer_size: 16,
  5156. rsvd2: 16;
  5157. A_UINT32 packet_type_enable_flags_0;
  5158. A_UINT32 packet_type_enable_flags_1;
  5159. A_UINT32 packet_type_enable_flags_2;
  5160. A_UINT32 packet_type_enable_flags_3;
  5161. A_UINT32 tlv_filter_in_flags;
  5162. A_UINT32 rx_packet_offset: 16,
  5163. rx_header_offset: 16;
  5164. A_UINT32 rx_mpdu_end_offset: 16,
  5165. rx_mpdu_start_offset: 16;
  5166. A_UINT32 rx_msdu_end_offset: 16,
  5167. rx_msdu_start_offset: 16;
  5168. A_UINT32 rx_attn_offset: 16,
  5169. rsvd3: 16;
  5170. A_UINT32 rx_drop_threshold: 10,
  5171. fp_ndp: 1,
  5172. mo_ndp: 1,
  5173. fp_phy_err: 1,
  5174. fp_phy_err_buf_src: 2,
  5175. fp_phy_err_buf_dest: 2,
  5176. rsvd4: 15;
  5177. A_UINT32 phy_err_mask;
  5178. A_UINT32 phy_err_mask_cont;
  5179. } POSTPACK;
  5180. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5181. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5182. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5183. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5184. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5185. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5186. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5187. do { \
  5188. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5189. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5190. } while (0)
  5191. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5192. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5193. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5194. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5195. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5196. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5197. do { \
  5198. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5199. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5200. } while (0)
  5201. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5202. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5203. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5204. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5205. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5206. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5207. do { \
  5208. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5209. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5210. } while (0)
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5214. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5215. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5217. do { \
  5218. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5219. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5220. } while (0)
  5221. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5222. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5223. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5224. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5225. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5226. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5227. do { \
  5228. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5229. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5230. } while (0)
  5231. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5232. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5233. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5234. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5235. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5236. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5237. do { \
  5238. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5239. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5240. } while (0)
  5241. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5242. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5243. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5244. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5245. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5246. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5247. do { \
  5248. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5249. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5250. } while (0)
  5251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5254. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5255. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5256. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5257. do { \
  5258. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5259. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5260. } while (0)
  5261. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5264. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5265. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5266. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5267. do { \
  5268. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5269. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5270. } while (0)
  5271. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5274. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5275. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5276. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5277. do { \
  5278. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5279. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5280. } while (0)
  5281. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5282. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5283. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5284. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5285. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5286. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5287. do { \
  5288. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5289. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5290. } while (0)
  5291. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5292. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5293. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5294. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5295. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5296. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5297. do { \
  5298. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5299. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5300. } while (0)
  5301. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5302. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5303. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5304. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5305. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5306. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5307. do { \
  5308. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5309. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5310. } while (0)
  5311. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5312. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5313. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5314. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5315. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5316. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5317. do { \
  5318. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5319. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5320. } while (0)
  5321. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5322. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5323. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5324. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5325. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5326. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5327. do { \
  5328. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5329. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5330. } while (0)
  5331. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5332. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5333. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5334. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5335. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5336. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5337. do { \
  5338. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5339. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5340. } while (0)
  5341. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5342. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5343. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5344. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5345. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5347. do { \
  5348. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5349. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5350. } while (0)
  5351. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5352. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5353. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5354. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5355. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5356. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5357. do { \
  5358. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5359. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5360. } while (0)
  5361. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5362. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5363. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5364. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5365. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5366. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5367. do { \
  5368. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5369. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5370. } while (0)
  5371. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5372. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5373. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5374. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5375. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5376. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5377. do { \
  5378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5380. } while (0)
  5381. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5382. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5383. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5384. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5385. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5386. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5387. do { \
  5388. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5389. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5390. } while (0)
  5391. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5392. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5393. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5394. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5395. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5396. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5397. do { \
  5398. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5399. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5400. } while (0)
  5401. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5402. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5403. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5404. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5405. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5406. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5407. do { \
  5408. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5409. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5410. } while (0)
  5411. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5412. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5413. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5414. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5415. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5416. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5417. do { \
  5418. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5419. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5420. } while (0)
  5421. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5422. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5423. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5424. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5425. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5426. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5427. do { \
  5428. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5429. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5430. } while (0)
  5431. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5432. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5433. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5434. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5435. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5436. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5437. do { \
  5438. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5439. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5440. } while (0)
  5441. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5442. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5443. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5444. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5445. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5446. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5447. do { \
  5448. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5449. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5450. } while (0)
  5451. /*
  5452. * Subtype based MGMT frames enable bits.
  5453. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5454. */
  5455. /* association request */
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5462. /* association response */
  5463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5469. /* Reassociation request */
  5470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5472. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5476. /* Reassociation response */
  5477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5479. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5483. /* Probe request */
  5484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5489. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5490. /* Probe response */
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5497. /* Timing Advertisement */
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5504. /* Reserved */
  5505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5511. /* Beacon */
  5512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5518. /* ATIM */
  5519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5525. /* Disassociation */
  5526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5532. /* Authentication */
  5533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5539. /* Deauthentication */
  5540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5546. /* Action */
  5547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5553. /* Action No Ack */
  5554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5560. /* Reserved */
  5561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5567. /*
  5568. * Subtype based CTRL frames enable bits.
  5569. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5570. */
  5571. /* Reserved */
  5572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5574. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5578. /* Reserved */
  5579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5581. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5585. /* Reserved */
  5586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5592. /* Reserved */
  5593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5595. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5599. /* Reserved */
  5600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5606. /* Reserved */
  5607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5609. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5613. /* Reserved */
  5614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5616. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5620. /* Control Wrapper */
  5621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5624. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5625. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5626. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5627. /* Block Ack Request */
  5628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5629. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5630. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5631. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5632. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5634. /* Block Ack*/
  5635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5639. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5640. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5641. /* PS-POLL */
  5642. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5643. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5644. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5645. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5646. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5647. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5648. /* RTS */
  5649. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5650. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5651. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5652. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5653. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5654. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5655. /* CTS */
  5656. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5657. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5658. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5659. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5660. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5661. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5662. /* ACK */
  5663. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5664. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5665. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5666. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5667. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5668. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5669. /* CF-END */
  5670. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5671. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5672. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5673. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5674. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5675. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5676. /* CF-END + CF-ACK */
  5677. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5683. /* Multicast data */
  5684. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5690. /* Unicast data */
  5691. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5697. /* NULL data */
  5698. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5705. do { \
  5706. HTT_CHECK_SET_VAL(httsym, value); \
  5707. (word) |= (value) << httsym##_S; \
  5708. } while (0)
  5709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5710. (((word) & httsym##_M) >> httsym##_S)
  5711. #define htt_rx_ring_pkt_enable_subtype_set( \
  5712. word, flag, mode, type, subtype, val) \
  5713. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5714. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5715. #define htt_rx_ring_pkt_enable_subtype_get( \
  5716. word, flag, mode, type, subtype) \
  5717. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5718. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5719. /* Definition to filter in TLVs */
  5720. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5721. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5722. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5723. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5724. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5725. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5726. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5727. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5728. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5729. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5730. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5731. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5732. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5733. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5734. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5735. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5736. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5737. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5738. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5739. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5740. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5741. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5742. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5743. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5744. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5745. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5746. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5747. do { \
  5748. HTT_CHECK_SET_VAL(httsym, enable); \
  5749. (word) |= (enable) << httsym##_S; \
  5750. } while (0)
  5751. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5752. (((word) & httsym##_M) >> httsym##_S)
  5753. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5754. HTT_RX_RING_TLV_ENABLE_SET( \
  5755. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5756. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5757. HTT_RX_RING_TLV_ENABLE_GET( \
  5758. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5759. /**
  5760. * @brief host -> target TX monitor config message
  5761. *
  5762. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5763. *
  5764. * @details
  5765. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5766. * configure RXDMA rings.
  5767. * The configuration is per ring based and includes both packet types
  5768. * and PPDU/MPDU TLVs.
  5769. *
  5770. * The message would appear as follows:
  5771. *
  5772. * |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|
  5773. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5774. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5775. * |-----------+--------+--------+-----+------------------------------------|
  5776. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5777. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5778. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5779. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5780. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5781. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5782. * |------------------------------------------------------------------------|
  5783. * | tlv_filter_mask_in0 |
  5784. * |------------------------------------------------------------------------|
  5785. * | tlv_filter_mask_in1 |
  5786. * |------------------------------------------------------------------------|
  5787. * | tlv_filter_mask_in2 |
  5788. * |------------------------------------------------------------------------|
  5789. * | tlv_filter_mask_in3 |
  5790. * |-----------------+-----------------+---------------------+--------------|
  5791. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5792. * |------------------------------------------------------------------------|
  5793. * | pcu_ppdu_setup_word_mask |
  5794. * |--------------------+--+--+--+-----+---------------------+--------------|
  5795. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5796. * |------------------------------------------------------------------------|
  5797. *
  5798. * Where:
  5799. * PS = pkt_swap
  5800. * SS = status_swap
  5801. * The message is interpreted as follows:
  5802. * dword0 - b'0:7 - msg_type: This will be set to
  5803. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5804. * b'8:15 - pdev_id:
  5805. * 0 (for rings at SOC level),
  5806. * 1/2/3 mac id (for rings at LMAC level)
  5807. * b'16:23 - ring_id : Identify the ring to configure.
  5808. * More details can be got from enum htt_srng_ring_id
  5809. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5810. * BUF_RING_CFG_0 defs within HW .h files,
  5811. * e.g. wmac_top_reg_seq_hwioreg.h
  5812. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5813. * BUF_RING_CFG_0 defs within HW .h files,
  5814. * e.g. wmac_top_reg_seq_hwioreg.h
  5815. * b'26:31 - rsvd1: reserved for future use
  5816. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5817. * in byte units.
  5818. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5819. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5820. * 64, 128, 256.
  5821. * If all 3 bits are set config length is > 256.
  5822. * if val is '0', then ignore this field.
  5823. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5824. * 64, 128, 256.
  5825. * If all 3 bits are set config length is > 256.
  5826. * if val is '0', then ignore this field.
  5827. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5828. * 64, 128, 256.
  5829. * If all 3 bits are set config length is > 256.
  5830. * If val is '0', then ignore this field.
  5831. * - b'25:31 - rsvd2: Reserved for future use
  5832. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5833. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5834. * If packet_type_enable_flags is '1' for MGMT type,
  5835. * monitor will ignore this bit and allow this TLV.
  5836. * If packet_type_enable_flags is '0' for MGMT type,
  5837. * monitor will use this bit to enable/disable logging
  5838. * of this TLV.
  5839. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5840. * If packet_type_enable_flags is '1' for CTRL type,
  5841. * monitor will ignore this bit and allow this TLV.
  5842. * If packet_type_enable_flags is '0' for CTRL type,
  5843. * monitor will use this bit to enable/disable logging
  5844. * of this TLV.
  5845. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5846. * If packet_type_enable_flags is '1' for DATA type,
  5847. * monitor will ignore this bit and allow this TLV.
  5848. * If packet_type_enable_flags is '0' for DATA type,
  5849. * monitor will use this bit to enable/disable logging
  5850. * of this TLV.
  5851. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5852. * If packet_type_enable_flags is '1' for MGMT type,
  5853. * monitor will ignore this bit and allow this TLV.
  5854. * If packet_type_enable_flags is '0' for MGMT type,
  5855. * monitor will use this bit to enable/disable logging
  5856. * of this TLV.
  5857. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5858. * If packet_type_enable_flags is '1' for CTRL type,
  5859. * monitor will ignore this bit and allow this TLV.
  5860. * If packet_type_enable_flags is '0' for CTRL type,
  5861. * monitor will use this bit to enable/disable logging
  5862. * of this TLV.
  5863. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5864. * If packet_type_enable_flags is '1' for DATA type,
  5865. * monitor will ignore this bit and allow this TLV.
  5866. * If packet_type_enable_flags is '0' for DATA type,
  5867. * monitor will use this bit to enable/disable logging
  5868. * of this TLV.
  5869. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5870. * If packet_type_enable_flags is '1' for MGMT type,
  5871. * monitor will ignore this bit and allow this TLV.
  5872. * If packet_type_enable_flags is '0' for MGMT type,
  5873. * monitor will use this bit to enable/disable logging
  5874. * of this TLV.
  5875. * If filter_in_TX_MPDU_START = 1 it is recommended
  5876. * to set this bit.
  5877. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5878. * If packet_type_enable_flags is '1' for CTRL type,
  5879. * monitor will ignore this bit and allow this TLV.
  5880. * If packet_type_enable_flags is '0' for CTRL type,
  5881. * monitor will use this bit to enable/disable logging
  5882. * of this TLV.
  5883. * If filter_in_TX_MPDU_START = 1 it is recommended
  5884. * to set this bit.
  5885. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5886. * If packet_type_enable_flags is '1' for DATA type,
  5887. * monitor will ignore this bit and allow this TLV.
  5888. * If packet_type_enable_flags is '0' for DATA type,
  5889. * monitor will use this bit to enable/disable logging
  5890. * of this TLV.
  5891. * If filter_in_TX_MPDU_START = 1 it is recommended
  5892. * to set this bit.
  5893. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5894. * If packet_type_enable_flags is '1' for MGMT type,
  5895. * monitor will ignore this bit and allow this TLV.
  5896. * If packet_type_enable_flags is '0' for MGMT type,
  5897. * monitor will use this bit to enable/disable logging
  5898. * of this TLV.
  5899. * If filter_in_TX_MSDU_START = 1 it is recommended
  5900. * to set this bit.
  5901. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5902. * If packet_type_enable_flags is '1' for CTRL type,
  5903. * monitor will ignore this bit and allow this TLV.
  5904. * If packet_type_enable_flags is '0' for CTRL type,
  5905. * monitor will use this bit to enable/disable logging
  5906. * of this TLV.
  5907. * If filter_in_TX_MSDU_START = 1 it is recommended
  5908. * to set this bit.
  5909. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5910. * If packet_type_enable_flags is '1' for DATA type,
  5911. * monitor will ignore this bit and allow this TLV.
  5912. * If packet_type_enable_flags is '0' for DATA type,
  5913. * monitor will use this bit to enable/disable logging
  5914. * of this TLV.
  5915. * If filter_in_TX_MSDU_START = 1 it is recommended
  5916. * to set this bit.
  5917. * b'15:31 - rsvd3: Reserved for future use
  5918. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5919. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5920. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5921. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5922. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5923. * - b'8:15 - tx_peer_entry_word_mask:
  5924. * - b'16:23 - tx_queue_ext_word_mask:
  5925. * - b'24:31 - tx_msdu_start_word_mask:
  5926. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5927. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5928. * - b'8:15 - rxpcu_user_setup_word_mask:
  5929. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5930. * MGMT, CTRL, DATA
  5931. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5932. * 0 -> MSDU level logging is enabled
  5933. * (valid only if bit is set in
  5934. * pkt_type_enable_msdu_or_mpdu_logging)
  5935. * 1 -> MPDU level logging is enabled
  5936. * (valid only if bit is set in
  5937. * pkt_type_enable_msdu_or_mpdu_logging)
  5938. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5939. * 0 -> MSDU level logging is enabled
  5940. * (valid only if bit is set in
  5941. * pkt_type_enable_msdu_or_mpdu_logging)
  5942. * 1 -> MPDU level logging is enabled
  5943. * (valid only if bit is set in
  5944. * pkt_type_enable_msdu_or_mpdu_logging)
  5945. * - b'21 - dma_mpdu_data(D) : For DATA
  5946. * 0 -> MSDU level logging is enabled
  5947. * (valid only if bit is set in
  5948. * pkt_type_enable_msdu_or_mpdu_logging)
  5949. * 1 -> MPDU level logging is enabled
  5950. * (valid only if bit is set in
  5951. * pkt_type_enable_msdu_or_mpdu_logging)
  5952. * - b'22:31 - rsvd4 for future use
  5953. */
  5954. PREPACK struct htt_tx_monitor_cfg_t {
  5955. A_UINT32 msg_type: 8,
  5956. pdev_id: 8,
  5957. ring_id: 8,
  5958. status_swap: 1,
  5959. pkt_swap: 1,
  5960. rsvd1: 6;
  5961. A_UINT32 ring_buffer_size: 16,
  5962. config_length_mgmt: 3,
  5963. config_length_ctrl: 3,
  5964. config_length_data: 3,
  5965. rsvd2: 7;
  5966. A_UINT32 pkt_type_enable_flags: 3,
  5967. filter_in_tx_mpdu_start_mgmt: 1,
  5968. filter_in_tx_mpdu_start_ctrl: 1,
  5969. filter_in_tx_mpdu_start_data: 1,
  5970. filter_in_tx_msdu_start_mgmt: 1,
  5971. filter_in_tx_msdu_start_ctrl: 1,
  5972. filter_in_tx_msdu_start_data: 1,
  5973. filter_in_tx_mpdu_end_mgmt: 1,
  5974. filter_in_tx_mpdu_end_ctrl: 1,
  5975. filter_in_tx_mpdu_end_data: 1,
  5976. filter_in_tx_msdu_end_mgmt: 1,
  5977. filter_in_tx_msdu_end_ctrl: 1,
  5978. filter_in_tx_msdu_end_data: 1,
  5979. rsvd3: 17;
  5980. A_UINT32 tlv_filter_mask_in0;
  5981. A_UINT32 tlv_filter_mask_in1;
  5982. A_UINT32 tlv_filter_mask_in2;
  5983. A_UINT32 tlv_filter_mask_in3;
  5984. A_UINT32 tx_fes_setup_word_mask: 8,
  5985. tx_peer_entry_word_mask: 8,
  5986. tx_queue_ext_word_mask: 8,
  5987. tx_msdu_start_word_mask: 8;
  5988. A_UINT32 pcu_ppdu_setup_word_mask;
  5989. A_UINT32 tx_mpdu_start_word_mask: 8,
  5990. rxpcu_user_setup_word_mask: 8,
  5991. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5992. dma_mpdu_mgmt: 1,
  5993. dma_mpdu_ctrl: 1,
  5994. dma_mpdu_data: 1,
  5995. rsvd4: 10;
  5996. } POSTPACK;
  5997. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5998. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5999. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6000. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6001. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6002. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6003. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6004. do { \
  6005. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6006. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6007. } while (0)
  6008. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6009. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6010. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6011. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6012. HTT_TX_MONITOR_CFG_RING_ID_S)
  6013. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6014. do { \
  6015. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6016. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6017. } while (0)
  6018. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6019. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6020. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6021. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6022. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6023. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6024. do { \
  6025. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6026. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6027. } while (0)
  6028. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6029. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6030. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6031. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6032. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6033. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6034. do { \
  6035. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6036. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6037. } while (0)
  6038. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6039. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6040. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6041. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6042. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6043. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6044. do { \
  6045. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6046. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6047. } while (0)
  6048. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6049. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6050. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6051. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6052. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6053. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6054. do { \
  6055. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6056. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6057. } while (0)
  6058. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6059. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6060. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6061. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6062. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6063. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6064. do { \
  6065. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6066. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6067. } while (0)
  6068. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6069. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6070. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6071. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6072. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6073. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6074. do { \
  6075. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6076. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6077. } while (0)
  6078. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6079. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6080. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6081. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6082. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6083. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6084. do { \
  6085. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6086. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6087. } while (0)
  6088. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6089. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6090. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6091. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6092. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6093. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6094. do { \
  6095. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6096. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6097. } while (0)
  6098. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6099. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6100. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6101. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6102. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6103. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6104. do { \
  6105. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6106. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6107. } while (0
  6108. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6109. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6110. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6111. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6112. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6113. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6114. do { \
  6115. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6116. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6117. } while (0)
  6118. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6119. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6120. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6121. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6122. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6123. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6124. do { \
  6125. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6126. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6127. } while (0)
  6128. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6129. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6130. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6131. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6132. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6133. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6134. do { \
  6135. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6136. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6137. } while (0
  6138. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6139. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6140. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6141. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6142. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6143. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6144. do { \
  6145. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6146. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6147. } while (0)
  6148. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6149. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6150. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6151. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6152. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6153. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6154. do { \
  6155. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6156. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6157. } while (0)
  6158. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6159. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6160. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6161. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6162. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6163. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6164. do { \
  6165. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6166. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6167. } while (0
  6168. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6169. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6170. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6171. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6172. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6173. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6174. do { \
  6175. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6176. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6177. } while (0)
  6178. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6179. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6180. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6181. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6182. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6183. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6184. do { \
  6185. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6186. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6187. } while (0)
  6188. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6189. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6190. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6191. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6192. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6193. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6194. do { \
  6195. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6196. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6197. } while (0
  6198. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6199. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6200. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6201. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6202. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6203. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6204. do { \
  6205. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6206. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6207. } while (0)
  6208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6211. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6212. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6213. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6214. do { \
  6215. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6216. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6217. } while (0)
  6218. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6219. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6220. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6221. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6222. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6223. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6224. do { \
  6225. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6226. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6227. } while (0)
  6228. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6229. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6230. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6231. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6232. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6233. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6234. do { \
  6235. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6236. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6237. } while (0)
  6238. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6239. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6240. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6241. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6242. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6243. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6244. do { \
  6245. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6246. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6247. } while (0)
  6248. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6249. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6250. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6251. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6252. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6253. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6254. do { \
  6255. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6256. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6257. } while (0)
  6258. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6259. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6260. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6261. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6262. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6263. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6264. do { \
  6265. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6266. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6267. } while (0)
  6268. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6269. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6270. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6271. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6272. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6273. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6274. do { \
  6275. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6276. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6277. } while (0)
  6278. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6279. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6280. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6281. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6282. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6283. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6284. do { \
  6285. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6286. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6287. } while (0)
  6288. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6289. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6290. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6291. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6292. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6293. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6294. do { \
  6295. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6296. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6297. } while (0)
  6298. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6299. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6300. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6301. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6302. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6303. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6304. do { \
  6305. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6306. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6307. } while (0)
  6308. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6309. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6310. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6311. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6312. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6313. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6314. do { \
  6315. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6316. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6317. } while (0)
  6318. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6319. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6320. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6321. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6322. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6323. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6324. do { \
  6325. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6326. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6327. } while (0)
  6328. /*
  6329. * pkt_type_enable_flags
  6330. */
  6331. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6332. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6333. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6334. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6335. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6336. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6337. /*
  6338. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6339. */
  6340. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6341. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6342. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6343. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6344. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6345. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6346. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6347. do { \
  6348. HTT_CHECK_SET_VAL(httsym, value); \
  6349. (word) |= (value) << httsym##_S; \
  6350. } while (0)
  6351. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6352. (((word) & httsym##_M) >> httsym##_S)
  6353. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6354. * type -> MGMT, CTRL, DATA*/
  6355. #define htt_tx_ring_pkt_type_set( \
  6356. word, mode, type, val) \
  6357. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6358. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6359. #define htt_tx_ring_pkt_type_get( \
  6360. word, mode, type) \
  6361. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6362. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6363. /* Definition to filter in TLVs */
  6364. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6365. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6366. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6367. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6368. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6369. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6370. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6371. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6372. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6373. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6374. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6375. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6376. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6377. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6378. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6379. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6380. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6381. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6382. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6383. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6384. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6385. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6386. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6387. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6388. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6389. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6390. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6391. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6392. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6393. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6394. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6395. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6396. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6397. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6398. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6399. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6400. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6401. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6402. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6403. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6404. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6405. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6406. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6407. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6408. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6409. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6410. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6411. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6412. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6413. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6414. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6415. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6416. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6417. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6418. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6419. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6420. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6421. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6422. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6423. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6424. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6425. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6426. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6427. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6428. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6429. do { \
  6430. HTT_CHECK_SET_VAL(httsym, enable); \
  6431. (word) |= (enable) << httsym##_S; \
  6432. } while (0)
  6433. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6434. (((word) & httsym##_M) >> httsym##_S)
  6435. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6436. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6437. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6438. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6439. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6440. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6441. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6442. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6443. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6444. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6445. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6446. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6447. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6448. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6449. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6450. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6451. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6452. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6453. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6454. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6455. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6456. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6457. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6458. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6459. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6460. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6461. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6462. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6463. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6464. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6465. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6466. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6467. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6468. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6469. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6470. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6471. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6472. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6473. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6474. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6475. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6476. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6477. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6478. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6479. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6480. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6481. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6482. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6483. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6484. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6485. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6486. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6487. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6488. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6489. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6490. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6491. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6492. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6493. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6494. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6495. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6496. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6497. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6498. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6499. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6500. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6501. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6502. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6503. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6504. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6505. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6506. do { \
  6507. HTT_CHECK_SET_VAL(httsym, enable); \
  6508. (word) |= (enable) << httsym##_S; \
  6509. } while (0)
  6510. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6511. (((word) & httsym##_M) >> httsym##_S)
  6512. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6513. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6514. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6515. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6516. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6517. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6519. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6520. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6521. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6522. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6523. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6524. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6525. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6526. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6527. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6528. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6529. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6530. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6531. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6532. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6533. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6534. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6535. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6536. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6537. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6538. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6539. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6540. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6541. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6542. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6543. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6544. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6545. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6546. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6547. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6548. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6549. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6550. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6551. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6552. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6553. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6554. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6555. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6556. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6557. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6558. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6559. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6560. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6561. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6562. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6563. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6564. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6565. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6566. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6567. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6568. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6569. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6570. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6571. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6572. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6573. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6574. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6575. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6576. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6577. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6578. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6579. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6580. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6581. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6582. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6583. do { \
  6584. HTT_CHECK_SET_VAL(httsym, enable); \
  6585. (word) |= (enable) << httsym##_S; \
  6586. } while (0)
  6587. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6588. (((word) & httsym##_M) >> httsym##_S)
  6589. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6590. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6591. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6592. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6593. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6594. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6595. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6596. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6597. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6598. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6599. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6600. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6601. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6602. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6603. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6604. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6605. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6606. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6607. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6608. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6609. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6610. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6611. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6612. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6613. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6614. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6615. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6616. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6617. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6618. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6619. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6620. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6621. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6622. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6623. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6624. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6625. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6626. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6627. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6628. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6629. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6630. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6631. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6632. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6633. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6634. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6635. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6636. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6637. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6638. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6639. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6640. do { \
  6641. HTT_CHECK_SET_VAL(httsym, enable); \
  6642. (word) |= (enable) << httsym##_S; \
  6643. } while (0)
  6644. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6645. (((word) & httsym##_M) >> httsym##_S)
  6646. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6647. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6648. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6649. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6650. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6651. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6652. /**
  6653. * @brief host --> target Receive Flow Steering configuration message definition
  6654. *
  6655. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6656. *
  6657. * host --> target Receive Flow Steering configuration message definition.
  6658. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6659. * The reason for this is we want RFS to be configured and ready before MAC
  6660. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6661. *
  6662. * |31 24|23 16|15 9|8|7 0|
  6663. * |----------------+----------------+----------------+----------------|
  6664. * | reserved |E| msg type |
  6665. * |-------------------------------------------------------------------|
  6666. * Where E = RFS enable flag
  6667. *
  6668. * The RFS_CONFIG message consists of a single 4-byte word.
  6669. *
  6670. * Header fields:
  6671. * - MSG_TYPE
  6672. * Bits 7:0
  6673. * Purpose: identifies this as a RFS config msg
  6674. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6675. * - RFS_CONFIG
  6676. * Bit 8
  6677. * Purpose: Tells target whether to enable (1) or disable (0)
  6678. * flow steering feature when sending rx indication messages to host
  6679. */
  6680. #define HTT_H2T_RFS_CONFIG_M 0x100
  6681. #define HTT_H2T_RFS_CONFIG_S 8
  6682. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6683. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6684. HTT_H2T_RFS_CONFIG_S)
  6685. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6686. do { \
  6687. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6688. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6689. } while (0)
  6690. #define HTT_RFS_CFG_REQ_BYTES 4
  6691. /**
  6692. * @brief host -> target FW extended statistics retrieve
  6693. *
  6694. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6695. *
  6696. * @details
  6697. * The following field definitions describe the format of the HTT host
  6698. * to target FW extended stats retrieve message.
  6699. * The message specifies the type of stats the host wants to retrieve.
  6700. *
  6701. * |31 24|23 16|15 8|7 0|
  6702. * |-----------------------------------------------------------|
  6703. * | reserved | stats type | pdev_mask | msg type |
  6704. * |-----------------------------------------------------------|
  6705. * | config param [0] |
  6706. * |-----------------------------------------------------------|
  6707. * | config param [1] |
  6708. * |-----------------------------------------------------------|
  6709. * | config param [2] |
  6710. * |-----------------------------------------------------------|
  6711. * | config param [3] |
  6712. * |-----------------------------------------------------------|
  6713. * | reserved |
  6714. * |-----------------------------------------------------------|
  6715. * | cookie LSBs |
  6716. * |-----------------------------------------------------------|
  6717. * | cookie MSBs |
  6718. * |-----------------------------------------------------------|
  6719. * Header fields:
  6720. * - MSG_TYPE
  6721. * Bits 7:0
  6722. * Purpose: identifies this is a extended stats upload request message
  6723. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6724. * - PDEV_MASK
  6725. * Bits 8:15
  6726. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6727. * Value: This is a overloaded field, refer to usage and interpretation of
  6728. * PDEV in interface document.
  6729. * Bit 8 : Reserved for SOC stats
  6730. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6731. * Indicates MACID_MASK in DBS
  6732. * - STATS_TYPE
  6733. * Bits 23:16
  6734. * Purpose: identifies which FW statistics to upload
  6735. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6736. * - Reserved
  6737. * Bits 31:24
  6738. * - CONFIG_PARAM [0]
  6739. * Bits 31:0
  6740. * Purpose: give an opaque configuration value to the specified stats type
  6741. * Value: stats-type specific configuration value
  6742. * Refer to htt_stats.h for interpretation for each stats sub_type
  6743. * - CONFIG_PARAM [1]
  6744. * Bits 31:0
  6745. * Purpose: give an opaque configuration value to the specified stats type
  6746. * Value: stats-type specific configuration value
  6747. * Refer to htt_stats.h for interpretation for each stats sub_type
  6748. * - CONFIG_PARAM [2]
  6749. * Bits 31:0
  6750. * Purpose: give an opaque configuration value to the specified stats type
  6751. * Value: stats-type specific configuration value
  6752. * Refer to htt_stats.h for interpretation for each stats sub_type
  6753. * - CONFIG_PARAM [3]
  6754. * Bits 31:0
  6755. * Purpose: give an opaque configuration value to the specified stats type
  6756. * Value: stats-type specific configuration value
  6757. * Refer to htt_stats.h for interpretation for each stats sub_type
  6758. * - Reserved [31:0] for future use.
  6759. * - COOKIE_LSBS
  6760. * Bits 31:0
  6761. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6762. * message with its preceding host->target stats request message.
  6763. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6764. * - COOKIE_MSBS
  6765. * Bits 31:0
  6766. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6767. * message with its preceding host->target stats request message.
  6768. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6769. */
  6770. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6771. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6772. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6773. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6774. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6775. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6776. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6777. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6778. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6779. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6780. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6781. do { \
  6782. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6783. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6784. } while (0)
  6785. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6786. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6787. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6788. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6789. do { \
  6790. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6791. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6792. } while (0)
  6793. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6794. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6795. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6796. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6797. do { \
  6798. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6799. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6800. } while (0)
  6801. /**
  6802. * @brief host -> target FW PPDU_STATS request message
  6803. *
  6804. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6805. *
  6806. * @details
  6807. * The following field definitions describe the format of the HTT host
  6808. * to target FW for PPDU_STATS_CFG msg.
  6809. * The message allows the host to configure the PPDU_STATS_IND messages
  6810. * produced by the target.
  6811. *
  6812. * |31 24|23 16|15 8|7 0|
  6813. * |-----------------------------------------------------------|
  6814. * | REQ bit mask | pdev_mask | msg type |
  6815. * |-----------------------------------------------------------|
  6816. * Header fields:
  6817. * - MSG_TYPE
  6818. * Bits 7:0
  6819. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6820. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6821. * - PDEV_MASK
  6822. * Bits 8:15
  6823. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6824. * Value: This is a overloaded field, refer to usage and interpretation of
  6825. * PDEV in interface document.
  6826. * Bit 8 : Reserved for SOC stats
  6827. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6828. * Indicates MACID_MASK in DBS
  6829. * - REQ_TLV_BIT_MASK
  6830. * Bits 16:31
  6831. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6832. * needs to be included in the target's PPDU_STATS_IND messages.
  6833. * Value: refer htt_ppdu_stats_tlv_tag_t
  6834. *
  6835. */
  6836. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6837. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6838. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6839. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6840. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6841. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6842. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6843. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6844. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6845. do { \
  6846. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6847. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6848. } while (0)
  6849. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6850. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6851. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6852. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6853. do { \
  6854. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6855. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6856. } while (0)
  6857. /**
  6858. * @brief Host-->target HTT RX FSE setup message
  6859. *
  6860. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6861. *
  6862. * @details
  6863. * Through this message, the host will provide details of the flow tables
  6864. * in host DDR along with hash keys.
  6865. * This message can be sent per SOC or per PDEV, which is differentiated
  6866. * by pdev id values.
  6867. * The host will allocate flow search table and sends table size,
  6868. * physical DMA address of flow table, and hash keys to firmware to
  6869. * program into the RXOLE FSE HW block.
  6870. *
  6871. * The following field definitions describe the format of the RX FSE setup
  6872. * message sent from the host to target
  6873. *
  6874. * Header fields:
  6875. * dword0 - b'7:0 - msg_type: This will be set to
  6876. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6877. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6878. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6879. * pdev's LMAC ring.
  6880. * b'31:16 - reserved : Reserved for future use
  6881. * dword1 - b'19:0 - number of records: This field indicates the number of
  6882. * entries in the flow table. For example: 8k number of
  6883. * records is equivalent to
  6884. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6885. * b'27:20 - max search: This field specifies the skid length to FSE
  6886. * parser HW module whenever match is not found at the
  6887. * exact index pointed by hash.
  6888. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6889. * Refer htt_ip_da_sa_prefix below for more details.
  6890. * b'31:30 - reserved: Reserved for future use
  6891. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6892. * table allocated by host in DDR
  6893. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6894. * table allocated by host in DDR
  6895. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6896. * entry hashing
  6897. *
  6898. *
  6899. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6900. * |---------------------------------------------------------------|
  6901. * | reserved | pdev_id | MSG_TYPE |
  6902. * |---------------------------------------------------------------|
  6903. * |resvd|IPDSA| max_search | Number of records |
  6904. * |---------------------------------------------------------------|
  6905. * | base address lo |
  6906. * |---------------------------------------------------------------|
  6907. * | base address high |
  6908. * |---------------------------------------------------------------|
  6909. * | toeplitz key 31_0 |
  6910. * |---------------------------------------------------------------|
  6911. * | toeplitz key 63_32 |
  6912. * |---------------------------------------------------------------|
  6913. * | toeplitz key 95_64 |
  6914. * |---------------------------------------------------------------|
  6915. * | toeplitz key 127_96 |
  6916. * |---------------------------------------------------------------|
  6917. * | toeplitz key 159_128 |
  6918. * |---------------------------------------------------------------|
  6919. * | toeplitz key 191_160 |
  6920. * |---------------------------------------------------------------|
  6921. * | toeplitz key 223_192 |
  6922. * |---------------------------------------------------------------|
  6923. * | toeplitz key 255_224 |
  6924. * |---------------------------------------------------------------|
  6925. * | toeplitz key 287_256 |
  6926. * |---------------------------------------------------------------|
  6927. * | reserved | toeplitz key 314_288(26:0 bits) |
  6928. * |---------------------------------------------------------------|
  6929. * where:
  6930. * IPDSA = ip_da_sa
  6931. */
  6932. /**
  6933. * @brief: htt_ip_da_sa_prefix
  6934. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6935. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6936. * documentation per RFC3849
  6937. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6938. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6939. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6940. */
  6941. enum htt_ip_da_sa_prefix {
  6942. HTT_RX_IPV6_20010db8,
  6943. HTT_RX_IPV4_MAPPED_IPV6,
  6944. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6945. HTT_RX_IPV6_64FF9B,
  6946. };
  6947. /**
  6948. * @brief Host-->target HTT RX FISA configure and enable
  6949. *
  6950. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6951. *
  6952. * @details
  6953. * The host will send this command down to configure and enable the FISA
  6954. * operational params.
  6955. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6956. * register.
  6957. * Should configure both the MACs.
  6958. *
  6959. * dword0 - b'7:0 - msg_type:
  6960. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6961. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6962. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6963. * pdev's LMAC ring.
  6964. * b'31:16 - reserved : Reserved for future use
  6965. *
  6966. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6967. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6968. * packets. 1 flow search will be skipped
  6969. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6970. * tcp,udp packets
  6971. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6972. * calculation
  6973. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6974. * calculation
  6975. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6976. * calculation
  6977. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6978. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6979. * length
  6980. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6981. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6982. * length
  6983. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6984. * num jump
  6985. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6986. * num jump
  6987. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6988. * data type switch has happend for MPDU Sequence num jump
  6989. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6990. * for MPDU Sequence num jump
  6991. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6992. * for decrypt errors
  6993. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6994. * while aggregating a msdu
  6995. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6996. * The aggregation is done until (number of MSDUs aggregated
  6997. * < LIMIT + 1)
  6998. * b'31:18 - Reserved
  6999. *
  7000. * fisa_control_value - 32bit value FW can write to register
  7001. *
  7002. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7003. * Threshold value for FISA timeout (units are microseconds).
  7004. * When the global timestamp exceeds this threshold, FISA
  7005. * aggregation will be restarted.
  7006. * A value of 0 means timeout is disabled.
  7007. * Compare the threshold register with timestamp field in
  7008. * flow entry to generate timeout for the flow.
  7009. *
  7010. * |31 18 |17 16|15 8|7 0|
  7011. * |-------------------------------------------------------------|
  7012. * | reserved | pdev_mask | msg type |
  7013. * |-------------------------------------------------------------|
  7014. * | reserved | FISA_CTRL |
  7015. * |-------------------------------------------------------------|
  7016. * | FISA_TIMEOUT_THRESH |
  7017. * |-------------------------------------------------------------|
  7018. */
  7019. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7020. A_UINT32 msg_type:8,
  7021. pdev_id:8,
  7022. reserved0:16;
  7023. /**
  7024. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7025. * [17:0]
  7026. */
  7027. union {
  7028. /*
  7029. * fisa_control_bits structure is deprecated.
  7030. * Please use fisa_control_bits_v2 going forward.
  7031. */
  7032. struct {
  7033. A_UINT32 fisa_enable: 1,
  7034. ipsec_skip_search: 1,
  7035. nontcp_skip_search: 1,
  7036. add_ipv4_fixed_hdr_len: 1,
  7037. add_ipv6_fixed_hdr_len: 1,
  7038. add_tcp_fixed_hdr_len: 1,
  7039. add_udp_hdr_len: 1,
  7040. chksum_cum_ip_len_en: 1,
  7041. disable_tid_check: 1,
  7042. disable_ta_check: 1,
  7043. disable_qos_check: 1,
  7044. disable_raw_check: 1,
  7045. disable_decrypt_err_check: 1,
  7046. disable_msdu_drop_check: 1,
  7047. fisa_aggr_limit: 4,
  7048. reserved: 14;
  7049. } fisa_control_bits;
  7050. struct {
  7051. A_UINT32 fisa_enable: 1,
  7052. fisa_aggr_limit: 4,
  7053. reserved: 27;
  7054. } fisa_control_bits_v2;
  7055. A_UINT32 fisa_control_value;
  7056. } u_fisa_control;
  7057. /**
  7058. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7059. * timeout threshold for aggregation. Unit in usec.
  7060. * [31:0]
  7061. */
  7062. A_UINT32 fisa_timeout_threshold;
  7063. } POSTPACK;
  7064. /* DWord 0: pdev-ID */
  7065. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7066. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7067. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7068. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7069. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7070. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7071. do { \
  7072. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7073. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7074. } while (0)
  7075. /* Dword 1: fisa_control_value fisa config */
  7076. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7077. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7078. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7079. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7080. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7081. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7082. do { \
  7083. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7084. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7085. } while (0)
  7086. /* Dword 1: fisa_control_value ipsec_skip_search */
  7087. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7088. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7089. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7090. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7091. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7092. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7093. do { \
  7094. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7095. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7096. } while (0)
  7097. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7098. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7099. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7100. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7101. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7102. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7103. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7104. do { \
  7105. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7106. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7107. } while (0)
  7108. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7109. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7110. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7111. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7112. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7113. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7114. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7115. do { \
  7116. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7117. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7118. } while (0)
  7119. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7120. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7121. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7122. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7123. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7124. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7125. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7126. do { \
  7127. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7128. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7129. } while (0)
  7130. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7131. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7132. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7133. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7134. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7135. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7136. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7137. do { \
  7138. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7139. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7140. } while (0)
  7141. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7142. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7143. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7144. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7145. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7146. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7147. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7148. do { \
  7149. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7150. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7151. } while (0)
  7152. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7153. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7154. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7155. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7156. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7157. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7158. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7159. do { \
  7160. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7161. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7162. } while (0)
  7163. /* Dword 1: fisa_control_value disable_tid_check */
  7164. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7165. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7166. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7167. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7168. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7169. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7170. do { \
  7171. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7172. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7173. } while (0)
  7174. /* Dword 1: fisa_control_value disable_ta_check */
  7175. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7176. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7177. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7178. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7179. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7180. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7181. do { \
  7182. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7183. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7184. } while (0)
  7185. /* Dword 1: fisa_control_value disable_qos_check */
  7186. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7187. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7188. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7189. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7190. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7191. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7192. do { \
  7193. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7194. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7195. } while (0)
  7196. /* Dword 1: fisa_control_value disable_raw_check */
  7197. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7198. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7199. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7200. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7201. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7202. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7203. do { \
  7204. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7205. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7206. } while (0)
  7207. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7208. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7209. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7210. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7211. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7212. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7213. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7214. do { \
  7215. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7216. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7217. } while (0)
  7218. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7219. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7220. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7221. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7222. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7223. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7224. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7225. do { \
  7226. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7227. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7228. } while (0)
  7229. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7230. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7231. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7232. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7233. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7234. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7235. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7238. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7239. } while (0)
  7240. /* Dword 1: fisa_control_value fisa config */
  7241. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7242. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7243. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7244. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7245. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7246. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7247. do { \
  7248. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7249. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7250. } while (0)
  7251. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7252. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7253. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7254. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7255. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7256. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7257. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7258. do { \
  7259. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7260. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7261. } while (0)
  7262. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7263. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7264. pdev_id:8,
  7265. reserved0:16;
  7266. A_UINT32 num_records:20,
  7267. max_search:8,
  7268. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7269. reserved1:2;
  7270. A_UINT32 base_addr_lo;
  7271. A_UINT32 base_addr_hi;
  7272. A_UINT32 toeplitz31_0;
  7273. A_UINT32 toeplitz63_32;
  7274. A_UINT32 toeplitz95_64;
  7275. A_UINT32 toeplitz127_96;
  7276. A_UINT32 toeplitz159_128;
  7277. A_UINT32 toeplitz191_160;
  7278. A_UINT32 toeplitz223_192;
  7279. A_UINT32 toeplitz255_224;
  7280. A_UINT32 toeplitz287_256;
  7281. A_UINT32 toeplitz314_288:27,
  7282. reserved2:5;
  7283. } POSTPACK;
  7284. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7285. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7286. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7287. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7288. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7289. /* DWORD 0: Pdev ID */
  7290. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7291. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7292. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7293. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7294. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7295. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7296. do { \
  7297. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7298. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7299. } while (0)
  7300. /* DWORD 1:num of records */
  7301. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7302. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7303. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7304. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7305. HTT_RX_FSE_SETUP_NUM_REC_S)
  7306. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7307. do { \
  7308. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7309. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7310. } while (0)
  7311. /* DWORD 1:max_search */
  7312. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7313. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7314. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7315. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7316. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7317. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7318. do { \
  7319. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7320. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7321. } while (0)
  7322. /* DWORD 1:ip_da_sa prefix */
  7323. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7324. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7325. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7326. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7327. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7328. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7329. do { \
  7330. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7331. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7332. } while (0)
  7333. /* DWORD 2: Base Address LO */
  7334. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7335. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7336. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7337. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7338. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7339. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7340. do { \
  7341. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7342. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7343. } while (0)
  7344. /* DWORD 3: Base Address High */
  7345. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7346. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7347. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7348. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7349. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7350. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7351. do { \
  7352. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7353. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7354. } while (0)
  7355. /* DWORD 4-12: Hash Value */
  7356. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7357. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7358. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7359. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7360. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7361. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7362. do { \
  7363. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7364. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7365. } while (0)
  7366. /* DWORD 13: Hash Value 314:288 bits */
  7367. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7368. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7369. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7370. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7371. do { \
  7372. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7373. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7374. } while (0)
  7375. /**
  7376. * @brief Host-->target HTT RX FSE operation message
  7377. *
  7378. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7379. *
  7380. * @details
  7381. * The host will send this Flow Search Engine (FSE) operation message for
  7382. * every flow add/delete operation.
  7383. * The FSE operation includes FSE full cache invalidation or individual entry
  7384. * invalidation.
  7385. * This message can be sent per SOC or per PDEV which is differentiated
  7386. * by pdev id values.
  7387. *
  7388. * |31 16|15 8|7 1|0|
  7389. * |-------------------------------------------------------------|
  7390. * | reserved | pdev_id | MSG_TYPE |
  7391. * |-------------------------------------------------------------|
  7392. * | reserved | operation |I|
  7393. * |-------------------------------------------------------------|
  7394. * | ip_src_addr_31_0 |
  7395. * |-------------------------------------------------------------|
  7396. * | ip_src_addr_63_32 |
  7397. * |-------------------------------------------------------------|
  7398. * | ip_src_addr_95_64 |
  7399. * |-------------------------------------------------------------|
  7400. * | ip_src_addr_127_96 |
  7401. * |-------------------------------------------------------------|
  7402. * | ip_dst_addr_31_0 |
  7403. * |-------------------------------------------------------------|
  7404. * | ip_dst_addr_63_32 |
  7405. * |-------------------------------------------------------------|
  7406. * | ip_dst_addr_95_64 |
  7407. * |-------------------------------------------------------------|
  7408. * | ip_dst_addr_127_96 |
  7409. * |-------------------------------------------------------------|
  7410. * | l4_dst_port | l4_src_port |
  7411. * | (32-bit SPI incase of IPsec) |
  7412. * |-------------------------------------------------------------|
  7413. * | reserved | l4_proto |
  7414. * |-------------------------------------------------------------|
  7415. *
  7416. * where I is 1-bit ipsec_valid.
  7417. *
  7418. * The following field definitions describe the format of the RX FSE operation
  7419. * message sent from the host to target for every add/delete flow entry to flow
  7420. * table.
  7421. *
  7422. * Header fields:
  7423. * dword0 - b'7:0 - msg_type: This will be set to
  7424. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7425. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7426. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7427. * specified pdev's LMAC ring.
  7428. * b'31:16 - reserved : Reserved for future use
  7429. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7430. * (Internet Protocol Security).
  7431. * IPsec describes the framework for providing security at
  7432. * IP layer. IPsec is defined for both versions of IP:
  7433. * IPV4 and IPV6.
  7434. * Please refer to htt_rx_flow_proto enumeration below for
  7435. * more info.
  7436. * ipsec_valid = 1 for IPSEC packets
  7437. * ipsec_valid = 0 for IP Packets
  7438. * b'7:1 - operation: This indicates types of FSE operation.
  7439. * Refer to htt_rx_fse_operation enumeration:
  7440. * 0 - No Cache Invalidation required
  7441. * 1 - Cache invalidate only one entry given by IP
  7442. * src/dest address at DWORD[2:9]
  7443. * 2 - Complete FSE Cache Invalidation
  7444. * 3 - FSE Disable
  7445. * 4 - FSE Enable
  7446. * b'31:8 - reserved: Reserved for future use
  7447. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7448. * for per flow addition/deletion
  7449. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7450. * and the subsequent 3 A_UINT32 will be padding bytes.
  7451. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7452. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7453. * from 0 to 65535 but only 0 to 1023 are designated as
  7454. * well-known ports. Refer to [RFC1700] for more details.
  7455. * This field is valid only if
  7456. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7457. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7458. * range from 0 to 65535 but only 0 to 1023 are designated
  7459. * as well-known ports. Refer to [RFC1700] for more details.
  7460. * This field is valid only if
  7461. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7462. * - SPI (31:0): Security Parameters Index is an
  7463. * identification tag added to the header while using IPsec
  7464. * for tunneling the IP traffici.
  7465. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7466. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7467. * Assigned Internet Protocol Numbers.
  7468. * l4_proto numbers for standard protocol like UDP/TCP
  7469. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7470. * l4_proto = 17 for UDP etc.
  7471. * b'31:8 - reserved: Reserved for future use.
  7472. *
  7473. */
  7474. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7475. A_UINT32 msg_type:8,
  7476. pdev_id:8,
  7477. reserved0:16;
  7478. A_UINT32 ipsec_valid:1,
  7479. operation:7,
  7480. reserved1:24;
  7481. A_UINT32 ip_src_addr_31_0;
  7482. A_UINT32 ip_src_addr_63_32;
  7483. A_UINT32 ip_src_addr_95_64;
  7484. A_UINT32 ip_src_addr_127_96;
  7485. A_UINT32 ip_dest_addr_31_0;
  7486. A_UINT32 ip_dest_addr_63_32;
  7487. A_UINT32 ip_dest_addr_95_64;
  7488. A_UINT32 ip_dest_addr_127_96;
  7489. union {
  7490. A_UINT32 spi;
  7491. struct {
  7492. A_UINT32 l4_src_port:16,
  7493. l4_dest_port:16;
  7494. } ip;
  7495. } u;
  7496. A_UINT32 l4_proto:8,
  7497. reserved:24;
  7498. } POSTPACK;
  7499. /**
  7500. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7501. *
  7502. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7503. *
  7504. * @details
  7505. * The host will send this Full monitor mode register configuration message.
  7506. * This message can be sent per SOC or per PDEV which is differentiated
  7507. * by pdev id values.
  7508. *
  7509. * |31 16|15 11|10 8|7 3|2|1|0|
  7510. * |-------------------------------------------------------------|
  7511. * | reserved | pdev_id | MSG_TYPE |
  7512. * |-------------------------------------------------------------|
  7513. * | reserved |Release Ring |N|Z|E|
  7514. * |-------------------------------------------------------------|
  7515. *
  7516. * where E is 1-bit full monitor mode enable/disable.
  7517. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7518. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7519. *
  7520. * The following field definitions describe the format of the full monitor
  7521. * mode configuration message sent from the host to target for each pdev.
  7522. *
  7523. * Header fields:
  7524. * dword0 - b'7:0 - msg_type: This will be set to
  7525. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7526. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7527. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7528. * specified pdev's LMAC ring.
  7529. * b'31:16 - reserved : Reserved for future use.
  7530. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7531. * monitor mode rxdma register is to be enabled or disabled.
  7532. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7533. * additional descriptors at ppdu end for zero mpdus
  7534. * enabled or disabled.
  7535. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7536. * additional descriptors at ppdu end for non zero mpdus
  7537. * enabled or disabled.
  7538. * b'10:3 - release_ring: This indicates the destination ring
  7539. * selection for the descriptor at the end of PPDU
  7540. * 0 - REO ring select
  7541. * 1 - FW ring select
  7542. * 2 - SW ring select
  7543. * 3 - Release ring select
  7544. * Refer to htt_rx_full_mon_release_ring.
  7545. * b'31:11 - reserved for future use
  7546. */
  7547. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7548. A_UINT32 msg_type:8,
  7549. pdev_id:8,
  7550. reserved0:16;
  7551. A_UINT32 full_monitor_mode_enable:1,
  7552. addnl_descs_zero_mpdus_end:1,
  7553. addnl_descs_non_zero_mpdus_end:1,
  7554. release_ring:8,
  7555. reserved1:21;
  7556. } POSTPACK;
  7557. /**
  7558. * Enumeration for full monitor mode destination ring select
  7559. * 0 - REO destination ring select
  7560. * 1 - FW destination ring select
  7561. * 2 - SW destination ring select
  7562. * 3 - Release destination ring select
  7563. */
  7564. enum htt_rx_full_mon_release_ring {
  7565. HTT_RX_MON_RING_REO,
  7566. HTT_RX_MON_RING_FW,
  7567. HTT_RX_MON_RING_SW,
  7568. HTT_RX_MON_RING_RELEASE,
  7569. };
  7570. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7571. /* DWORD 0: Pdev ID */
  7572. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7573. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7574. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7575. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7576. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7577. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7578. do { \
  7579. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7580. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7581. } while (0)
  7582. /* DWORD 1:ENABLE */
  7583. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7584. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7585. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7586. do { \
  7587. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7588. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7589. } while (0)
  7590. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7591. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7592. /* DWORD 1:ZERO_MPDU */
  7593. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7594. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7595. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7596. do { \
  7597. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7598. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7599. } while (0)
  7600. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7601. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7602. /* DWORD 1:NON_ZERO_MPDU */
  7603. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7604. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7605. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7606. do { \
  7607. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7608. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7609. } while (0)
  7610. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7611. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7612. /* DWORD 1:RELEASE_RINGS */
  7613. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7614. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7615. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7616. do { \
  7617. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7618. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7619. } while (0)
  7620. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7621. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7622. /**
  7623. * Enumeration for IP Protocol or IPSEC Protocol
  7624. * IPsec describes the framework for providing security at IP layer.
  7625. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7626. */
  7627. enum htt_rx_flow_proto {
  7628. HTT_RX_FLOW_IP_PROTO,
  7629. HTT_RX_FLOW_IPSEC_PROTO,
  7630. };
  7631. /**
  7632. * Enumeration for FSE Cache Invalidation
  7633. * 0 - No Cache Invalidation required
  7634. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7635. * 2 - Complete FSE Cache Invalidation
  7636. * 3 - FSE Disable
  7637. * 4 - FSE Enable
  7638. */
  7639. enum htt_rx_fse_operation {
  7640. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7641. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7642. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7643. HTT_RX_FSE_DISABLE,
  7644. HTT_RX_FSE_ENABLE,
  7645. };
  7646. /* DWORD 0: Pdev ID */
  7647. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7648. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7649. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7650. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7651. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7652. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7653. do { \
  7654. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7655. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7656. } while (0)
  7657. /* DWORD 1:IP PROTO or IPSEC */
  7658. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7659. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7660. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7661. do { \
  7662. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7663. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7664. } while (0)
  7665. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7666. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7667. /* DWORD 1:FSE Operation */
  7668. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7669. #define HTT_RX_FSE_OPERATION_S 1
  7670. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7673. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7674. } while (0)
  7675. #define HTT_RX_FSE_OPERATION_GET(word) \
  7676. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7677. /* DWORD 2-9:IP Address */
  7678. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7679. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7680. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7681. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7682. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7683. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7684. do { \
  7685. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7686. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7687. } while (0)
  7688. /* DWORD 10:Source Port Number */
  7689. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7690. #define HTT_RX_FSE_SOURCEPORT_S 0
  7691. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7692. do { \
  7693. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7694. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7695. } while (0)
  7696. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7697. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7698. /* DWORD 11:Destination Port Number */
  7699. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7700. #define HTT_RX_FSE_DESTPORT_S 16
  7701. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7702. do { \
  7703. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7704. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7705. } while (0)
  7706. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7707. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7708. /* DWORD 10-11:SPI (In case of IPSEC) */
  7709. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7710. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7711. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7712. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7713. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7714. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7715. do { \
  7716. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7717. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7718. } while (0)
  7719. /* DWORD 12:L4 PROTO */
  7720. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7721. #define HTT_RX_FSE_L4_PROTO_S 0
  7722. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7723. do { \
  7724. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7725. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7726. } while (0)
  7727. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7728. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7729. /**
  7730. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7731. *
  7732. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7733. *
  7734. * |31 24|23 |15 8|7 2|1|0|
  7735. * |----------------+----------------+----------------+----------------|
  7736. * | reserved | pdev_id | msg_type |
  7737. * |---------------------------------+----------------+----------------|
  7738. * | reserved |E|F|
  7739. * |---------------------------------+----------------+----------------|
  7740. * Where E = Configure the target to provide the 3-tuple hash value in
  7741. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7742. * F = Configure the target to provide the 3-tuple hash value in
  7743. * flow_id_toeplitz field of rx_msdu_start tlv
  7744. *
  7745. * The following field definitions describe the format of the 3 tuple hash value
  7746. * message sent from the host to target as part of initialization sequence.
  7747. *
  7748. * Header fields:
  7749. * dword0 - b'7:0 - msg_type: This will be set to
  7750. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7751. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7752. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7753. * specified pdev's LMAC ring.
  7754. * b'31:16 - reserved : Reserved for future use
  7755. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7756. * b'1 - toeplitz_hash_2_or_4_field_enable
  7757. * b'31:2 - reserved : Reserved for future use
  7758. * ---------+------+----------------------------------------------------------
  7759. * bit1 | bit0 | Functionality
  7760. * ---------+------+----------------------------------------------------------
  7761. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7762. * | | in flow_id_toeplitz field
  7763. * ---------+------+----------------------------------------------------------
  7764. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7765. * | | in toeplitz_hash_2_or_4 field
  7766. * ---------+------+----------------------------------------------------------
  7767. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7768. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7769. * ---------+------+----------------------------------------------------------
  7770. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7771. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7772. * | | toeplitz_hash_2_or_4 field
  7773. *----------------------------------------------------------------------------
  7774. */
  7775. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7776. A_UINT32 msg_type :8,
  7777. pdev_id :8,
  7778. reserved0 :16;
  7779. A_UINT32 flow_id_toeplitz_field_enable :1,
  7780. toeplitz_hash_2_or_4_field_enable :1,
  7781. reserved1 :30;
  7782. } POSTPACK;
  7783. /* DWORD0 : pdev_id configuration Macros */
  7784. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7785. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7786. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7787. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7788. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7789. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7790. do { \
  7791. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7792. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7793. } while (0)
  7794. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7795. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7796. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7797. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7798. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7799. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7800. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7801. do { \
  7802. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7803. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7804. } while (0)
  7805. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7806. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7807. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7808. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7809. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7810. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7811. do { \
  7812. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7813. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7814. } while (0)
  7815. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7816. /**
  7817. * @brief host --> target Host PA Address Size
  7818. *
  7819. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7820. *
  7821. * @details
  7822. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7823. * provide the physical start address and size of each of the memory
  7824. * areas within host DDR that the target FW may need to access.
  7825. *
  7826. * For example, the host can use this message to allow the target FW
  7827. * to set up access to the host's pools of TQM link descriptors.
  7828. * The message would appear as follows:
  7829. *
  7830. * |31 24|23 16|15 8|7 0|
  7831. * |----------------+----------------+----------------+----------------|
  7832. * | reserved | num_entries | msg_type |
  7833. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7834. * | mem area 0 size |
  7835. * |----------------+----------------+----------------+----------------|
  7836. * | mem area 0 physical_address_lo |
  7837. * |----------------+----------------+----------------+----------------|
  7838. * | mem area 0 physical_address_hi |
  7839. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7840. * | mem area 1 size |
  7841. * |----------------+----------------+----------------+----------------|
  7842. * | mem area 1 physical_address_lo |
  7843. * |----------------+----------------+----------------+----------------|
  7844. * | mem area 1 physical_address_hi |
  7845. * |----------------+----------------+----------------+----------------|
  7846. * ...
  7847. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7848. * | mem area N size |
  7849. * |----------------+----------------+----------------+----------------|
  7850. * | mem area N physical_address_lo |
  7851. * |----------------+----------------+----------------+----------------|
  7852. * | mem area N physical_address_hi |
  7853. * |----------------+----------------+----------------+----------------|
  7854. *
  7855. * The message is interpreted as follows:
  7856. * dword0 - b'0:7 - msg_type: This will be set to
  7857. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7858. * b'8:15 - number_entries: Indicated the number of host memory
  7859. * areas specified within the remainder of the message
  7860. * b'16:31 - reserved.
  7861. * dword1 - b'0:31 - memory area 0 size in bytes
  7862. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7863. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7864. * and similar for memory area 1 through memory area N.
  7865. */
  7866. PREPACK struct htt_h2t_host_paddr_size {
  7867. A_UINT32 msg_type: 8,
  7868. num_entries: 8,
  7869. reserved: 16;
  7870. } POSTPACK;
  7871. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7872. A_UINT32 size;
  7873. A_UINT32 physical_address_lo;
  7874. A_UINT32 physical_address_hi;
  7875. } POSTPACK;
  7876. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7877. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7878. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7879. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7880. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7881. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7882. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7883. do { \
  7884. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7885. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7886. } while (0)
  7887. /**
  7888. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7889. *
  7890. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7891. *
  7892. * @details
  7893. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7894. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7895. *
  7896. * The message would appear as follows:
  7897. *
  7898. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7899. * |---------------------------------+---+---+----------+-+-----------|
  7900. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7901. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7902. *
  7903. *
  7904. * The message is interpreted as follows:
  7905. * dword0 - b'0:7 - msg_type: This will be set to
  7906. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7907. * b'8 - override bit to drive MSDUs to PPE ring
  7908. * b'9:13 - REO destination ring indication
  7909. * b'14 - Multi buffer msdu override enable bit
  7910. * b'15 - Intra BSS override
  7911. * b'16 - Decap raw override
  7912. * b'17 - Decap Native wifi override
  7913. * b'18 - IP frag override
  7914. * b'19:31 - reserved
  7915. */
  7916. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7917. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7918. override: 1,
  7919. reo_destination_indication: 5,
  7920. multi_buffer_msdu_override_en: 1,
  7921. intra_bss_override: 1,
  7922. decap_raw_override: 1,
  7923. decap_nwifi_override: 1,
  7924. ip_frag_override: 1,
  7925. reserved: 13;
  7926. } POSTPACK;
  7927. /* DWORD 0: Override */
  7928. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7929. #define HTT_PPE_CFG_OVERRIDE_S 8
  7930. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7931. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7932. HTT_PPE_CFG_OVERRIDE_S)
  7933. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7934. do { \
  7935. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7936. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7937. } while (0)
  7938. /* DWORD 0: REO Destination Indication*/
  7939. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7940. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7941. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7942. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7943. HTT_PPE_CFG_REO_DEST_IND_S)
  7944. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7945. do { \
  7946. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7947. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7948. } while (0)
  7949. /* DWORD 0: Multi buffer MSDU override */
  7950. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7951. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7952. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7953. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7954. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7955. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7956. do { \
  7957. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7958. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7959. } while (0)
  7960. /* DWORD 0: Intra BSS override */
  7961. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7962. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7963. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7964. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7965. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7966. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7967. do { \
  7968. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7969. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7970. } while (0)
  7971. /* DWORD 0: Decap RAW override */
  7972. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7973. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7974. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7975. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7976. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7977. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7978. do { \
  7979. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7980. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7981. } while (0)
  7982. /* DWORD 0: Decap NWIFI override */
  7983. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7984. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7985. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7986. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7987. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7988. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7989. do { \
  7990. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7991. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7992. } while (0)
  7993. /* DWORD 0: IP frag override */
  7994. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7995. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7996. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7997. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7998. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7999. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8000. do { \
  8001. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8002. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8003. } while (0)
  8004. /*
  8005. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8006. *
  8007. * @details
  8008. * The following field definitions describe the format of the HTT host
  8009. * to target FW VDEV TX RX stats retrieve message.
  8010. * The message specifies the type of stats the host wants to retrieve.
  8011. *
  8012. * |31 27|26 25|24 17|16|15 8|7 0|
  8013. * |-----------------------------------------------------------|
  8014. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8015. * |-----------------------------------------------------------|
  8016. * | vdev_id lower bitmask |
  8017. * |-----------------------------------------------------------|
  8018. * | vdev_id upper bitmask |
  8019. * |-----------------------------------------------------------|
  8020. * Header fields:
  8021. * Where:
  8022. * dword0 - b'7:0 - msg_type: This will be set to
  8023. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8024. * b'15:8 - pdev id
  8025. * b'16(E) - Enable/Disable the vdev HW stats
  8026. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8027. * b'25:26(R) - Reset stats bits
  8028. * 0: don't reset stats
  8029. * 1: reset stats once
  8030. * 2: reset stats at the start of each periodic interval
  8031. * b'27:31 - reserved for future use
  8032. * dword1 - b'0:31 - vdev_id lower bitmask
  8033. * dword2 - b'0:31 - vdev_id upper bitmask
  8034. */
  8035. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8036. A_UINT32 msg_type :8,
  8037. pdev_id :8,
  8038. enable :1,
  8039. periodic_interval :8,
  8040. reset_stats_bits :2,
  8041. reserved0 :5;
  8042. A_UINT32 vdev_id_lower_bitmask;
  8043. A_UINT32 vdev_id_upper_bitmask;
  8044. } POSTPACK;
  8045. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8046. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8047. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8048. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8049. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8050. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8051. do { \
  8052. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8053. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8054. } while (0)
  8055. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8056. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8057. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8058. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8059. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8060. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8061. do { \
  8062. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8063. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8064. } while (0)
  8065. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8066. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8067. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8068. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8069. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8070. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8071. do { \
  8072. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8073. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8074. } while (0)
  8075. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8076. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8077. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8078. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8079. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8080. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8081. do { \
  8082. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8083. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8084. } while (0)
  8085. /*
  8086. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8087. *
  8088. * @details
  8089. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8090. * the default MSDU queues for one of the TIDs within the specified peer
  8091. * to the specified service class.
  8092. * The TID is indirectly specified - each service class is associated
  8093. * with a TID. All default MSDU queues for this peer-TID will be
  8094. * linked to the service class in question.
  8095. *
  8096. * |31 16|15 8|7 0|
  8097. * |------------------------------+--------------+--------------|
  8098. * | peer ID | svc class ID | msg type |
  8099. * |------------------------------------------------------------|
  8100. * Header fields:
  8101. * dword0 - b'7:0 - msg_type: This will be set to
  8102. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8103. * b'15:8 - service class ID
  8104. * b'31:16 - peer ID
  8105. */
  8106. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8107. A_UINT32 msg_type :8,
  8108. svc_class_id :8,
  8109. peer_id :16;
  8110. } POSTPACK;
  8111. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8112. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8113. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8114. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8115. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8116. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8117. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8118. do { \
  8119. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8120. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8121. } while (0)
  8122. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8123. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8124. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8125. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8126. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8127. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8128. do { \
  8129. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8130. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8131. } while (0)
  8132. /*
  8133. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8134. *
  8135. * @details
  8136. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8137. * remove the linkage of the specified peer-TID's MSDU queues to
  8138. * service classes.
  8139. *
  8140. * |31 16|15 12|11 8|7 0|
  8141. * |------------------------------+------+-------+--------------|
  8142. * | peer ID | rsvd | TID | msg type |
  8143. * |------------------------------------------------------------|
  8144. * Header fields:
  8145. * dword0 - b'7:0 - msg_type: This will be set to
  8146. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8147. * b'11:8 - TID
  8148. * dword1 - b'31:16 - peer ID
  8149. */
  8150. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8151. A_UINT32 msg_type :8,
  8152. tid :4,
  8153. reserved :4,
  8154. peer_id :16;
  8155. } POSTPACK;
  8156. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8157. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M 0x00000F00
  8158. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S 8
  8159. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_GET(_var) \
  8160. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M) >> \
  8161. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S)
  8162. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_TID_SET(_var, _val) \
  8163. do { \
  8164. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID, _val); \
  8165. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S));\
  8166. } while (0)
  8167. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8168. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8169. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  8170. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8171. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8172. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  8173. do { \
  8174. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8175. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8176. } while (0)
  8177. /*
  8178. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8179. *
  8180. * @details
  8181. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8182. * request the target to report what service class the default MSDU queues
  8183. * of the specified peer-TID are linked to.
  8184. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8185. * to report what service class (if any) the peer-TID's default MSDU queues
  8186. * are linked to.
  8187. *
  8188. * |31 16|15 12|11 8|7 0|
  8189. * |------------------------------+------+-------+--------------|
  8190. * | peer ID | rsvd | TID | msg type |
  8191. * |------------------------------------------------------------|
  8192. * Header fields:
  8193. * dword0 - b'7:0 - msg_type: This will be set to
  8194. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8195. * b'11:8 - TID
  8196. * dword1 - b'31:16 - peer ID
  8197. */
  8198. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8199. A_UINT32 msg_type :8,
  8200. tid :4,
  8201. reserved :4,
  8202. peer_id :16;
  8203. } POSTPACK;
  8204. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  8205. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M 0x00000F00
  8206. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S 8
  8207. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_GET(_var) \
  8208. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M) >> \
  8209. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S)
  8210. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_SET(_var, _val) \
  8211. do { \
  8212. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID, _val); \
  8213. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S));\
  8214. } while (0)
  8215. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8216. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8217. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  8218. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8219. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8220. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  8221. do { \
  8222. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8223. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8224. } while (0)
  8225. /*=== target -> host messages ===============================================*/
  8226. enum htt_t2h_msg_type {
  8227. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8228. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8229. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8230. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8231. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8232. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8233. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8234. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8235. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8236. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8237. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8238. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8239. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8240. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8241. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8242. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8243. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8244. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8245. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8246. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8247. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8248. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8249. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8250. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8251. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8252. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8253. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8254. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8255. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8256. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8257. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8258. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8259. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8260. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8261. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8262. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8263. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8264. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8265. /* TX_OFFLOAD_DELIVER_IND:
  8266. * Forward the target's locally-generated packets to the host,
  8267. * to provide to the monitor mode interface.
  8268. */
  8269. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8270. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8271. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8272. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8273. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8274. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8275. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8276. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8277. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8278. HTT_T2H_MSG_TYPE_TEST,
  8279. /* keep this last */
  8280. HTT_T2H_NUM_MSGS
  8281. };
  8282. /*
  8283. * HTT target to host message type -
  8284. * stored in bits 7:0 of the first word of the message
  8285. */
  8286. #define HTT_T2H_MSG_TYPE_M 0xff
  8287. #define HTT_T2H_MSG_TYPE_S 0
  8288. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8289. do { \
  8290. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8291. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8292. } while (0)
  8293. #define HTT_T2H_MSG_TYPE_GET(word) \
  8294. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8295. /**
  8296. * @brief target -> host version number confirmation message definition
  8297. *
  8298. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8299. *
  8300. * |31 24|23 16|15 8|7 0|
  8301. * |----------------+----------------+----------------+----------------|
  8302. * | reserved | major number | minor number | msg type |
  8303. * |-------------------------------------------------------------------|
  8304. * : option request TLV (optional) |
  8305. * :...................................................................:
  8306. *
  8307. * The VER_CONF message may consist of a single 4-byte word, or may be
  8308. * extended with TLVs that specify HTT options selected by the target.
  8309. * The following option TLVs may be appended to the VER_CONF message:
  8310. * - LL_BUS_ADDR_SIZE
  8311. * - HL_SUPPRESS_TX_COMPL_IND
  8312. * - MAX_TX_QUEUE_GROUPS
  8313. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8314. * may be appended to the VER_CONF message (but only one TLV of each type).
  8315. *
  8316. * Header fields:
  8317. * - MSG_TYPE
  8318. * Bits 7:0
  8319. * Purpose: identifies this as a version number confirmation message
  8320. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8321. * - VER_MINOR
  8322. * Bits 15:8
  8323. * Purpose: Specify the minor number of the HTT message library version
  8324. * in use by the target firmware.
  8325. * The minor number specifies the specific revision within a range
  8326. * of fundamentally compatible HTT message definition revisions.
  8327. * Compatible revisions involve adding new messages or perhaps
  8328. * adding new fields to existing messages, in a backwards-compatible
  8329. * manner.
  8330. * Incompatible revisions involve changing the message type values,
  8331. * or redefining existing messages.
  8332. * Value: minor number
  8333. * - VER_MAJOR
  8334. * Bits 15:8
  8335. * Purpose: Specify the major number of the HTT message library version
  8336. * in use by the target firmware.
  8337. * The major number specifies the family of minor revisions that are
  8338. * fundamentally compatible with each other, but not with prior or
  8339. * later families.
  8340. * Value: major number
  8341. */
  8342. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8343. #define HTT_VER_CONF_MINOR_S 8
  8344. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8345. #define HTT_VER_CONF_MAJOR_S 16
  8346. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8347. do { \
  8348. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8349. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8350. } while (0)
  8351. #define HTT_VER_CONF_MINOR_GET(word) \
  8352. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8353. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8354. do { \
  8355. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8356. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8357. } while (0)
  8358. #define HTT_VER_CONF_MAJOR_GET(word) \
  8359. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8360. #define HTT_VER_CONF_BYTES 4
  8361. /**
  8362. * @brief - target -> host HTT Rx In order indication message
  8363. *
  8364. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8365. *
  8366. * @details
  8367. *
  8368. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8369. * |----------------+-------------------+---------------------+---------------|
  8370. * | peer ID | P| F| O| ext TID | msg type |
  8371. * |--------------------------------------------------------------------------|
  8372. * | MSDU count | Reserved | vdev id |
  8373. * |--------------------------------------------------------------------------|
  8374. * | MSDU 0 bus address (bits 31:0) |
  8375. #if HTT_PADDR64
  8376. * | MSDU 0 bus address (bits 63:32) |
  8377. #endif
  8378. * |--------------------------------------------------------------------------|
  8379. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8380. * |--------------------------------------------------------------------------|
  8381. * | MSDU 1 bus address (bits 31:0) |
  8382. #if HTT_PADDR64
  8383. * | MSDU 1 bus address (bits 63:32) |
  8384. #endif
  8385. * |--------------------------------------------------------------------------|
  8386. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8387. * |--------------------------------------------------------------------------|
  8388. */
  8389. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8390. *
  8391. * @details
  8392. * bits
  8393. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8394. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8395. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8396. * | | frag | | | | fail |chksum fail|
  8397. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8398. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8399. */
  8400. struct htt_rx_in_ord_paddr_ind_hdr_t
  8401. {
  8402. A_UINT32 /* word 0 */
  8403. msg_type: 8,
  8404. ext_tid: 5,
  8405. offload: 1,
  8406. frag: 1,
  8407. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8408. peer_id: 16;
  8409. A_UINT32 /* word 1 */
  8410. vap_id: 8,
  8411. /* NOTE:
  8412. * This reserved_1 field is not truly reserved - certain targets use
  8413. * this field internally to store debug information, and do not zero
  8414. * out the contents of the field before uploading the message to the
  8415. * host. Thus, any host-target communication supported by this field
  8416. * is limited to using values that are never used by the debug
  8417. * information stored by certain targets in the reserved_1 field.
  8418. * In particular, the targets in question don't use the value 0x3
  8419. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8420. * so this previously-unused value within these bits is available to
  8421. * use as the host / target PKT_CAPTURE_MODE flag.
  8422. */
  8423. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8424. /* if pkt_capture_mode == 0x3, host should
  8425. * send rx frames to monitor mode interface
  8426. */
  8427. msdu_cnt: 16;
  8428. };
  8429. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8430. {
  8431. A_UINT32 dma_addr;
  8432. A_UINT32
  8433. length: 16,
  8434. fw_desc: 8,
  8435. msdu_info:8;
  8436. };
  8437. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8438. {
  8439. A_UINT32 dma_addr_lo;
  8440. A_UINT32 dma_addr_hi;
  8441. A_UINT32
  8442. length: 16,
  8443. fw_desc: 8,
  8444. msdu_info:8;
  8445. };
  8446. #if HTT_PADDR64
  8447. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8448. #else
  8449. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8450. #endif
  8451. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8452. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8453. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8454. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8455. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8456. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8457. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8458. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8459. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8460. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8461. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8462. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8463. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8464. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8465. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8466. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8467. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8468. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8469. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8470. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8471. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8472. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8473. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8474. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8475. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8476. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8477. /* for systems using 64-bit format for bus addresses */
  8478. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8479. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8480. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8481. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8482. /* for systems using 32-bit format for bus addresses */
  8483. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8484. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8485. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8486. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8487. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8488. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8489. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8490. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8491. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8492. do { \
  8493. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8494. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8495. } while (0)
  8496. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8497. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8498. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8499. do { \
  8500. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8501. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8502. } while (0)
  8503. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8504. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8505. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8506. do { \
  8507. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8508. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8509. } while (0)
  8510. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8511. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8512. /*
  8513. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8514. * deliver the rx frames to the monitor mode interface.
  8515. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8516. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8517. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8518. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8519. */
  8520. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8521. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8522. do { \
  8523. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8524. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8525. } while (0)
  8526. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8527. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8528. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8529. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8530. do { \
  8531. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8532. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8533. } while (0)
  8534. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8535. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8536. /* for systems using 64-bit format for bus addresses */
  8537. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8538. do { \
  8539. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8540. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8541. } while (0)
  8542. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8543. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8544. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8545. do { \
  8546. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8547. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8548. } while (0)
  8549. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8550. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8551. /* for systems using 32-bit format for bus addresses */
  8552. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8553. do { \
  8554. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8555. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8556. } while (0)
  8557. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8558. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8559. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8560. do { \
  8561. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8562. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8563. } while (0)
  8564. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8565. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8566. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8567. do { \
  8568. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8569. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8570. } while (0)
  8571. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8572. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8573. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8574. do { \
  8575. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8576. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8577. } while (0)
  8578. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8579. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8580. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8581. do { \
  8582. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8583. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8584. } while (0)
  8585. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8586. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8587. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8588. do { \
  8589. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8590. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8591. } while (0)
  8592. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8593. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8594. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8595. do { \
  8596. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8597. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8598. } while (0)
  8599. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8600. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8601. /* definitions used within target -> host rx indication message */
  8602. PREPACK struct htt_rx_ind_hdr_prefix_t
  8603. {
  8604. A_UINT32 /* word 0 */
  8605. msg_type: 8,
  8606. ext_tid: 5,
  8607. release_valid: 1,
  8608. flush_valid: 1,
  8609. reserved0: 1,
  8610. peer_id: 16;
  8611. A_UINT32 /* word 1 */
  8612. flush_start_seq_num: 6,
  8613. flush_end_seq_num: 6,
  8614. release_start_seq_num: 6,
  8615. release_end_seq_num: 6,
  8616. num_mpdu_ranges: 8;
  8617. } POSTPACK;
  8618. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8619. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8620. #define HTT_TGT_RSSI_INVALID 0x80
  8621. PREPACK struct htt_rx_ppdu_desc_t
  8622. {
  8623. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8624. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8625. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8626. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8627. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8628. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8629. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8630. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8631. A_UINT32 /* word 0 */
  8632. rssi_cmb: 8,
  8633. timestamp_submicrosec: 8,
  8634. phy_err_code: 8,
  8635. phy_err: 1,
  8636. legacy_rate: 4,
  8637. legacy_rate_sel: 1,
  8638. end_valid: 1,
  8639. start_valid: 1;
  8640. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8641. union {
  8642. A_UINT32 /* word 1 */
  8643. rssi0_pri20: 8,
  8644. rssi0_ext20: 8,
  8645. rssi0_ext40: 8,
  8646. rssi0_ext80: 8;
  8647. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8648. } u0;
  8649. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8650. union {
  8651. A_UINT32 /* word 2 */
  8652. rssi1_pri20: 8,
  8653. rssi1_ext20: 8,
  8654. rssi1_ext40: 8,
  8655. rssi1_ext80: 8;
  8656. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8657. } u1;
  8658. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8659. union {
  8660. A_UINT32 /* word 3 */
  8661. rssi2_pri20: 8,
  8662. rssi2_ext20: 8,
  8663. rssi2_ext40: 8,
  8664. rssi2_ext80: 8;
  8665. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8666. } u2;
  8667. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8668. union {
  8669. A_UINT32 /* word 4 */
  8670. rssi3_pri20: 8,
  8671. rssi3_ext20: 8,
  8672. rssi3_ext40: 8,
  8673. rssi3_ext80: 8;
  8674. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8675. } u3;
  8676. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8677. A_UINT32 tsf32; /* word 5 */
  8678. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8679. A_UINT32 timestamp_microsec; /* word 6 */
  8680. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8681. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8682. A_UINT32 /* word 7 */
  8683. vht_sig_a1: 24,
  8684. preamble_type: 8;
  8685. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8686. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8687. A_UINT32 /* word 8 */
  8688. vht_sig_a2: 24,
  8689. /* sa_ant_matrix
  8690. * For cases where a single rx chain has options to be connected to
  8691. * different rx antennas, show which rx antennas were in use during
  8692. * receipt of a given PPDU.
  8693. * This sa_ant_matrix provides a bitmask of the antennas used while
  8694. * receiving this frame.
  8695. */
  8696. sa_ant_matrix: 8;
  8697. } POSTPACK;
  8698. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8699. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8700. PREPACK struct htt_rx_ind_hdr_suffix_t
  8701. {
  8702. A_UINT32 /* word 0 */
  8703. fw_rx_desc_bytes: 16,
  8704. reserved0: 16;
  8705. } POSTPACK;
  8706. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8707. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8708. PREPACK struct htt_rx_ind_hdr_t
  8709. {
  8710. struct htt_rx_ind_hdr_prefix_t prefix;
  8711. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8712. struct htt_rx_ind_hdr_suffix_t suffix;
  8713. } POSTPACK;
  8714. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8715. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8716. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8717. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8718. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8719. /*
  8720. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8721. * the offset into the HTT rx indication message at which the
  8722. * FW rx PPDU descriptor resides
  8723. */
  8724. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8725. /*
  8726. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8727. * the offset into the HTT rx indication message at which the
  8728. * header suffix (FW rx MSDU byte count) resides
  8729. */
  8730. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8731. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8732. /*
  8733. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8734. * the offset into the HTT rx indication message at which the per-MSDU
  8735. * information starts
  8736. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8737. * per-MSDU information portion of the message. The per-MSDU info itself
  8738. * starts at byte 12.
  8739. */
  8740. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8741. /**
  8742. * @brief target -> host rx indication message definition
  8743. *
  8744. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8745. *
  8746. * @details
  8747. * The following field definitions describe the format of the rx indication
  8748. * message sent from the target to the host.
  8749. * The message consists of three major sections:
  8750. * 1. a fixed-length header
  8751. * 2. a variable-length list of firmware rx MSDU descriptors
  8752. * 3. one or more 4-octet MPDU range information elements
  8753. * The fixed length header itself has two sub-sections
  8754. * 1. the message meta-information, including identification of the
  8755. * sender and type of the received data, and a 4-octet flush/release IE
  8756. * 2. the firmware rx PPDU descriptor
  8757. *
  8758. * The format of the message is depicted below.
  8759. * in this depiction, the following abbreviations are used for information
  8760. * elements within the message:
  8761. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8762. * elements associated with the PPDU start are valid.
  8763. * Specifically, the following fields are valid only if SV is set:
  8764. * RSSI (all variants), L, legacy rate, preamble type, service,
  8765. * VHT-SIG-A
  8766. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8767. * elements associated with the PPDU end are valid.
  8768. * Specifically, the following fields are valid only if EV is set:
  8769. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8770. * - L - Legacy rate selector - if legacy rates are used, this flag
  8771. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8772. * (L == 0) PHY.
  8773. * - P - PHY error flag - boolean indication of whether the rx frame had
  8774. * a PHY error
  8775. *
  8776. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8777. * |----------------+-------------------+---------------------+---------------|
  8778. * | peer ID | |RV|FV| ext TID | msg type |
  8779. * |--------------------------------------------------------------------------|
  8780. * | num | release | release | flush | flush |
  8781. * | MPDU | end | start | end | start |
  8782. * | ranges | seq num | seq num | seq num | seq num |
  8783. * |==========================================================================|
  8784. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8785. * |V|V| | rate | | | timestamp | RSSI |
  8786. * |--------------------------------------------------------------------------|
  8787. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8788. * |--------------------------------------------------------------------------|
  8789. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8790. * |--------------------------------------------------------------------------|
  8791. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8792. * |--------------------------------------------------------------------------|
  8793. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8794. * |--------------------------------------------------------------------------|
  8795. * | TSF LSBs |
  8796. * |--------------------------------------------------------------------------|
  8797. * | microsec timestamp |
  8798. * |--------------------------------------------------------------------------|
  8799. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8800. * |--------------------------------------------------------------------------|
  8801. * | service | HT-SIG / VHT-SIG-A2 |
  8802. * |==========================================================================|
  8803. * | reserved | FW rx desc bytes |
  8804. * |--------------------------------------------------------------------------|
  8805. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8806. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8807. * |--------------------------------------------------------------------------|
  8808. * : : :
  8809. * |--------------------------------------------------------------------------|
  8810. * | alignment | MSDU Rx |
  8811. * | padding | desc Bn |
  8812. * |--------------------------------------------------------------------------|
  8813. * | reserved | MPDU range status | MPDU count |
  8814. * |--------------------------------------------------------------------------|
  8815. * : reserved : MPDU range status : MPDU count :
  8816. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8817. *
  8818. * Header fields:
  8819. * - MSG_TYPE
  8820. * Bits 7:0
  8821. * Purpose: identifies this as an rx indication message
  8822. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8823. * - EXT_TID
  8824. * Bits 12:8
  8825. * Purpose: identify the traffic ID of the rx data, including
  8826. * special "extended" TID values for multicast, broadcast, and
  8827. * non-QoS data frames
  8828. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8829. * - FLUSH_VALID (FV)
  8830. * Bit 13
  8831. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8832. * is valid
  8833. * Value:
  8834. * 1 -> flush IE is valid and needs to be processed
  8835. * 0 -> flush IE is not valid and should be ignored
  8836. * - REL_VALID (RV)
  8837. * Bit 13
  8838. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8839. * is valid
  8840. * Value:
  8841. * 1 -> release IE is valid and needs to be processed
  8842. * 0 -> release IE is not valid and should be ignored
  8843. * - PEER_ID
  8844. * Bits 31:16
  8845. * Purpose: Identify, by ID, which peer sent the rx data
  8846. * Value: ID of the peer who sent the rx data
  8847. * - FLUSH_SEQ_NUM_START
  8848. * Bits 5:0
  8849. * Purpose: Indicate the start of a series of MPDUs to flush
  8850. * Not all MPDUs within this series are necessarily valid - the host
  8851. * must check each sequence number within this range to see if the
  8852. * corresponding MPDU is actually present.
  8853. * This field is only valid if the FV bit is set.
  8854. * Value:
  8855. * The sequence number for the first MPDUs to check to flush.
  8856. * The sequence number is masked by 0x3f.
  8857. * - FLUSH_SEQ_NUM_END
  8858. * Bits 11:6
  8859. * Purpose: Indicate the end of a series of MPDUs to flush
  8860. * Value:
  8861. * The sequence number one larger than the sequence number of the
  8862. * last MPDU to check to flush.
  8863. * The sequence number is masked by 0x3f.
  8864. * Not all MPDUs within this series are necessarily valid - the host
  8865. * must check each sequence number within this range to see if the
  8866. * corresponding MPDU is actually present.
  8867. * This field is only valid if the FV bit is set.
  8868. * - REL_SEQ_NUM_START
  8869. * Bits 17:12
  8870. * Purpose: Indicate the start of a series of MPDUs to release.
  8871. * All MPDUs within this series are present and valid - the host
  8872. * need not check each sequence number within this range to see if
  8873. * the corresponding MPDU is actually present.
  8874. * This field is only valid if the RV bit is set.
  8875. * Value:
  8876. * The sequence number for the first MPDUs to check to release.
  8877. * The sequence number is masked by 0x3f.
  8878. * - REL_SEQ_NUM_END
  8879. * Bits 23:18
  8880. * Purpose: Indicate the end of a series of MPDUs to release.
  8881. * Value:
  8882. * The sequence number one larger than the sequence number of the
  8883. * last MPDU to check to release.
  8884. * The sequence number is masked by 0x3f.
  8885. * All MPDUs within this series are present and valid - the host
  8886. * need not check each sequence number within this range to see if
  8887. * the corresponding MPDU is actually present.
  8888. * This field is only valid if the RV bit is set.
  8889. * - NUM_MPDU_RANGES
  8890. * Bits 31:24
  8891. * Purpose: Indicate how many ranges of MPDUs are present.
  8892. * Each MPDU range consists of a series of contiguous MPDUs within the
  8893. * rx frame sequence which all have the same MPDU status.
  8894. * Value: 1-63 (typically a small number, like 1-3)
  8895. *
  8896. * Rx PPDU descriptor fields:
  8897. * - RSSI_CMB
  8898. * Bits 7:0
  8899. * Purpose: Combined RSSI from all active rx chains, across the active
  8900. * bandwidth.
  8901. * Value: RSSI dB units w.r.t. noise floor
  8902. * - TIMESTAMP_SUBMICROSEC
  8903. * Bits 15:8
  8904. * Purpose: high-resolution timestamp
  8905. * Value:
  8906. * Sub-microsecond time of PPDU reception.
  8907. * This timestamp ranges from [0,MAC clock MHz).
  8908. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8909. * to form a high-resolution, large range rx timestamp.
  8910. * - PHY_ERR_CODE
  8911. * Bits 23:16
  8912. * Purpose:
  8913. * If the rx frame processing resulted in a PHY error, indicate what
  8914. * type of rx PHY error occurred.
  8915. * Value:
  8916. * This field is valid if the "P" (PHY_ERR) flag is set.
  8917. * TBD: document/specify the values for this field
  8918. * - PHY_ERR
  8919. * Bit 24
  8920. * Purpose: indicate whether the rx PPDU had a PHY error
  8921. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8922. * - LEGACY_RATE
  8923. * Bits 28:25
  8924. * Purpose:
  8925. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8926. * specify which rate was used.
  8927. * Value:
  8928. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8929. * flag.
  8930. * If LEGACY_RATE_SEL is 0:
  8931. * 0x8: OFDM 48 Mbps
  8932. * 0x9: OFDM 24 Mbps
  8933. * 0xA: OFDM 12 Mbps
  8934. * 0xB: OFDM 6 Mbps
  8935. * 0xC: OFDM 54 Mbps
  8936. * 0xD: OFDM 36 Mbps
  8937. * 0xE: OFDM 18 Mbps
  8938. * 0xF: OFDM 9 Mbps
  8939. * If LEGACY_RATE_SEL is 1:
  8940. * 0x8: CCK 11 Mbps long preamble
  8941. * 0x9: CCK 5.5 Mbps long preamble
  8942. * 0xA: CCK 2 Mbps long preamble
  8943. * 0xB: CCK 1 Mbps long preamble
  8944. * 0xC: CCK 11 Mbps short preamble
  8945. * 0xD: CCK 5.5 Mbps short preamble
  8946. * 0xE: CCK 2 Mbps short preamble
  8947. * - LEGACY_RATE_SEL
  8948. * Bit 29
  8949. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8950. * Value:
  8951. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8952. * used a legacy rate.
  8953. * 0 -> OFDM, 1 -> CCK
  8954. * - END_VALID
  8955. * Bit 30
  8956. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8957. * the start of the PPDU are valid. Specifically, the following
  8958. * fields are only valid if END_VALID is set:
  8959. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8960. * TIMESTAMP_SUBMICROSEC
  8961. * Value:
  8962. * 0 -> rx PPDU desc end fields are not valid
  8963. * 1 -> rx PPDU desc end fields are valid
  8964. * - START_VALID
  8965. * Bit 31
  8966. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8967. * the end of the PPDU are valid. Specifically, the following
  8968. * fields are only valid if START_VALID is set:
  8969. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8970. * VHT-SIG-A
  8971. * Value:
  8972. * 0 -> rx PPDU desc start fields are not valid
  8973. * 1 -> rx PPDU desc start fields are valid
  8974. * - RSSI0_PRI20
  8975. * Bits 7:0
  8976. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8977. * Value: RSSI dB units w.r.t. noise floor
  8978. *
  8979. * - RSSI0_EXT20
  8980. * Bits 7:0
  8981. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8982. * (if the rx bandwidth was >= 40 MHz)
  8983. * Value: RSSI dB units w.r.t. noise floor
  8984. * - RSSI0_EXT40
  8985. * Bits 7:0
  8986. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8987. * (if the rx bandwidth was >= 80 MHz)
  8988. * Value: RSSI dB units w.r.t. noise floor
  8989. * - RSSI0_EXT80
  8990. * Bits 7:0
  8991. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8992. * (if the rx bandwidth was >= 160 MHz)
  8993. * Value: RSSI dB units w.r.t. noise floor
  8994. *
  8995. * - RSSI1_PRI20
  8996. * Bits 7:0
  8997. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8998. * Value: RSSI dB units w.r.t. noise floor
  8999. * - RSSI1_EXT20
  9000. * Bits 7:0
  9001. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9002. * (if the rx bandwidth was >= 40 MHz)
  9003. * Value: RSSI dB units w.r.t. noise floor
  9004. * - RSSI1_EXT40
  9005. * Bits 7:0
  9006. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9007. * (if the rx bandwidth was >= 80 MHz)
  9008. * Value: RSSI dB units w.r.t. noise floor
  9009. * - RSSI1_EXT80
  9010. * Bits 7:0
  9011. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9012. * (if the rx bandwidth was >= 160 MHz)
  9013. * Value: RSSI dB units w.r.t. noise floor
  9014. *
  9015. * - RSSI2_PRI20
  9016. * Bits 7:0
  9017. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9018. * Value: RSSI dB units w.r.t. noise floor
  9019. * - RSSI2_EXT20
  9020. * Bits 7:0
  9021. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9022. * (if the rx bandwidth was >= 40 MHz)
  9023. * Value: RSSI dB units w.r.t. noise floor
  9024. * - RSSI2_EXT40
  9025. * Bits 7:0
  9026. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9027. * (if the rx bandwidth was >= 80 MHz)
  9028. * Value: RSSI dB units w.r.t. noise floor
  9029. * - RSSI2_EXT80
  9030. * Bits 7:0
  9031. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9032. * (if the rx bandwidth was >= 160 MHz)
  9033. * Value: RSSI dB units w.r.t. noise floor
  9034. *
  9035. * - RSSI3_PRI20
  9036. * Bits 7:0
  9037. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9038. * Value: RSSI dB units w.r.t. noise floor
  9039. * - RSSI3_EXT20
  9040. * Bits 7:0
  9041. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9042. * (if the rx bandwidth was >= 40 MHz)
  9043. * Value: RSSI dB units w.r.t. noise floor
  9044. * - RSSI3_EXT40
  9045. * Bits 7:0
  9046. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9047. * (if the rx bandwidth was >= 80 MHz)
  9048. * Value: RSSI dB units w.r.t. noise floor
  9049. * - RSSI3_EXT80
  9050. * Bits 7:0
  9051. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9052. * (if the rx bandwidth was >= 160 MHz)
  9053. * Value: RSSI dB units w.r.t. noise floor
  9054. *
  9055. * - TSF32
  9056. * Bits 31:0
  9057. * Purpose: specify the time the rx PPDU was received, in TSF units
  9058. * Value: 32 LSBs of the TSF
  9059. * - TIMESTAMP_MICROSEC
  9060. * Bits 31:0
  9061. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9062. * Value: PPDU rx time, in microseconds
  9063. * - VHT_SIG_A1
  9064. * Bits 23:0
  9065. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9066. * from the rx PPDU
  9067. * Value:
  9068. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9069. * VHT-SIG-A1 data.
  9070. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9071. * first 24 bits of the HT-SIG data.
  9072. * Otherwise, this field is invalid.
  9073. * Refer to the the 802.11 protocol for the definition of the
  9074. * HT-SIG and VHT-SIG-A1 fields
  9075. * - VHT_SIG_A2
  9076. * Bits 23:0
  9077. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9078. * from the rx PPDU
  9079. * Value:
  9080. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9081. * VHT-SIG-A2 data.
  9082. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9083. * last 24 bits of the HT-SIG data.
  9084. * Otherwise, this field is invalid.
  9085. * Refer to the the 802.11 protocol for the definition of the
  9086. * HT-SIG and VHT-SIG-A2 fields
  9087. * - PREAMBLE_TYPE
  9088. * Bits 31:24
  9089. * Purpose: indicate the PHY format of the received burst
  9090. * Value:
  9091. * 0x4: Legacy (OFDM/CCK)
  9092. * 0x8: HT
  9093. * 0x9: HT with TxBF
  9094. * 0xC: VHT
  9095. * 0xD: VHT with TxBF
  9096. * - SERVICE
  9097. * Bits 31:24
  9098. * Purpose: TBD
  9099. * Value: TBD
  9100. *
  9101. * Rx MSDU descriptor fields:
  9102. * - FW_RX_DESC_BYTES
  9103. * Bits 15:0
  9104. * Purpose: Indicate how many bytes in the Rx indication are used for
  9105. * FW Rx descriptors
  9106. *
  9107. * Payload fields:
  9108. * - MPDU_COUNT
  9109. * Bits 7:0
  9110. * Purpose: Indicate how many sequential MPDUs share the same status.
  9111. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9112. * - MPDU_STATUS
  9113. * Bits 15:8
  9114. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9115. * received successfully.
  9116. * Value:
  9117. * 0x1: success
  9118. * 0x2: FCS error
  9119. * 0x3: duplicate error
  9120. * 0x4: replay error
  9121. * 0x5: invalid peer
  9122. */
  9123. /* header fields */
  9124. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9125. #define HTT_RX_IND_EXT_TID_S 8
  9126. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9127. #define HTT_RX_IND_FLUSH_VALID_S 13
  9128. #define HTT_RX_IND_REL_VALID_M 0x4000
  9129. #define HTT_RX_IND_REL_VALID_S 14
  9130. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9131. #define HTT_RX_IND_PEER_ID_S 16
  9132. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9133. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9134. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9135. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9136. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9137. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9138. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9139. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9140. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9141. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9142. /* rx PPDU descriptor fields */
  9143. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9144. #define HTT_RX_IND_RSSI_CMB_S 0
  9145. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9146. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9147. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9148. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9149. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9150. #define HTT_RX_IND_PHY_ERR_S 24
  9151. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9152. #define HTT_RX_IND_LEGACY_RATE_S 25
  9153. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9154. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9155. #define HTT_RX_IND_END_VALID_M 0x40000000
  9156. #define HTT_RX_IND_END_VALID_S 30
  9157. #define HTT_RX_IND_START_VALID_M 0x80000000
  9158. #define HTT_RX_IND_START_VALID_S 31
  9159. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9160. #define HTT_RX_IND_RSSI_PRI20_S 0
  9161. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9162. #define HTT_RX_IND_RSSI_EXT20_S 8
  9163. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9164. #define HTT_RX_IND_RSSI_EXT40_S 16
  9165. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9166. #define HTT_RX_IND_RSSI_EXT80_S 24
  9167. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9168. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9169. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9170. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9171. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9172. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9173. #define HTT_RX_IND_SERVICE_M 0xff000000
  9174. #define HTT_RX_IND_SERVICE_S 24
  9175. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9176. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9177. /* rx MSDU descriptor fields */
  9178. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9179. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9180. /* payload fields */
  9181. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9182. #define HTT_RX_IND_MPDU_COUNT_S 0
  9183. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9184. #define HTT_RX_IND_MPDU_STATUS_S 8
  9185. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9186. do { \
  9187. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9188. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9189. } while (0)
  9190. #define HTT_RX_IND_EXT_TID_GET(word) \
  9191. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9192. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9193. do { \
  9194. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9195. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9196. } while (0)
  9197. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9198. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9199. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9200. do { \
  9201. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9202. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9203. } while (0)
  9204. #define HTT_RX_IND_REL_VALID_GET(word) \
  9205. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9206. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9207. do { \
  9208. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9209. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9210. } while (0)
  9211. #define HTT_RX_IND_PEER_ID_GET(word) \
  9212. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9213. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9214. do { \
  9215. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9216. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9217. } while (0)
  9218. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9219. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9220. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9223. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9224. } while (0)
  9225. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9226. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9227. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9228. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9231. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9232. } while (0)
  9233. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9234. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9235. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9236. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9237. do { \
  9238. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9239. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9240. } while (0)
  9241. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9242. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9243. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9244. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9245. do { \
  9246. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9247. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9248. } while (0)
  9249. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9250. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9251. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9252. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9253. do { \
  9254. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9255. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9256. } while (0)
  9257. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9258. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9259. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9260. /* FW rx PPDU descriptor fields */
  9261. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9262. do { \
  9263. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9264. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9265. } while (0)
  9266. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9267. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9268. HTT_RX_IND_RSSI_CMB_S)
  9269. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9270. do { \
  9271. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9272. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9273. } while (0)
  9274. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9275. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9276. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9277. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9278. do { \
  9279. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9280. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9281. } while (0)
  9282. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9283. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9284. HTT_RX_IND_PHY_ERR_CODE_S)
  9285. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9286. do { \
  9287. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9288. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9289. } while (0)
  9290. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9291. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9292. HTT_RX_IND_PHY_ERR_S)
  9293. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9294. do { \
  9295. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9296. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9297. } while (0)
  9298. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9299. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9300. HTT_RX_IND_LEGACY_RATE_S)
  9301. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9302. do { \
  9303. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9304. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9305. } while (0)
  9306. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9307. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9308. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9309. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9310. do { \
  9311. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9312. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9313. } while (0)
  9314. #define HTT_RX_IND_END_VALID_GET(word) \
  9315. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9316. HTT_RX_IND_END_VALID_S)
  9317. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9318. do { \
  9319. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9320. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9321. } while (0)
  9322. #define HTT_RX_IND_START_VALID_GET(word) \
  9323. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9324. HTT_RX_IND_START_VALID_S)
  9325. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9326. do { \
  9327. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9328. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9329. } while (0)
  9330. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9331. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9332. HTT_RX_IND_RSSI_PRI20_S)
  9333. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9334. do { \
  9335. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9336. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9337. } while (0)
  9338. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9339. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9340. HTT_RX_IND_RSSI_EXT20_S)
  9341. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9342. do { \
  9343. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9344. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9345. } while (0)
  9346. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9347. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9348. HTT_RX_IND_RSSI_EXT40_S)
  9349. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9350. do { \
  9351. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9352. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9353. } while (0)
  9354. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9355. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9356. HTT_RX_IND_RSSI_EXT80_S)
  9357. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9358. do { \
  9359. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9360. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9361. } while (0)
  9362. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9363. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9364. HTT_RX_IND_VHT_SIG_A1_S)
  9365. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9366. do { \
  9367. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9368. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9369. } while (0)
  9370. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9371. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9372. HTT_RX_IND_VHT_SIG_A2_S)
  9373. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9374. do { \
  9375. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9376. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9377. } while (0)
  9378. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9379. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9380. HTT_RX_IND_PREAMBLE_TYPE_S)
  9381. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9382. do { \
  9383. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9384. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9385. } while (0)
  9386. #define HTT_RX_IND_SERVICE_GET(word) \
  9387. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9388. HTT_RX_IND_SERVICE_S)
  9389. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9390. do { \
  9391. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9392. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9393. } while (0)
  9394. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9395. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9396. HTT_RX_IND_SA_ANT_MATRIX_S)
  9397. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9398. do { \
  9399. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9400. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9401. } while (0)
  9402. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9403. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9404. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9405. do { \
  9406. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9407. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9408. } while (0)
  9409. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9410. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9411. #define HTT_RX_IND_HL_BYTES \
  9412. (HTT_RX_IND_HDR_BYTES + \
  9413. 4 /* single FW rx MSDU descriptor */ + \
  9414. 4 /* single MPDU range information element */)
  9415. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9416. /* Could we use one macro entry? */
  9417. #define HTT_WORD_SET(word, field, value) \
  9418. do { \
  9419. HTT_CHECK_SET_VAL(field, value); \
  9420. (word) |= ((value) << field ## _S); \
  9421. } while (0)
  9422. #define HTT_WORD_GET(word, field) \
  9423. (((word) & field ## _M) >> field ## _S)
  9424. PREPACK struct hl_htt_rx_ind_base {
  9425. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9426. } POSTPACK;
  9427. /*
  9428. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9429. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9430. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9431. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9432. * htt_rx_ind_hl_rx_desc_t.
  9433. */
  9434. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9435. struct htt_rx_ind_hl_rx_desc_t {
  9436. A_UINT8 ver;
  9437. A_UINT8 len;
  9438. struct {
  9439. A_UINT8
  9440. first_msdu: 1,
  9441. last_msdu: 1,
  9442. c3_failed: 1,
  9443. c4_failed: 1,
  9444. ipv6: 1,
  9445. tcp: 1,
  9446. udp: 1,
  9447. reserved: 1;
  9448. } flags;
  9449. /* NOTE: no reserved space - don't append any new fields here */
  9450. };
  9451. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9452. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9453. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9454. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9455. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9456. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9457. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9458. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9459. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9460. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9461. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9462. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9463. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9464. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9465. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9466. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9467. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9468. /* This structure is used in HL, the basic descriptor information
  9469. * used by host. the structure is translated by FW from HW desc
  9470. * or generated by FW. But in HL monitor mode, the host would use
  9471. * the same structure with LL.
  9472. */
  9473. PREPACK struct hl_htt_rx_desc_base {
  9474. A_UINT32
  9475. seq_num:12,
  9476. encrypted:1,
  9477. chan_info_present:1,
  9478. resv0:2,
  9479. mcast_bcast:1,
  9480. fragment:1,
  9481. key_id_oct:8,
  9482. resv1:6;
  9483. A_UINT32
  9484. pn_31_0;
  9485. union {
  9486. struct {
  9487. A_UINT16 pn_47_32;
  9488. A_UINT16 pn_63_48;
  9489. } pn16;
  9490. A_UINT32 pn_63_32;
  9491. } u0;
  9492. A_UINT32
  9493. pn_95_64;
  9494. A_UINT32
  9495. pn_127_96;
  9496. } POSTPACK;
  9497. /*
  9498. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9499. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9500. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9501. * Please see htt_chan_change_t for description of the fields.
  9502. */
  9503. PREPACK struct htt_chan_info_t
  9504. {
  9505. A_UINT32 primary_chan_center_freq_mhz: 16,
  9506. contig_chan1_center_freq_mhz: 16;
  9507. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9508. phy_mode: 8,
  9509. reserved: 8;
  9510. } POSTPACK;
  9511. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9512. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9513. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9514. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9515. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9516. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9517. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9518. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9519. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9520. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9521. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9522. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9523. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9524. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9525. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9526. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9527. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9528. /* Channel information */
  9529. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9530. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9531. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9532. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9533. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9534. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9535. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9536. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9537. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9538. do { \
  9539. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9540. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9541. } while (0)
  9542. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9543. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9544. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9545. do { \
  9546. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9547. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9548. } while (0)
  9549. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9550. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9551. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9552. do { \
  9553. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9554. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9555. } while (0)
  9556. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9557. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9558. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9559. do { \
  9560. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9561. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9562. } while (0)
  9563. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9564. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9565. /*
  9566. * @brief target -> host message definition for FW offloaded pkts
  9567. *
  9568. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9569. *
  9570. * @details
  9571. * The following field definitions describe the format of the firmware
  9572. * offload deliver message sent from the target to the host.
  9573. *
  9574. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9575. *
  9576. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9577. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9578. * | reserved_1 | msg type |
  9579. * |--------------------------------------------------------------------------|
  9580. * | phy_timestamp_l32 |
  9581. * |--------------------------------------------------------------------------|
  9582. * | WORD2 (see below) |
  9583. * |--------------------------------------------------------------------------|
  9584. * | seqno | framectrl |
  9585. * |--------------------------------------------------------------------------|
  9586. * | reserved_3 | vdev_id | tid_num|
  9587. * |--------------------------------------------------------------------------|
  9588. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9589. * |--------------------------------------------------------------------------|
  9590. *
  9591. * where:
  9592. * STAT = status
  9593. * F = format (802.3 vs. 802.11)
  9594. *
  9595. * definition for word 2
  9596. *
  9597. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9598. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9599. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9600. * |--------------------------------------------------------------------------|
  9601. *
  9602. * where:
  9603. * PR = preamble
  9604. * BF = beamformed
  9605. */
  9606. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9607. {
  9608. A_UINT32 /* word 0 */
  9609. msg_type:8, /* [ 7: 0] */
  9610. reserved_1:24; /* [31: 8] */
  9611. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9612. A_UINT32 /* word 2 */
  9613. /* preamble:
  9614. * 0-OFDM,
  9615. * 1-CCk,
  9616. * 2-HT,
  9617. * 3-VHT
  9618. */
  9619. preamble: 2, /* [1:0] */
  9620. /* mcs:
  9621. * In case of HT preamble interpret
  9622. * MCS along with NSS.
  9623. * Valid values for HT are 0 to 7.
  9624. * HT mcs 0 with NSS 2 is mcs 8.
  9625. * Valid values for VHT are 0 to 9.
  9626. */
  9627. mcs: 4, /* [5:2] */
  9628. /* rate:
  9629. * This is applicable only for
  9630. * CCK and OFDM preamble type
  9631. * rate 0: OFDM 48 Mbps,
  9632. * 1: OFDM 24 Mbps,
  9633. * 2: OFDM 12 Mbps
  9634. * 3: OFDM 6 Mbps
  9635. * 4: OFDM 54 Mbps
  9636. * 5: OFDM 36 Mbps
  9637. * 6: OFDM 18 Mbps
  9638. * 7: OFDM 9 Mbps
  9639. * rate 0: CCK 11 Mbps Long
  9640. * 1: CCK 5.5 Mbps Long
  9641. * 2: CCK 2 Mbps Long
  9642. * 3: CCK 1 Mbps Long
  9643. * 4: CCK 11 Mbps Short
  9644. * 5: CCK 5.5 Mbps Short
  9645. * 6: CCK 2 Mbps Short
  9646. */
  9647. rate : 3, /* [ 8: 6] */
  9648. rssi : 8, /* [16: 9] units=dBm */
  9649. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9650. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9651. stbc : 1, /* [22] */
  9652. sgi : 1, /* [23] */
  9653. ldpc : 1, /* [24] */
  9654. beamformed: 1, /* [25] */
  9655. reserved_2: 6; /* [31:26] */
  9656. A_UINT32 /* word 3 */
  9657. framectrl:16, /* [15: 0] */
  9658. seqno:16; /* [31:16] */
  9659. A_UINT32 /* word 4 */
  9660. tid_num:5, /* [ 4: 0] actual TID number */
  9661. vdev_id:8, /* [12: 5] */
  9662. reserved_3:19; /* [31:13] */
  9663. A_UINT32 /* word 5 */
  9664. /* status:
  9665. * 0: tx_ok
  9666. * 1: retry
  9667. * 2: drop
  9668. * 3: filtered
  9669. * 4: abort
  9670. * 5: tid delete
  9671. * 6: sw abort
  9672. * 7: dropped by peer migration
  9673. */
  9674. status:3, /* [2:0] */
  9675. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9676. tx_mpdu_bytes:16, /* [19:4] */
  9677. /* Indicates retry count of offloaded/local generated Data tx frames */
  9678. tx_retry_cnt:6, /* [25:20] */
  9679. reserved_4:6; /* [31:26] */
  9680. } POSTPACK;
  9681. /* FW offload deliver ind message header fields */
  9682. /* DWORD one */
  9683. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9684. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9685. /* DWORD two */
  9686. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9687. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9688. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9689. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9690. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9691. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9692. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9693. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9694. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9695. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9696. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9697. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9698. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9699. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9700. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9701. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9702. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9703. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9704. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9705. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9706. /* DWORD three*/
  9707. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9708. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9709. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9710. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9711. /* DWORD four */
  9712. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9713. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9714. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9715. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9716. /* DWORD five */
  9717. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9718. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9719. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9720. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9721. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9722. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9723. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9724. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9725. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9726. do { \
  9727. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9728. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9729. } while (0)
  9730. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9731. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9732. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9733. do { \
  9734. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9735. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9736. } while (0)
  9737. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9738. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9739. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9740. do { \
  9741. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9742. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9743. } while (0)
  9744. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9745. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9746. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9747. do { \
  9748. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9749. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9750. } while (0)
  9751. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9752. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9753. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9754. do { \
  9755. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9756. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9757. } while (0)
  9758. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9759. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9760. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9761. do { \
  9762. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9763. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9764. } while (0)
  9765. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9766. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9767. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9768. do { \
  9769. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9770. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9771. } while (0)
  9772. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9773. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9774. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9775. do { \
  9776. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9777. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9778. } while (0)
  9779. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9780. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9781. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9784. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9785. } while (0)
  9786. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9787. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9788. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9789. do { \
  9790. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9791. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9792. } while (0)
  9793. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9794. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9795. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9796. do { \
  9797. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9798. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9799. } while (0)
  9800. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9801. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9802. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9803. do { \
  9804. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9805. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9806. } while (0)
  9807. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9808. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9809. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9810. do { \
  9811. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9812. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9813. } while (0)
  9814. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9815. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9816. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9817. do { \
  9818. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9819. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9820. } while (0)
  9821. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9822. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9823. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9826. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9827. } while (0)
  9828. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9829. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9830. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9833. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9834. } while (0)
  9835. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9836. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9837. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9838. do { \
  9839. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9840. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9841. } while (0)
  9842. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9843. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9844. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9845. do { \
  9846. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9847. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9848. } while (0)
  9849. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9850. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9851. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9852. do { \
  9853. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9854. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9855. } while (0)
  9856. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9857. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9858. /*
  9859. * @brief target -> host rx reorder flush message definition
  9860. *
  9861. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9862. *
  9863. * @details
  9864. * The following field definitions describe the format of the rx flush
  9865. * message sent from the target to the host.
  9866. * The message consists of a 4-octet header, followed by one or more
  9867. * 4-octet payload information elements.
  9868. *
  9869. * |31 24|23 8|7 0|
  9870. * |--------------------------------------------------------------|
  9871. * | TID | peer ID | msg type |
  9872. * |--------------------------------------------------------------|
  9873. * | seq num end | seq num start | MPDU status | reserved |
  9874. * |--------------------------------------------------------------|
  9875. * First DWORD:
  9876. * - MSG_TYPE
  9877. * Bits 7:0
  9878. * Purpose: identifies this as an rx flush message
  9879. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9880. * - PEER_ID
  9881. * Bits 23:8 (only bits 18:8 actually used)
  9882. * Purpose: identify which peer's rx data is being flushed
  9883. * Value: (rx) peer ID
  9884. * - TID
  9885. * Bits 31:24 (only bits 27:24 actually used)
  9886. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9887. * Value: traffic identifier
  9888. * Second DWORD:
  9889. * - MPDU_STATUS
  9890. * Bits 15:8
  9891. * Purpose:
  9892. * Indicate whether the flushed MPDUs should be discarded or processed.
  9893. * Value:
  9894. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9895. * stages of rx processing
  9896. * other: discard the MPDUs
  9897. * It is anticipated that flush messages will always have
  9898. * MPDU status == 1, but the status flag is included for
  9899. * flexibility.
  9900. * - SEQ_NUM_START
  9901. * Bits 23:16
  9902. * Purpose:
  9903. * Indicate the start of a series of consecutive MPDUs being flushed.
  9904. * Not all MPDUs within this range are necessarily valid - the host
  9905. * must check each sequence number within this range to see if the
  9906. * corresponding MPDU is actually present.
  9907. * Value:
  9908. * The sequence number for the first MPDU in the sequence.
  9909. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9910. * - SEQ_NUM_END
  9911. * Bits 30:24
  9912. * Purpose:
  9913. * Indicate the end of a series of consecutive MPDUs being flushed.
  9914. * Value:
  9915. * The sequence number one larger than the sequence number of the
  9916. * last MPDU being flushed.
  9917. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9918. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9919. * are to be released for further rx processing.
  9920. * Not all MPDUs within this range are necessarily valid - the host
  9921. * must check each sequence number within this range to see if the
  9922. * corresponding MPDU is actually present.
  9923. */
  9924. /* first DWORD */
  9925. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9926. #define HTT_RX_FLUSH_PEER_ID_S 8
  9927. #define HTT_RX_FLUSH_TID_M 0xff000000
  9928. #define HTT_RX_FLUSH_TID_S 24
  9929. /* second DWORD */
  9930. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9931. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9932. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9933. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9934. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9935. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9936. #define HTT_RX_FLUSH_BYTES 8
  9937. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9940. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9941. } while (0)
  9942. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9943. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9944. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9945. do { \
  9946. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9947. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9948. } while (0)
  9949. #define HTT_RX_FLUSH_TID_GET(word) \
  9950. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9951. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9952. do { \
  9953. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9954. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9955. } while (0)
  9956. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9957. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9958. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9959. do { \
  9960. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9961. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9962. } while (0)
  9963. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9964. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9965. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9966. do { \
  9967. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9968. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9969. } while (0)
  9970. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9971. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9972. /*
  9973. * @brief target -> host rx pn check indication message
  9974. *
  9975. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9976. *
  9977. * @details
  9978. * The following field definitions describe the format of the Rx PN check
  9979. * indication message sent from the target to the host.
  9980. * The message consists of a 4-octet header, followed by the start and
  9981. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9982. * IE is one octet containing the sequence number that failed the PN
  9983. * check.
  9984. *
  9985. * |31 24|23 8|7 0|
  9986. * |--------------------------------------------------------------|
  9987. * | TID | peer ID | msg type |
  9988. * |--------------------------------------------------------------|
  9989. * | Reserved | PN IE count | seq num end | seq num start|
  9990. * |--------------------------------------------------------------|
  9991. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9992. * |--------------------------------------------------------------|
  9993. * First DWORD:
  9994. * - MSG_TYPE
  9995. * Bits 7:0
  9996. * Purpose: Identifies this as an rx pn check indication message
  9997. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9998. * - PEER_ID
  9999. * Bits 23:8 (only bits 18:8 actually used)
  10000. * Purpose: identify which peer
  10001. * Value: (rx) peer ID
  10002. * - TID
  10003. * Bits 31:24 (only bits 27:24 actually used)
  10004. * Purpose: identify traffic identifier
  10005. * Value: traffic identifier
  10006. * Second DWORD:
  10007. * - SEQ_NUM_START
  10008. * Bits 7:0
  10009. * Purpose:
  10010. * Indicates the starting sequence number of the MPDU in this
  10011. * series of MPDUs that went though PN check.
  10012. * Value:
  10013. * The sequence number for the first MPDU in the sequence.
  10014. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10015. * - SEQ_NUM_END
  10016. * Bits 15:8
  10017. * Purpose:
  10018. * Indicates the ending sequence number of the MPDU in this
  10019. * series of MPDUs that went though PN check.
  10020. * Value:
  10021. * The sequence number one larger then the sequence number of the last
  10022. * MPDU being flushed.
  10023. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10024. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10025. * for invalid PN numbers and are ready to be released for further processing.
  10026. * Not all MPDUs within this range are necessarily valid - the host
  10027. * must check each sequence number within this range to see if the
  10028. * corresponding MPDU is actually present.
  10029. * - PN_IE_COUNT
  10030. * Bits 23:16
  10031. * Purpose:
  10032. * Used to determine the variable number of PN information elements in this
  10033. * message
  10034. *
  10035. * PN information elements:
  10036. * - PN_IE_x-
  10037. * Purpose:
  10038. * Each PN information element contains the sequence number of the MPDU that
  10039. * has failed the target PN check.
  10040. * Value:
  10041. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10042. * that failed the PN check.
  10043. */
  10044. /* first DWORD */
  10045. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10046. #define HTT_RX_PN_IND_PEER_ID_S 8
  10047. #define HTT_RX_PN_IND_TID_M 0xff000000
  10048. #define HTT_RX_PN_IND_TID_S 24
  10049. /* second DWORD */
  10050. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10051. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10052. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10053. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10054. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10055. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10056. #define HTT_RX_PN_IND_BYTES 8
  10057. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10058. do { \
  10059. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10060. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10061. } while (0)
  10062. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10063. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10064. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10065. do { \
  10066. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10067. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10068. } while (0)
  10069. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10070. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10071. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10072. do { \
  10073. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10074. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10075. } while (0)
  10076. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10077. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10078. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10079. do { \
  10080. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10081. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10082. } while (0)
  10083. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10084. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10085. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10086. do { \
  10087. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10088. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10089. } while (0)
  10090. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10091. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10092. /*
  10093. * @brief target -> host rx offload deliver message for LL system
  10094. *
  10095. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10096. *
  10097. * @details
  10098. * In a low latency system this message is sent whenever the offload
  10099. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10100. * The DMA of the actual packets into host memory is done before sending out
  10101. * this message. This message indicates only how many MSDUs to reap. The
  10102. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10103. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10104. * DMA'd by the MAC directly into host memory these packets do not contain
  10105. * the MAC descriptors in the header portion of the packet. Instead they contain
  10106. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10107. * message, the packets are delivered directly to the NW stack without going
  10108. * through the regular reorder buffering and PN checking path since it has
  10109. * already been done in target.
  10110. *
  10111. * |31 24|23 16|15 8|7 0|
  10112. * |-----------------------------------------------------------------------|
  10113. * | Total MSDU count | reserved | msg type |
  10114. * |-----------------------------------------------------------------------|
  10115. *
  10116. * @brief target -> host rx offload deliver message for HL system
  10117. *
  10118. * @details
  10119. * In a high latency system this message is sent whenever the offload manager
  10120. * flushes out the packets it has coalesced in its coalescing buffer. The
  10121. * actual packets are also carried along with this message. When the host
  10122. * receives this message, it is expected to deliver these packets to the NW
  10123. * stack directly instead of routing them through the reorder buffering and
  10124. * PN checking path since it has already been done in target.
  10125. *
  10126. * |31 24|23 16|15 8|7 0|
  10127. * |-----------------------------------------------------------------------|
  10128. * | Total MSDU count | reserved | msg type |
  10129. * |-----------------------------------------------------------------------|
  10130. * | peer ID | MSDU length |
  10131. * |-----------------------------------------------------------------------|
  10132. * | MSDU payload | FW Desc | tid | vdev ID |
  10133. * |-----------------------------------------------------------------------|
  10134. * | MSDU payload contd. |
  10135. * |-----------------------------------------------------------------------|
  10136. * | peer ID | MSDU length |
  10137. * |-----------------------------------------------------------------------|
  10138. * | MSDU payload | FW Desc | tid | vdev ID |
  10139. * |-----------------------------------------------------------------------|
  10140. * | MSDU payload contd. |
  10141. * |-----------------------------------------------------------------------|
  10142. *
  10143. */
  10144. /* first DWORD */
  10145. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10146. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10147. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10148. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10149. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10150. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10151. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10152. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10153. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10154. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10155. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10156. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10157. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10158. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10159. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10160. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10161. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10162. do { \
  10163. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10164. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10165. } while (0)
  10166. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10167. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10168. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10169. do { \
  10170. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10171. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10172. } while (0)
  10173. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10174. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10175. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10176. do { \
  10177. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10178. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10179. } while (0)
  10180. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10181. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10182. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10183. do { \
  10184. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10185. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10186. } while (0)
  10187. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10188. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10189. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10190. do { \
  10191. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10192. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10193. } while (0)
  10194. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10195. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10196. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10197. do { \
  10198. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10199. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10200. } while (0)
  10201. /**
  10202. * @brief target -> host rx peer map/unmap message definition
  10203. *
  10204. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10205. *
  10206. * @details
  10207. * The following diagram shows the format of the rx peer map message sent
  10208. * from the target to the host. This layout assumes the target operates
  10209. * as little-endian.
  10210. *
  10211. * This message always contains a SW peer ID. The main purpose of the
  10212. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10213. * with, so that the host can use that peer ID to determine which peer
  10214. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10215. * other purposes, such as identifying during tx completions which peer
  10216. * the tx frames in question were transmitted to.
  10217. *
  10218. * In certain generations of chips, the peer map message also contains
  10219. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10220. * to identify which peer the frame needs to be forwarded to (i.e. the
  10221. * peer assocated with the Destination MAC Address within the packet),
  10222. * and particularly which vdev needs to transmit the frame (for cases
  10223. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10224. * meaning as AST_INDEX_0.
  10225. * This DA-based peer ID that is provided for certain rx frames
  10226. * (the rx frames that need to be re-transmitted as tx frames)
  10227. * is the ID that the HW uses for referring to the peer in question,
  10228. * rather than the peer ID that the SW+FW use to refer to the peer.
  10229. *
  10230. *
  10231. * |31 24|23 16|15 8|7 0|
  10232. * |-----------------------------------------------------------------------|
  10233. * | SW peer ID | VDEV ID | msg type |
  10234. * |-----------------------------------------------------------------------|
  10235. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10236. * |-----------------------------------------------------------------------|
  10237. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10238. * |-----------------------------------------------------------------------|
  10239. *
  10240. *
  10241. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10242. *
  10243. * The following diagram shows the format of the rx peer unmap message sent
  10244. * from the target to the host.
  10245. *
  10246. * |31 24|23 16|15 8|7 0|
  10247. * |-----------------------------------------------------------------------|
  10248. * | SW peer ID | VDEV ID | msg type |
  10249. * |-----------------------------------------------------------------------|
  10250. *
  10251. * The following field definitions describe the format of the rx peer map
  10252. * and peer unmap messages sent from the target to the host.
  10253. * - MSG_TYPE
  10254. * Bits 7:0
  10255. * Purpose: identifies this as an rx peer map or peer unmap message
  10256. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10257. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10258. * - VDEV_ID
  10259. * Bits 15:8
  10260. * Purpose: Indicates which virtual device the peer is associated
  10261. * with.
  10262. * Value: vdev ID (used in the host to look up the vdev object)
  10263. * - PEER_ID (a.k.a. SW_PEER_ID)
  10264. * Bits 31:16
  10265. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10266. * freeing (unmap)
  10267. * Value: (rx) peer ID
  10268. * - MAC_ADDR_L32 (peer map only)
  10269. * Bits 31:0
  10270. * Purpose: Identifies which peer node the peer ID is for.
  10271. * Value: lower 4 bytes of peer node's MAC address
  10272. * - MAC_ADDR_U16 (peer map only)
  10273. * Bits 15:0
  10274. * Purpose: Identifies which peer node the peer ID is for.
  10275. * Value: upper 2 bytes of peer node's MAC address
  10276. * - HW_PEER_ID
  10277. * Bits 31:16
  10278. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10279. * address, so for rx frames marked for rx --> tx forwarding, the
  10280. * host can determine from the HW peer ID provided as meta-data with
  10281. * the rx frame which peer the frame is supposed to be forwarded to.
  10282. * Value: ID used by the MAC HW to identify the peer
  10283. */
  10284. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10285. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10286. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10287. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10288. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10289. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10290. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10291. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10292. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10293. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10294. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10295. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10296. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10297. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10298. do { \
  10299. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10300. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10301. } while (0)
  10302. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10303. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10304. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10305. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10306. do { \
  10307. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10308. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10309. } while (0)
  10310. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10311. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10312. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10313. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10314. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10315. do { \
  10316. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10317. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10318. } while (0)
  10319. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10320. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10321. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10322. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10323. #define HTT_RX_PEER_MAP_BYTES 12
  10324. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10325. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10326. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10327. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10328. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10329. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10330. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10331. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10332. #define HTT_RX_PEER_UNMAP_BYTES 4
  10333. /**
  10334. * @brief target -> host rx peer map V2 message definition
  10335. *
  10336. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10337. *
  10338. * @details
  10339. * The following diagram shows the format of the rx peer map v2 message sent
  10340. * from the target to the host. This layout assumes the target operates
  10341. * as little-endian.
  10342. *
  10343. * This message always contains a SW peer ID. The main purpose of the
  10344. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10345. * with, so that the host can use that peer ID to determine which peer
  10346. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10347. * other purposes, such as identifying during tx completions which peer
  10348. * the tx frames in question were transmitted to.
  10349. *
  10350. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10351. * is used during rx --> tx frame forwarding to identify which peer the
  10352. * frame needs to be forwarded to (i.e. the peer assocated with the
  10353. * Destination MAC Address within the packet), and particularly which vdev
  10354. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10355. * This DA-based peer ID that is provided for certain rx frames
  10356. * (the rx frames that need to be re-transmitted as tx frames)
  10357. * is the ID that the HW uses for referring to the peer in question,
  10358. * rather than the peer ID that the SW+FW use to refer to the peer.
  10359. *
  10360. * The HW peer id here is the same meaning as AST_INDEX_0.
  10361. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10362. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10363. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10364. * AST is valid.
  10365. *
  10366. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10367. * |-------------------------------------------------------------------------|
  10368. * | SW peer ID | VDEV ID | msg type |
  10369. * |-------------------------------------------------------------------------|
  10370. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10371. * |-------------------------------------------------------------------------|
  10372. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10373. * |-------------------------------------------------------------------------|
  10374. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10375. * |-------------------------------------------------------------------------|
  10376. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10377. * |-------------------------------------------------------------------------|
  10378. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10379. * |-------------------------------------------------------------------------|
  10380. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10381. * |-------------------------------------------------------------------------|
  10382. * | Reserved_2 |
  10383. * |-------------------------------------------------------------------------|
  10384. * Where:
  10385. * NH = Next Hop
  10386. * ASTVM = AST valid mask
  10387. * OA = on-chip AST valid bit
  10388. * ASTFM = AST flow mask
  10389. *
  10390. * The following field definitions describe the format of the rx peer map v2
  10391. * messages sent from the target to the host.
  10392. * - MSG_TYPE
  10393. * Bits 7:0
  10394. * Purpose: identifies this as an rx peer map v2 message
  10395. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10396. * - VDEV_ID
  10397. * Bits 15:8
  10398. * Purpose: Indicates which virtual device the peer is associated with.
  10399. * Value: vdev ID (used in the host to look up the vdev object)
  10400. * - SW_PEER_ID
  10401. * Bits 31:16
  10402. * Purpose: The peer ID (index) that WAL is allocating
  10403. * Value: (rx) peer ID
  10404. * - MAC_ADDR_L32
  10405. * Bits 31:0
  10406. * Purpose: Identifies which peer node the peer ID is for.
  10407. * Value: lower 4 bytes of peer node's MAC address
  10408. * - MAC_ADDR_U16
  10409. * Bits 15:0
  10410. * Purpose: Identifies which peer node the peer ID is for.
  10411. * Value: upper 2 bytes of peer node's MAC address
  10412. * - HW_PEER_ID / AST_INDEX_0
  10413. * Bits 31:16
  10414. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10415. * address, so for rx frames marked for rx --> tx forwarding, the
  10416. * host can determine from the HW peer ID provided as meta-data with
  10417. * the rx frame which peer the frame is supposed to be forwarded to.
  10418. * Value: ID used by the MAC HW to identify the peer
  10419. * - AST_HASH_VALUE
  10420. * Bits 15:0
  10421. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10422. * override feature.
  10423. * - NEXT_HOP
  10424. * Bit 16
  10425. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10426. * (Wireless Distribution System).
  10427. * - AST_VALID_MASK
  10428. * Bits 19:17
  10429. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10430. * - ONCHIP_AST_VALID_FLAG
  10431. * Bit 20
  10432. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10433. * is valid.
  10434. * - AST_INDEX_1
  10435. * Bits 15:0
  10436. * Purpose: indicate the second AST index for this peer
  10437. * - AST_0_FLOW_MASK
  10438. * Bits 19:16
  10439. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10440. * - AST_1_FLOW_MASK
  10441. * Bits 23:20
  10442. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10443. * - AST_2_FLOW_MASK
  10444. * Bits 27:24
  10445. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10446. * - AST_3_FLOW_MASK
  10447. * Bits 31:28
  10448. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10449. * - AST_INDEX_2
  10450. * Bits 15:0
  10451. * Purpose: indicate the third AST index for this peer
  10452. * - TID_VALID_HI_PRI
  10453. * Bits 23:16
  10454. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10455. * - TID_VALID_LOW_PRI
  10456. * Bits 31:24
  10457. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10458. * - AST_INDEX_3
  10459. * Bits 15:0
  10460. * Purpose: indicate the fourth AST index for this peer
  10461. * - ONCHIP_AST_IDX / RESERVED
  10462. * Bits 31:16
  10463. * Purpose: This field is valid only when split AST feature is enabled.
  10464. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10465. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10466. * address, this ast_idx is used for LMAC modules for RXPCU.
  10467. * Value: ID used by the LMAC HW to identify the peer
  10468. */
  10469. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10470. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10471. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10472. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10473. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10474. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10475. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10476. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10477. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10478. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10479. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10480. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10481. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10482. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10483. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10484. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10485. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10486. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10487. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10488. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10489. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10490. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10491. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10492. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10493. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10494. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10495. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10496. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10497. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10498. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10499. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10500. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10501. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10502. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10503. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10504. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10505. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10506. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10507. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10508. do { \
  10509. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10510. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10511. } while (0)
  10512. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10513. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10514. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10515. do { \
  10516. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10517. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10518. } while (0)
  10519. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10520. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10521. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10522. do { \
  10523. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10524. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10525. } while (0)
  10526. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10527. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10528. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10529. do { \
  10530. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10531. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10532. } while (0)
  10533. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10534. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10535. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10536. do { \
  10537. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10538. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10539. } while (0)
  10540. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10541. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10542. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10543. do { \
  10544. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10545. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10546. } while (0)
  10547. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10548. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10549. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10550. do { \
  10551. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10552. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10553. } while (0)
  10554. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10555. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10556. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10557. do { \
  10558. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10559. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10560. } while (0)
  10561. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10562. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10563. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10564. do { \
  10565. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10566. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10567. } while (0)
  10568. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10569. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10570. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10571. do { \
  10572. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10573. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10574. } while (0)
  10575. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10576. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10577. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10578. do { \
  10579. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10580. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10581. } while (0)
  10582. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10583. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10584. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10585. do { \
  10586. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10587. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10588. } while (0)
  10589. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10590. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10591. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10592. do { \
  10593. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10594. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10595. } while (0)
  10596. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10597. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10598. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10599. do { \
  10600. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10601. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10602. } while (0)
  10603. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10604. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10605. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10606. do { \
  10607. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10608. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10609. } while (0)
  10610. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10611. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10612. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10613. do { \
  10614. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10615. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10616. } while (0)
  10617. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10618. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10619. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10620. do { \
  10621. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10622. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10623. } while (0)
  10624. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10625. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10626. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10627. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10628. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10629. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10630. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10631. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10632. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10633. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10634. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10635. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10636. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10637. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10638. /**
  10639. * @brief target -> host rx peer map V3 message definition
  10640. *
  10641. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10642. *
  10643. * @details
  10644. * The following diagram shows the format of the rx peer map v3 message sent
  10645. * from the target to the host.
  10646. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10647. * This layout assumes the target operates as little-endian.
  10648. *
  10649. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10650. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10651. * | SW peer ID | VDEV ID | msg type |
  10652. * |-----------------+--------------------+-----------------+-----------------|
  10653. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10654. * |-----------------+--------------------+-----------------+-----------------|
  10655. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10656. * |-----------------+--------+-----------+-----------------+-----------------|
  10657. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10658. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10659. * | (8bits) | | (4bits) | |
  10660. * |-----------------+--------+--+--+--+--------------------------------------|
  10661. * | RESERVED |E |O | | |
  10662. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10663. * | |V |V | | |
  10664. * |-----------------+--------------------+-----------------------------------|
  10665. * | HTT_MSDU_IDX_ | RESERVED | |
  10666. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10667. * | (8bits) | | |
  10668. * |-----------------+--------------------+-----------------------------------|
  10669. * | Reserved_2 |
  10670. * |--------------------------------------------------------------------------|
  10671. * | Reserved_3 |
  10672. * |--------------------------------------------------------------------------|
  10673. *
  10674. * Where:
  10675. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10676. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10677. * NH = Next Hop
  10678. * The following field definitions describe the format of the rx peer map v3
  10679. * messages sent from the target to the host.
  10680. * - MSG_TYPE
  10681. * Bits 7:0
  10682. * Purpose: identifies this as a peer map v3 message
  10683. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10684. * - VDEV_ID
  10685. * Bits 15:8
  10686. * Purpose: Indicates which virtual device the peer is associated with.
  10687. * - SW_PEER_ID
  10688. * Bits 31:16
  10689. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10690. * - MAC_ADDR_L32
  10691. * Bits 31:0
  10692. * Purpose: Identifies which peer node the peer ID is for.
  10693. * Value: lower 4 bytes of peer node's MAC address
  10694. * - MAC_ADDR_U16
  10695. * Bits 15:0
  10696. * Purpose: Identifies which peer node the peer ID is for.
  10697. * Value: upper 2 bytes of peer node's MAC address
  10698. * - MULTICAST_SW_PEER_ID
  10699. * Bits 31:16
  10700. * Purpose: The multicast peer ID (index)
  10701. * Value: set to HTT_INVALID_PEER if not valid
  10702. * - HW_PEER_ID / AST_INDEX
  10703. * Bits 15:0
  10704. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10705. * address, so for rx frames marked for rx --> tx forwarding, the
  10706. * host can determine from the HW peer ID provided as meta-data with
  10707. * the rx frame which peer the frame is supposed to be forwarded to.
  10708. * - CACHE_SET_NUM
  10709. * Bits 19:16
  10710. * Purpose: Cache Set Number for AST_INDEX
  10711. * Cache set number that should be used to cache the index based
  10712. * search results, for address and flow search.
  10713. * This value should be equal to LSB 4 bits of the hash value
  10714. * of match data, in case of search index points to an entry which
  10715. * may be used in content based search also. The value can be
  10716. * anything when the entry pointed by search index will not be
  10717. * used for content based search.
  10718. * - HTT_MSDU_IDX_VALID_MASK
  10719. * Bits 31:24
  10720. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10721. * - ONCHIP_AST_IDX / RESERVED
  10722. * Bits 15:0
  10723. * Purpose: This field is valid only when split AST feature is enabled.
  10724. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10725. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10726. * address, this ast_idx is used for LMAC modules for RXPCU.
  10727. * - NEXT_HOP
  10728. * Bits 16
  10729. * Purpose: Flag indicates next_hop AST entry used for WDS
  10730. * (Wireless Distribution System).
  10731. * - ONCHIP_AST_VALID
  10732. * Bits 17
  10733. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10734. * - EXT_AST_VALID
  10735. * Bits 18
  10736. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10737. * - EXT_AST_INDEX
  10738. * Bits 15:0
  10739. * Purpose: This field describes Extended AST index
  10740. * Valid if EXT_AST_VALID flag set
  10741. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10742. * Bits 31:24
  10743. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10744. */
  10745. /* dword 0 */
  10746. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10747. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10748. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10749. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10750. /* dword 1 */
  10751. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10752. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10753. /* dword 2 */
  10754. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10755. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10756. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10757. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10758. /* dword 3 */
  10759. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10760. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10761. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10762. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10763. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10764. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10765. /* dword 4 */
  10766. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10767. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10768. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10769. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10770. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10771. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10772. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10773. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10774. /* dword 5 */
  10775. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10776. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10777. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10778. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10779. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10780. do { \
  10781. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10782. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10783. } while (0)
  10784. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10785. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10786. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10787. do { \
  10788. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10789. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10790. } while (0)
  10791. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10792. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10793. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10794. do { \
  10795. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10796. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10797. } while (0)
  10798. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10799. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10800. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10801. do { \
  10802. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10803. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10804. } while (0)
  10805. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10806. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10807. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10808. do { \
  10809. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10810. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10811. } while (0)
  10812. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10813. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10814. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10815. do { \
  10816. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10817. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10818. } while (0)
  10819. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10820. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10821. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10822. do { \
  10823. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10824. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10825. } while (0)
  10826. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10827. (((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)
  10828. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10829. do { \
  10830. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10831. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10832. } while (0)
  10833. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10834. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10835. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10836. do { \
  10837. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10838. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10839. } while (0)
  10840. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10841. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10842. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10843. do { \
  10844. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10845. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10846. } while (0)
  10847. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10848. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10849. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10850. do { \
  10851. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10852. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10853. } while (0)
  10854. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10855. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10856. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10857. do { \
  10858. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10859. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10860. } while (0)
  10861. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10862. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10863. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10864. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10865. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10866. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10867. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10868. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10869. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10870. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10871. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10872. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10873. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10874. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10875. /**
  10876. * @brief target -> host rx peer unmap V2 message definition
  10877. *
  10878. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10879. *
  10880. * The following diagram shows the format of the rx peer unmap message sent
  10881. * from the target to the host.
  10882. *
  10883. * |31 24|23 16|15 8|7 0|
  10884. * |-----------------------------------------------------------------------|
  10885. * | SW peer ID | VDEV ID | msg type |
  10886. * |-----------------------------------------------------------------------|
  10887. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10888. * |-----------------------------------------------------------------------|
  10889. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10890. * |-----------------------------------------------------------------------|
  10891. * | Peer Delete Duration |
  10892. * |-----------------------------------------------------------------------|
  10893. * | Reserved_0 | WDS Free Count |
  10894. * |-----------------------------------------------------------------------|
  10895. * | Reserved_1 |
  10896. * |-----------------------------------------------------------------------|
  10897. * | Reserved_2 |
  10898. * |-----------------------------------------------------------------------|
  10899. *
  10900. *
  10901. * The following field definitions describe the format of the rx peer unmap
  10902. * messages sent from the target to the host.
  10903. * - MSG_TYPE
  10904. * Bits 7:0
  10905. * Purpose: identifies this as an rx peer unmap v2 message
  10906. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10907. * - VDEV_ID
  10908. * Bits 15:8
  10909. * Purpose: Indicates which virtual device the peer is associated
  10910. * with.
  10911. * Value: vdev ID (used in the host to look up the vdev object)
  10912. * - SW_PEER_ID
  10913. * Bits 31:16
  10914. * Purpose: The peer ID (index) that WAL is freeing
  10915. * Value: (rx) peer ID
  10916. * - MAC_ADDR_L32
  10917. * Bits 31:0
  10918. * Purpose: Identifies which peer node the peer ID is for.
  10919. * Value: lower 4 bytes of peer node's MAC address
  10920. * - MAC_ADDR_U16
  10921. * Bits 15:0
  10922. * Purpose: Identifies which peer node the peer ID is for.
  10923. * Value: upper 2 bytes of peer node's MAC address
  10924. * - NEXT_HOP
  10925. * Bits 16
  10926. * Purpose: Bit indicates next_hop AST entry used for WDS
  10927. * (Wireless Distribution System).
  10928. * - PEER_DELETE_DURATION
  10929. * Bits 31:0
  10930. * Purpose: Time taken to delete peer, in msec,
  10931. * Used for monitoring / debugging PEER delete response delay
  10932. * - PEER_WDS_FREE_COUNT
  10933. * Bits 15:0
  10934. * Purpose: Count of WDS entries deleted associated to peer deleted
  10935. */
  10936. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10937. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10938. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10939. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10940. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10941. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10942. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10943. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10944. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10945. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10946. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10947. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10948. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10949. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10950. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10951. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10952. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10953. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10954. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10955. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10956. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10957. do { \
  10958. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10959. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10960. } while (0)
  10961. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10962. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10963. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10964. do { \
  10965. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10966. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10967. } while (0)
  10968. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10969. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10970. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10971. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10972. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10973. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10974. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10975. /**
  10976. * @brief target -> host rx peer mlo map message definition
  10977. *
  10978. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10979. *
  10980. * @details
  10981. * The following diagram shows the format of the rx mlo peer map message sent
  10982. * from the target to the host. This layout assumes the target operates
  10983. * as little-endian.
  10984. *
  10985. * MCC:
  10986. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10987. *
  10988. * WIN:
  10989. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10990. * It will be sent on the Assoc Link.
  10991. *
  10992. * This message always contains a MLO peer ID. The main purpose of the
  10993. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10994. * with, so that the host can use that MLO peer ID to determine which peer
  10995. * transmitted the rx frame.
  10996. *
  10997. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10998. * |-------------------------------------------------------------------------|
  10999. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11000. * |-------------------------------------------------------------------------|
  11001. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11002. * |-------------------------------------------------------------------------|
  11003. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11004. * |-------------------------------------------------------------------------|
  11005. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11006. * |-------------------------------------------------------------------------|
  11007. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11008. * |-------------------------------------------------------------------------|
  11009. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11010. * |-------------------------------------------------------------------------|
  11011. * |RSVD |
  11012. * |-------------------------------------------------------------------------|
  11013. * |RSVD |
  11014. * |-------------------------------------------------------------------------|
  11015. * | htt_tlv_hdr_t |
  11016. * |-------------------------------------------------------------------------|
  11017. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11018. * |-------------------------------------------------------------------------|
  11019. * | htt_tlv_hdr_t |
  11020. * |-------------------------------------------------------------------------|
  11021. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11022. * |-------------------------------------------------------------------------|
  11023. * | htt_tlv_hdr_t |
  11024. * |-------------------------------------------------------------------------|
  11025. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11026. * |-------------------------------------------------------------------------|
  11027. *
  11028. * Where:
  11029. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11030. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11031. * V (valid) - 1 Bit Bit17
  11032. * CHIPID - 3 Bits
  11033. * TIDMASK - 8 Bits
  11034. * CACHE_SET_NUM - 8 Bits
  11035. *
  11036. * The following field definitions describe the format of the rx MLO peer map
  11037. * messages sent from the target to the host.
  11038. * - MSG_TYPE
  11039. * Bits 7:0
  11040. * Purpose: identifies this as an rx mlo peer map message
  11041. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11042. *
  11043. * - MLO_PEER_ID
  11044. * Bits 23:8
  11045. * Purpose: The MLO peer ID (index).
  11046. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11047. * Value: MLO peer ID
  11048. *
  11049. * - NUMLINK
  11050. * Bits: 26:24 (3Bits)
  11051. * Purpose: Indicate the max number of logical links supported per client.
  11052. * Value: number of logical links
  11053. *
  11054. * - PRC
  11055. * Bits: 29:27 (3Bits)
  11056. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11057. * if there is migration of the primary chip.
  11058. * Value: Primary REO CHIPID
  11059. *
  11060. * - MAC_ADDR_L32
  11061. * Bits 31:0
  11062. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11063. * Value: lower 4 bytes of peer node's MAC address
  11064. *
  11065. * - MAC_ADDR_U16
  11066. * Bits 15:0
  11067. * Purpose: Identifies which peer node the peer ID is for.
  11068. * Value: upper 2 bytes of peer node's MAC address
  11069. *
  11070. * - PRIMARY_TCL_AST_IDX
  11071. * Bits 15:0
  11072. * Purpose: Primary TCL AST index for this peer.
  11073. *
  11074. * - V
  11075. * 1 Bit Position 16
  11076. * Purpose: If the ast idx is valid.
  11077. *
  11078. * - CHIPID
  11079. * Bits 19:17
  11080. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11081. *
  11082. * - TIDMASK
  11083. * Bits 27:20
  11084. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11085. *
  11086. * - CACHE_SET_NUM
  11087. * Bits 31:28
  11088. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11089. * Cache set number that should be used to cache the index based
  11090. * search results, for address and flow search.
  11091. * This value should be equal to LSB four bits of the hash value
  11092. * of match data, in case of search index points to an entry which
  11093. * may be used in content based search also. The value can be
  11094. * anything when the entry pointed by search index will not be
  11095. * used for content based search.
  11096. *
  11097. * - htt_tlv_hdr_t
  11098. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11099. *
  11100. * Bits 11:0
  11101. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11102. *
  11103. * Bits 23:12
  11104. * Purpose: Length, Length of the value that follows the header
  11105. *
  11106. * Bits 31:28
  11107. * Purpose: Reserved.
  11108. *
  11109. *
  11110. * - SW_PEER_ID
  11111. * Bits 15:0
  11112. * Purpose: The peer ID (index) that WAL is allocating
  11113. * Value: (rx) peer ID
  11114. *
  11115. * - VDEV_ID
  11116. * Bits 23:16
  11117. * Purpose: Indicates which virtual device the peer is associated with.
  11118. * Value: vdev ID (used in the host to look up the vdev object)
  11119. *
  11120. * - CHIPID
  11121. * Bits 26:24
  11122. * Purpose: Indicates which Chip id the peer is associated with.
  11123. * Value: chip ID (Provided by Host as part of QMI exchange)
  11124. */
  11125. typedef enum {
  11126. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11127. } MLO_PEER_MAP_TLV_TAG_ID;
  11128. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11129. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11130. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11131. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11132. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11133. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11134. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11135. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11136. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11137. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11138. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11139. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11140. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11141. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11142. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11143. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11144. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11145. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11146. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11147. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11148. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11149. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11150. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11151. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11152. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11153. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11154. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11155. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11156. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11157. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11158. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11159. do { \
  11160. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11161. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11162. } while (0)
  11163. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11164. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11165. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11166. do { \
  11167. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11168. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11169. } while (0)
  11170. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11171. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11172. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11173. do { \
  11174. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11175. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11176. } while (0)
  11177. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11178. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11179. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11180. do { \
  11181. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11182. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11183. } while (0)
  11184. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11185. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11186. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11187. do { \
  11188. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11189. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11190. } while (0)
  11191. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11192. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11193. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11194. do { \
  11195. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11196. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11197. } while (0)
  11198. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11199. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11200. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11201. do { \
  11202. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11203. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11204. } while (0)
  11205. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11206. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11207. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11208. do { \
  11209. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11210. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11211. } while (0)
  11212. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11213. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11214. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11215. do { \
  11216. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11217. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11218. } while (0)
  11219. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11220. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11221. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11222. do { \
  11223. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11224. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11225. } while (0)
  11226. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11227. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11228. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11229. do { \
  11230. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11231. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11232. } while (0)
  11233. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11234. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11235. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11236. do { \
  11237. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11238. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11239. } while (0)
  11240. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11241. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11242. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11243. do { \
  11244. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11245. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11246. } while (0)
  11247. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11248. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11249. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11250. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11251. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11252. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11253. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11254. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11255. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11256. *
  11257. * The following diagram shows the format of the rx mlo peer unmap message sent
  11258. * from the target to the host.
  11259. *
  11260. * |31 24|23 16|15 8|7 0|
  11261. * |-----------------------------------------------------------------------|
  11262. * | RSVD_24_31 | MLO peer ID | msg type |
  11263. * |-----------------------------------------------------------------------|
  11264. */
  11265. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11266. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11267. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11268. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11269. /**
  11270. * @brief target -> host message specifying security parameters
  11271. *
  11272. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11273. *
  11274. * @details
  11275. * The following diagram shows the format of the security specification
  11276. * message sent from the target to the host.
  11277. * This security specification message tells the host whether a PN check is
  11278. * necessary on rx data frames, and if so, how large the PN counter is.
  11279. * This message also tells the host about the security processing to apply
  11280. * to defragmented rx frames - specifically, whether a Message Integrity
  11281. * Check is required, and the Michael key to use.
  11282. *
  11283. * |31 24|23 16|15|14 8|7 0|
  11284. * |-----------------------------------------------------------------------|
  11285. * | peer ID | U| security type | msg type |
  11286. * |-----------------------------------------------------------------------|
  11287. * | Michael Key K0 |
  11288. * |-----------------------------------------------------------------------|
  11289. * | Michael Key K1 |
  11290. * |-----------------------------------------------------------------------|
  11291. * | WAPI RSC Low0 |
  11292. * |-----------------------------------------------------------------------|
  11293. * | WAPI RSC Low1 |
  11294. * |-----------------------------------------------------------------------|
  11295. * | WAPI RSC Hi0 |
  11296. * |-----------------------------------------------------------------------|
  11297. * | WAPI RSC Hi1 |
  11298. * |-----------------------------------------------------------------------|
  11299. *
  11300. * The following field definitions describe the format of the security
  11301. * indication message sent from the target to the host.
  11302. * - MSG_TYPE
  11303. * Bits 7:0
  11304. * Purpose: identifies this as a security specification message
  11305. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11306. * - SEC_TYPE
  11307. * Bits 14:8
  11308. * Purpose: specifies which type of security applies to the peer
  11309. * Value: htt_sec_type enum value
  11310. * - UNICAST
  11311. * Bit 15
  11312. * Purpose: whether this security is applied to unicast or multicast data
  11313. * Value: 1 -> unicast, 0 -> multicast
  11314. * - PEER_ID
  11315. * Bits 31:16
  11316. * Purpose: The ID number for the peer the security specification is for
  11317. * Value: peer ID
  11318. * - MICHAEL_KEY_K0
  11319. * Bits 31:0
  11320. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11321. * Value: Michael Key K0 (if security type is TKIP)
  11322. * - MICHAEL_KEY_K1
  11323. * Bits 31:0
  11324. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11325. * Value: Michael Key K1 (if security type is TKIP)
  11326. * - WAPI_RSC_LOW0
  11327. * Bits 31:0
  11328. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11329. * Value: WAPI RSC Low0 (if security type is WAPI)
  11330. * - WAPI_RSC_LOW1
  11331. * Bits 31:0
  11332. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11333. * Value: WAPI RSC Low1 (if security type is WAPI)
  11334. * - WAPI_RSC_HI0
  11335. * Bits 31:0
  11336. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11337. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11338. * - WAPI_RSC_HI1
  11339. * Bits 31:0
  11340. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11341. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11342. */
  11343. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11344. #define HTT_SEC_IND_SEC_TYPE_S 8
  11345. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11346. #define HTT_SEC_IND_UNICAST_S 15
  11347. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11348. #define HTT_SEC_IND_PEER_ID_S 16
  11349. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11350. do { \
  11351. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11352. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11353. } while (0)
  11354. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11355. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11356. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11357. do { \
  11358. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11359. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11360. } while (0)
  11361. #define HTT_SEC_IND_UNICAST_GET(word) \
  11362. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11363. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11364. do { \
  11365. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11366. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11367. } while (0)
  11368. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11369. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11370. #define HTT_SEC_IND_BYTES 28
  11371. /**
  11372. * @brief target -> host rx ADDBA / DELBA message definitions
  11373. *
  11374. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11375. *
  11376. * @details
  11377. * The following diagram shows the format of the rx ADDBA message sent
  11378. * from the target to the host:
  11379. *
  11380. * |31 20|19 16|15 8|7 0|
  11381. * |---------------------------------------------------------------------|
  11382. * | peer ID | TID | window size | msg type |
  11383. * |---------------------------------------------------------------------|
  11384. *
  11385. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11386. *
  11387. * The following diagram shows the format of the rx DELBA message sent
  11388. * from the target to the host:
  11389. *
  11390. * |31 20|19 16|15 10|9 8|7 0|
  11391. * |---------------------------------------------------------------------|
  11392. * | peer ID | TID | window size | IR| msg type |
  11393. * |---------------------------------------------------------------------|
  11394. *
  11395. * The following field definitions describe the format of the rx ADDBA
  11396. * and DELBA messages sent from the target to the host.
  11397. * - MSG_TYPE
  11398. * Bits 7:0
  11399. * Purpose: identifies this as an rx ADDBA or DELBA message
  11400. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11401. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11402. * - IR (initiator / recipient)
  11403. * Bits 9:8 (DELBA only)
  11404. * Purpose: specify whether the DELBA handshake was initiated by the
  11405. * local STA/AP, or by the peer STA/AP
  11406. * Value:
  11407. * 0 - unspecified
  11408. * 1 - initiator (a.k.a. originator)
  11409. * 2 - recipient (a.k.a. responder)
  11410. * 3 - unused / reserved
  11411. * - WIN_SIZE
  11412. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11413. * Purpose: Specifies the length of the block ack window (max = 64).
  11414. * Value:
  11415. * block ack window length specified by the received ADDBA/DELBA
  11416. * management message.
  11417. * - TID
  11418. * Bits 19:16
  11419. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11420. * Value:
  11421. * TID specified by the received ADDBA or DELBA management message.
  11422. * - PEER_ID
  11423. * Bits 31:20
  11424. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11425. * Value:
  11426. * ID (hash value) used by the host for fast, direct lookup of
  11427. * host SW peer info, including rx reorder states.
  11428. */
  11429. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11430. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11431. #define HTT_RX_ADDBA_TID_M 0xf0000
  11432. #define HTT_RX_ADDBA_TID_S 16
  11433. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11434. #define HTT_RX_ADDBA_PEER_ID_S 20
  11435. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11436. do { \
  11437. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11438. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11439. } while (0)
  11440. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11441. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11442. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11443. do { \
  11444. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11445. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11446. } while (0)
  11447. #define HTT_RX_ADDBA_TID_GET(word) \
  11448. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11449. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11450. do { \
  11451. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11452. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11453. } while (0)
  11454. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11455. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11456. #define HTT_RX_ADDBA_BYTES 4
  11457. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11458. #define HTT_RX_DELBA_INITIATOR_S 8
  11459. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11460. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11461. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11462. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11463. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11464. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11465. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11466. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11467. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11468. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11469. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11470. do { \
  11471. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11472. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11473. } while (0)
  11474. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11475. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11476. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11477. do { \
  11478. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11479. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11480. } while (0)
  11481. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11482. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11483. #define HTT_RX_DELBA_BYTES 4
  11484. /**
  11485. * @brief tx queue group information element definition
  11486. *
  11487. * @details
  11488. * The following diagram shows the format of the tx queue group
  11489. * information element, which can be included in target --> host
  11490. * messages to specify the number of tx "credits" (tx descriptors
  11491. * for LL, or tx buffers for HL) available to a particular group
  11492. * of host-side tx queues, and which host-side tx queues belong to
  11493. * the group.
  11494. *
  11495. * |31|30 24|23 16|15|14|13 0|
  11496. * |------------------------------------------------------------------------|
  11497. * | X| reserved | tx queue grp ID | A| S| credit count |
  11498. * |------------------------------------------------------------------------|
  11499. * | vdev ID mask | AC mask |
  11500. * |------------------------------------------------------------------------|
  11501. *
  11502. * The following definitions describe the fields within the tx queue group
  11503. * information element:
  11504. * - credit_count
  11505. * Bits 13:1
  11506. * Purpose: specify how many tx credits are available to the tx queue group
  11507. * Value: An absolute or relative, positive or negative credit value
  11508. * The 'A' bit specifies whether the value is absolute or relative.
  11509. * The 'S' bit specifies whether the value is positive or negative.
  11510. * A negative value can only be relative, not absolute.
  11511. * An absolute value replaces any prior credit value the host has for
  11512. * the tx queue group in question.
  11513. * A relative value is added to the prior credit value the host has for
  11514. * the tx queue group in question.
  11515. * - sign
  11516. * Bit 14
  11517. * Purpose: specify whether the credit count is positive or negative
  11518. * Value: 0 -> positive, 1 -> negative
  11519. * - absolute
  11520. * Bit 15
  11521. * Purpose: specify whether the credit count is absolute or relative
  11522. * Value: 0 -> relative, 1 -> absolute
  11523. * - txq_group_id
  11524. * Bits 23:16
  11525. * Purpose: indicate which tx queue group's credit and/or membership are
  11526. * being specified
  11527. * Value: 0 to max_tx_queue_groups-1
  11528. * - reserved
  11529. * Bits 30:16
  11530. * Value: 0x0
  11531. * - eXtension
  11532. * Bit 31
  11533. * Purpose: specify whether another tx queue group info element follows
  11534. * Value: 0 -> no more tx queue group information elements
  11535. * 1 -> another tx queue group information element immediately follows
  11536. * - ac_mask
  11537. * Bits 15:0
  11538. * Purpose: specify which Access Categories belong to the tx queue group
  11539. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11540. * the tx queue group.
  11541. * The AC bit-mask values are obtained by left-shifting by the
  11542. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11543. * - vdev_id_mask
  11544. * Bits 31:16
  11545. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11546. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11547. * belong to the tx queue group.
  11548. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11549. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11550. */
  11551. PREPACK struct htt_txq_group {
  11552. A_UINT32
  11553. credit_count: 14,
  11554. sign: 1,
  11555. absolute: 1,
  11556. tx_queue_group_id: 8,
  11557. reserved0: 7,
  11558. extension: 1;
  11559. A_UINT32
  11560. ac_mask: 16,
  11561. vdev_id_mask: 16;
  11562. } POSTPACK;
  11563. /* first word */
  11564. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11565. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11566. #define HTT_TXQ_GROUP_SIGN_S 14
  11567. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11568. #define HTT_TXQ_GROUP_ABS_S 15
  11569. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11570. #define HTT_TXQ_GROUP_ID_S 16
  11571. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11572. #define HTT_TXQ_GROUP_EXT_S 31
  11573. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11574. /* second word */
  11575. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11576. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11577. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11578. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11579. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11580. do { \
  11581. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11582. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11583. } while (0)
  11584. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11585. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11586. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11587. do { \
  11588. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11589. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11590. } while (0)
  11591. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11592. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11593. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11594. do { \
  11595. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11596. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11597. } while (0)
  11598. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11599. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11600. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11601. do { \
  11602. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11603. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11604. } while (0)
  11605. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11606. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11607. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11608. do { \
  11609. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11610. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11611. } while (0)
  11612. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11613. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11614. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11615. do { \
  11616. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11617. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11618. } while (0)
  11619. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11620. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11621. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11622. do { \
  11623. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11624. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11625. } while (0)
  11626. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11627. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11628. /**
  11629. * @brief target -> host TX completion indication message definition
  11630. *
  11631. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11632. *
  11633. * @details
  11634. * The following diagram shows the format of the TX completion indication sent
  11635. * from the target to the host
  11636. *
  11637. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11638. * |-------------------------------------------------------------------|
  11639. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11640. * |-------------------------------------------------------------------|
  11641. * payload:| MSDU1 ID | MSDU0 ID |
  11642. * |-------------------------------------------------------------------|
  11643. * : MSDU3 ID | MSDU2 ID :
  11644. * |-------------------------------------------------------------------|
  11645. * | struct htt_tx_compl_ind_append_retries |
  11646. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11647. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11648. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11649. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11650. * |-------------------------------------------------------------------|
  11651. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11652. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11653. * | MSDU0 tx_tsf64_low |
  11654. * |-------------------------------------------------------------------|
  11655. * | MSDU0 tx_tsf64_high |
  11656. * |-------------------------------------------------------------------|
  11657. * | MSDU1 tx_tsf64_low |
  11658. * |-------------------------------------------------------------------|
  11659. * | MSDU1 tx_tsf64_high |
  11660. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11661. * | phy_timestamp |
  11662. * |-------------------------------------------------------------------|
  11663. * | rate specs (see below) |
  11664. * |-------------------------------------------------------------------|
  11665. * | seqctrl | framectrl |
  11666. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11667. * Where:
  11668. * A0 = append (a.k.a. append0)
  11669. * A1 = append1
  11670. * TP = MSDU tx power presence
  11671. * A2 = append2
  11672. * A3 = append3
  11673. * A4 = append4
  11674. *
  11675. * The following field definitions describe the format of the TX completion
  11676. * indication sent from the target to the host
  11677. * Header fields:
  11678. * - msg_type
  11679. * Bits 7:0
  11680. * Purpose: identifies this as HTT TX completion indication
  11681. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11682. * - status
  11683. * Bits 10:8
  11684. * Purpose: the TX completion status of payload fragmentations descriptors
  11685. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11686. * - tid
  11687. * Bits 14:11
  11688. * Purpose: the tid associated with those fragmentation descriptors. It is
  11689. * valid or not, depending on the tid_invalid bit.
  11690. * Value: 0 to 15
  11691. * - tid_invalid
  11692. * Bits 15:15
  11693. * Purpose: this bit indicates whether the tid field is valid or not
  11694. * Value: 0 indicates valid; 1 indicates invalid
  11695. * - num
  11696. * Bits 23:16
  11697. * Purpose: the number of payload in this indication
  11698. * Value: 1 to 255
  11699. * - append (a.k.a. append0)
  11700. * Bits 24:24
  11701. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11702. * the number of tx retries for one MSDU at the end of this message
  11703. * Value: 0 indicates no appending; 1 indicates appending
  11704. * - append1
  11705. * Bits 25:25
  11706. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11707. * contains the timestamp info for each TX msdu id in payload.
  11708. * The order of the timestamps matches the order of the MSDU IDs.
  11709. * Note that a big-endian host needs to account for the reordering
  11710. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11711. * conversion) when determining which tx timestamp corresponds to
  11712. * which MSDU ID.
  11713. * Value: 0 indicates no appending; 1 indicates appending
  11714. * - msdu_tx_power_presence
  11715. * Bits 26:26
  11716. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11717. * for each MSDU referenced by the TX_COMPL_IND message.
  11718. * The tx power is reported in 0.5 dBm units.
  11719. * The order of the per-MSDU tx power reports matches the order
  11720. * of the MSDU IDs.
  11721. * Note that a big-endian host needs to account for the reordering
  11722. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11723. * conversion) when determining which Tx Power corresponds to
  11724. * which MSDU ID.
  11725. * Value: 0 indicates MSDU tx power reports are not appended,
  11726. * 1 indicates MSDU tx power reports are appended
  11727. * - append2
  11728. * Bits 27:27
  11729. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11730. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11731. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11732. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11733. * for each MSDU, for convenience.
  11734. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11735. * this append2 bit is set).
  11736. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11737. * dB above the noise floor.
  11738. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11739. * 1 indicates MSDU ACK RSSI values are appended.
  11740. * - append3
  11741. * Bits 28:28
  11742. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11743. * contains the tx tsf info based on wlan global TSF for
  11744. * each TX msdu id in payload.
  11745. * The order of the tx tsf matches the order of the MSDU IDs.
  11746. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11747. * values to indicate the the lower 32 bits and higher 32 bits of
  11748. * the tx tsf.
  11749. * The tx_tsf64 here represents the time MSDU was acked and the
  11750. * tx_tsf64 has microseconds units.
  11751. * Value: 0 indicates no appending; 1 indicates appending
  11752. * - append4
  11753. * Bits 29:29
  11754. * Purpose: Indicate whether data frame control fields and fields required
  11755. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11756. * message. The order of the this message matches the order of
  11757. * the MSDU IDs.
  11758. * Value: 0 indicates frame control fields and fields required for
  11759. * radio tap header values are not appended,
  11760. * 1 indicates frame control fields and fields required for
  11761. * radio tap header values are appended.
  11762. * Payload fields:
  11763. * - hmsdu_id
  11764. * Bits 15:0
  11765. * Purpose: this ID is used to track the Tx buffer in host
  11766. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11767. */
  11768. PREPACK struct htt_tx_data_hdr_information {
  11769. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11770. A_UINT32 /* word 1 */
  11771. /* preamble:
  11772. * 0-OFDM,
  11773. * 1-CCk,
  11774. * 2-HT,
  11775. * 3-VHT
  11776. */
  11777. preamble: 2, /* [1:0] */
  11778. /* mcs:
  11779. * In case of HT preamble interpret
  11780. * MCS along with NSS.
  11781. * Valid values for HT are 0 to 7.
  11782. * HT mcs 0 with NSS 2 is mcs 8.
  11783. * Valid values for VHT are 0 to 9.
  11784. */
  11785. mcs: 4, /* [5:2] */
  11786. /* rate:
  11787. * This is applicable only for
  11788. * CCK and OFDM preamble type
  11789. * rate 0: OFDM 48 Mbps,
  11790. * 1: OFDM 24 Mbps,
  11791. * 2: OFDM 12 Mbps
  11792. * 3: OFDM 6 Mbps
  11793. * 4: OFDM 54 Mbps
  11794. * 5: OFDM 36 Mbps
  11795. * 6: OFDM 18 Mbps
  11796. * 7: OFDM 9 Mbps
  11797. * rate 0: CCK 11 Mbps Long
  11798. * 1: CCK 5.5 Mbps Long
  11799. * 2: CCK 2 Mbps Long
  11800. * 3: CCK 1 Mbps Long
  11801. * 4: CCK 11 Mbps Short
  11802. * 5: CCK 5.5 Mbps Short
  11803. * 6: CCK 2 Mbps Short
  11804. */
  11805. rate : 3, /* [ 8: 6] */
  11806. rssi : 8, /* [16: 9] units=dBm */
  11807. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11808. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11809. stbc : 1, /* [22] */
  11810. sgi : 1, /* [23] */
  11811. ldpc : 1, /* [24] */
  11812. beamformed: 1, /* [25] */
  11813. /* tx_retry_cnt:
  11814. * Indicates retry count of data tx frames provided by the host.
  11815. */
  11816. tx_retry_cnt: 6; /* [31:26] */
  11817. A_UINT32 /* word 2 */
  11818. framectrl:16, /* [15: 0] */
  11819. seqno:16; /* [31:16] */
  11820. } POSTPACK;
  11821. #define HTT_TX_COMPL_IND_STATUS_S 8
  11822. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11823. #define HTT_TX_COMPL_IND_TID_S 11
  11824. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11825. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11826. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11827. #define HTT_TX_COMPL_IND_NUM_S 16
  11828. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11829. #define HTT_TX_COMPL_IND_APPEND_S 24
  11830. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11831. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11832. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11833. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11834. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11835. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11836. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11837. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11838. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11839. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11840. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11841. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11844. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11845. } while (0)
  11846. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11847. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11848. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11851. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11852. } while (0)
  11853. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11854. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11855. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11856. do { \
  11857. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11858. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11859. } while (0)
  11860. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11861. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11862. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11863. do { \
  11864. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11865. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11866. } while (0)
  11867. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11868. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11869. HTT_TX_COMPL_IND_TID_INV_S)
  11870. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11871. do { \
  11872. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11873. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11874. } while (0)
  11875. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11876. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11877. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11878. do { \
  11879. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11880. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11881. } while (0)
  11882. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11883. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11884. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11885. do { \
  11886. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11887. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11888. } while (0)
  11889. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11890. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11891. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11892. do { \
  11893. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11894. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11895. } while (0)
  11896. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11897. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11898. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11899. do { \
  11900. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11901. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11902. } while (0)
  11903. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11904. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11905. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11906. do { \
  11907. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11908. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11909. } while (0)
  11910. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11911. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11912. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11913. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11914. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11915. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11916. #define HTT_TX_COMPL_IND_STAT_OK 0
  11917. /* DISCARD:
  11918. * current meaning:
  11919. * MSDUs were queued for transmission but filtered by HW or SW
  11920. * without any over the air attempts
  11921. * legacy meaning (HL Rome):
  11922. * MSDUs were discarded by the target FW without any over the air
  11923. * attempts due to lack of space
  11924. */
  11925. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11926. /* NO_ACK:
  11927. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11928. */
  11929. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11930. /* POSTPONE:
  11931. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11932. * be downloaded again later (in the appropriate order), when they are
  11933. * deliverable.
  11934. */
  11935. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11936. /*
  11937. * The PEER_DEL tx completion status is used for HL cases
  11938. * where the peer the frame is for has been deleted.
  11939. * The host has already discarded its copy of the frame, but
  11940. * it still needs the tx completion to restore its credit.
  11941. */
  11942. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11943. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11944. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11945. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11946. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11947. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11948. PREPACK struct htt_tx_compl_ind_base {
  11949. A_UINT32 hdr;
  11950. A_UINT16 payload[1/*or more*/];
  11951. } POSTPACK;
  11952. PREPACK struct htt_tx_compl_ind_append_retries {
  11953. A_UINT16 msdu_id;
  11954. A_UINT8 tx_retries;
  11955. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11956. 0: this is the last append_retries struct */
  11957. } POSTPACK;
  11958. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11959. A_UINT32 timestamp[1/*or more*/];
  11960. } POSTPACK;
  11961. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11962. A_UINT32 tx_tsf64_low;
  11963. A_UINT32 tx_tsf64_high;
  11964. } POSTPACK;
  11965. /* htt_tx_data_hdr_information payload extension fields: */
  11966. /* DWORD zero */
  11967. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11968. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11969. /* DWORD one */
  11970. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11971. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11972. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11973. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11974. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11975. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11976. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11977. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11978. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11979. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11980. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11981. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11982. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11983. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11984. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11985. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11986. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11987. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11988. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11989. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11990. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11991. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11992. /* DWORD two */
  11993. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11994. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11995. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11996. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11997. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11998. do { \
  11999. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12000. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12001. } while (0)
  12002. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12003. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12004. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12005. do { \
  12006. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12007. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12008. } while (0)
  12009. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12010. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12011. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12012. do { \
  12013. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12014. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12015. } while (0)
  12016. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12017. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12018. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12019. do { \
  12020. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12021. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12022. } while (0)
  12023. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12024. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12025. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12026. do { \
  12027. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12028. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12029. } while (0)
  12030. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12031. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12032. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12033. do { \
  12034. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12035. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12036. } while (0)
  12037. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12038. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12039. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12040. do { \
  12041. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12042. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12043. } while (0)
  12044. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12045. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12046. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12047. do { \
  12048. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12049. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12050. } while (0)
  12051. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12052. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12053. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12054. do { \
  12055. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12056. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12057. } while (0)
  12058. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12059. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12060. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12061. do { \
  12062. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12063. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12064. } while (0)
  12065. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12066. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12067. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12068. do { \
  12069. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12070. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12071. } while (0)
  12072. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12073. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12074. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12075. do { \
  12076. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12077. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12078. } while (0)
  12079. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12080. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12081. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12082. do { \
  12083. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12084. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12085. } while (0)
  12086. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12087. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12088. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12089. do { \
  12090. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12091. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12092. } while (0)
  12093. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12094. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12095. /**
  12096. * @brief target -> host rate-control update indication message
  12097. *
  12098. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12099. *
  12100. * @details
  12101. * The following diagram shows the format of the RC Update message
  12102. * sent from the target to the host, while processing the tx-completion
  12103. * of a transmitted PPDU.
  12104. *
  12105. * |31 24|23 16|15 8|7 0|
  12106. * |-------------------------------------------------------------|
  12107. * | peer ID | vdev ID | msg_type |
  12108. * |-------------------------------------------------------------|
  12109. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12110. * |-------------------------------------------------------------|
  12111. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12112. * |-------------------------------------------------------------|
  12113. * | : |
  12114. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12115. * | : |
  12116. * |-------------------------------------------------------------|
  12117. * | : |
  12118. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12119. * | : |
  12120. * |-------------------------------------------------------------|
  12121. * : :
  12122. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12123. *
  12124. */
  12125. typedef struct {
  12126. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12127. A_UINT32 rate_code_flags;
  12128. A_UINT32 flags; /* Encodes information such as excessive
  12129. retransmission, aggregate, some info
  12130. from .11 frame control,
  12131. STBC, LDPC, (SGI and Tx Chain Mask
  12132. are encoded in ptx_rc->flags field),
  12133. AMPDU truncation (BT/time based etc.),
  12134. RTS/CTS attempt */
  12135. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12136. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12137. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12138. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12139. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12140. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12141. } HTT_RC_TX_DONE_PARAMS;
  12142. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12143. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12144. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12145. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12146. #define HTT_RC_UPDATE_VDEVID_S 8
  12147. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12148. #define HTT_RC_UPDATE_PEERID_S 16
  12149. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12150. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12151. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12152. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12153. do { \
  12154. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12155. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12156. } while (0)
  12157. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12158. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12159. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12160. do { \
  12161. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12162. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12163. } while (0)
  12164. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12165. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12166. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12167. do { \
  12168. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12169. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12170. } while (0)
  12171. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12172. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12173. /**
  12174. * @brief target -> host rx fragment indication message definition
  12175. *
  12176. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12177. *
  12178. * @details
  12179. * The following field definitions describe the format of the rx fragment
  12180. * indication message sent from the target to the host.
  12181. * The rx fragment indication message shares the format of the
  12182. * rx indication message, but not all fields from the rx indication message
  12183. * are relevant to the rx fragment indication message.
  12184. *
  12185. *
  12186. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12187. * |-----------+-------------------+---------------------+-------------|
  12188. * | peer ID | |FV| ext TID | msg type |
  12189. * |-------------------------------------------------------------------|
  12190. * | | flush | flush |
  12191. * | | end | start |
  12192. * | | seq num | seq num |
  12193. * |-------------------------------------------------------------------|
  12194. * | reserved | FW rx desc bytes |
  12195. * |-------------------------------------------------------------------|
  12196. * | | FW MSDU Rx |
  12197. * | | desc B0 |
  12198. * |-------------------------------------------------------------------|
  12199. * Header fields:
  12200. * - MSG_TYPE
  12201. * Bits 7:0
  12202. * Purpose: identifies this as an rx fragment indication message
  12203. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12204. * - EXT_TID
  12205. * Bits 12:8
  12206. * Purpose: identify the traffic ID of the rx data, including
  12207. * special "extended" TID values for multicast, broadcast, and
  12208. * non-QoS data frames
  12209. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12210. * - FLUSH_VALID (FV)
  12211. * Bit 13
  12212. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12213. * is valid
  12214. * Value:
  12215. * 1 -> flush IE is valid and needs to be processed
  12216. * 0 -> flush IE is not valid and should be ignored
  12217. * - PEER_ID
  12218. * Bits 31:16
  12219. * Purpose: Identify, by ID, which peer sent the rx data
  12220. * Value: ID of the peer who sent the rx data
  12221. * - FLUSH_SEQ_NUM_START
  12222. * Bits 5:0
  12223. * Purpose: Indicate the start of a series of MPDUs to flush
  12224. * Not all MPDUs within this series are necessarily valid - the host
  12225. * must check each sequence number within this range to see if the
  12226. * corresponding MPDU is actually present.
  12227. * This field is only valid if the FV bit is set.
  12228. * Value:
  12229. * The sequence number for the first MPDUs to check to flush.
  12230. * The sequence number is masked by 0x3f.
  12231. * - FLUSH_SEQ_NUM_END
  12232. * Bits 11:6
  12233. * Purpose: Indicate the end of a series of MPDUs to flush
  12234. * Value:
  12235. * The sequence number one larger than the sequence number of the
  12236. * last MPDU to check to flush.
  12237. * The sequence number is masked by 0x3f.
  12238. * Not all MPDUs within this series are necessarily valid - the host
  12239. * must check each sequence number within this range to see if the
  12240. * corresponding MPDU is actually present.
  12241. * This field is only valid if the FV bit is set.
  12242. * Rx descriptor fields:
  12243. * - FW_RX_DESC_BYTES
  12244. * Bits 15:0
  12245. * Purpose: Indicate how many bytes in the Rx indication are used for
  12246. * FW Rx descriptors
  12247. * Value: 1
  12248. */
  12249. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12250. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12251. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12252. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12253. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12254. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12255. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12256. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12257. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12258. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12259. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12260. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12261. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12262. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12263. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12264. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12265. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12266. #define HTT_RX_FRAG_IND_BYTES \
  12267. (4 /* msg hdr */ + \
  12268. 4 /* flush spec */ + \
  12269. 4 /* (unused) FW rx desc bytes spec */ + \
  12270. 4 /* FW rx desc */)
  12271. /**
  12272. * @brief target -> host test message definition
  12273. *
  12274. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12275. *
  12276. * @details
  12277. * The following field definitions describe the format of the test
  12278. * message sent from the target to the host.
  12279. * The message consists of a 4-octet header, followed by a variable
  12280. * number of 32-bit integer values, followed by a variable number
  12281. * of 8-bit character values.
  12282. *
  12283. * |31 16|15 8|7 0|
  12284. * |-----------------------------------------------------------|
  12285. * | num chars | num ints | msg type |
  12286. * |-----------------------------------------------------------|
  12287. * | int 0 |
  12288. * |-----------------------------------------------------------|
  12289. * | int 1 |
  12290. * |-----------------------------------------------------------|
  12291. * | ... |
  12292. * |-----------------------------------------------------------|
  12293. * | char 3 | char 2 | char 1 | char 0 |
  12294. * |-----------------------------------------------------------|
  12295. * | | | ... | char 4 |
  12296. * |-----------------------------------------------------------|
  12297. * - MSG_TYPE
  12298. * Bits 7:0
  12299. * Purpose: identifies this as a test message
  12300. * Value: HTT_MSG_TYPE_TEST
  12301. * - NUM_INTS
  12302. * Bits 15:8
  12303. * Purpose: indicate how many 32-bit integers follow the message header
  12304. * - NUM_CHARS
  12305. * Bits 31:16
  12306. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12307. */
  12308. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12309. #define HTT_RX_TEST_NUM_INTS_S 8
  12310. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12311. #define HTT_RX_TEST_NUM_CHARS_S 16
  12312. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12313. do { \
  12314. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12315. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12316. } while (0)
  12317. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12318. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12319. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12320. do { \
  12321. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12322. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12323. } while (0)
  12324. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12325. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12326. /**
  12327. * @brief target -> host packet log message
  12328. *
  12329. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12330. *
  12331. * @details
  12332. * The following field definitions describe the format of the packet log
  12333. * message sent from the target to the host.
  12334. * The message consists of a 4-octet header,followed by a variable number
  12335. * of 32-bit character values.
  12336. *
  12337. * |31 16|15 12|11 10|9 8|7 0|
  12338. * |------------------------------------------------------------------|
  12339. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12340. * |------------------------------------------------------------------|
  12341. * | payload |
  12342. * |------------------------------------------------------------------|
  12343. * - MSG_TYPE
  12344. * Bits 7:0
  12345. * Purpose: identifies this as a pktlog message
  12346. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12347. * - mac_id
  12348. * Bits 9:8
  12349. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12350. * Value: 0-3
  12351. * - pdev_id
  12352. * Bits 11:10
  12353. * Purpose: pdev_id
  12354. * Value: 0-3
  12355. * 0 (for rings at SOC level),
  12356. * 1/2/3 PDEV -> 0/1/2
  12357. * - payload_size
  12358. * Bits 31:16
  12359. * Purpose: explicitly specify the payload size
  12360. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12361. */
  12362. PREPACK struct htt_pktlog_msg {
  12363. A_UINT32 header;
  12364. A_UINT32 payload[1/* or more */];
  12365. } POSTPACK;
  12366. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12367. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12368. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12369. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12370. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12371. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12372. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12373. do { \
  12374. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12375. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12376. } while (0)
  12377. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12378. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12379. HTT_T2H_PKTLOG_MAC_ID_S)
  12380. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12381. do { \
  12382. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12383. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12384. } while (0)
  12385. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12386. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12387. HTT_T2H_PKTLOG_PDEV_ID_S)
  12388. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12389. do { \
  12390. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12391. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12392. } while (0)
  12393. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12394. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12395. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12396. /*
  12397. * Rx reorder statistics
  12398. * NB: all the fields must be defined in 4 octets size.
  12399. */
  12400. struct rx_reorder_stats {
  12401. /* Non QoS MPDUs received */
  12402. A_UINT32 deliver_non_qos;
  12403. /* MPDUs received in-order */
  12404. A_UINT32 deliver_in_order;
  12405. /* Flush due to reorder timer expired */
  12406. A_UINT32 deliver_flush_timeout;
  12407. /* Flush due to move out of window */
  12408. A_UINT32 deliver_flush_oow;
  12409. /* Flush due to DELBA */
  12410. A_UINT32 deliver_flush_delba;
  12411. /* MPDUs dropped due to FCS error */
  12412. A_UINT32 fcs_error;
  12413. /* MPDUs dropped due to monitor mode non-data packet */
  12414. A_UINT32 mgmt_ctrl;
  12415. /* Unicast-data MPDUs dropped due to invalid peer */
  12416. A_UINT32 invalid_peer;
  12417. /* MPDUs dropped due to duplication (non aggregation) */
  12418. A_UINT32 dup_non_aggr;
  12419. /* MPDUs dropped due to processed before */
  12420. A_UINT32 dup_past;
  12421. /* MPDUs dropped due to duplicate in reorder queue */
  12422. A_UINT32 dup_in_reorder;
  12423. /* Reorder timeout happened */
  12424. A_UINT32 reorder_timeout;
  12425. /* invalid bar ssn */
  12426. A_UINT32 invalid_bar_ssn;
  12427. /* reorder reset due to bar ssn */
  12428. A_UINT32 ssn_reset;
  12429. /* Flush due to delete peer */
  12430. A_UINT32 deliver_flush_delpeer;
  12431. /* Flush due to offload*/
  12432. A_UINT32 deliver_flush_offload;
  12433. /* Flush due to out of buffer*/
  12434. A_UINT32 deliver_flush_oob;
  12435. /* MPDUs dropped due to PN check fail */
  12436. A_UINT32 pn_fail;
  12437. /* MPDUs dropped due to unable to allocate memory */
  12438. A_UINT32 store_fail;
  12439. /* Number of times the tid pool alloc succeeded */
  12440. A_UINT32 tid_pool_alloc_succ;
  12441. /* Number of times the MPDU pool alloc succeeded */
  12442. A_UINT32 mpdu_pool_alloc_succ;
  12443. /* Number of times the MSDU pool alloc succeeded */
  12444. A_UINT32 msdu_pool_alloc_succ;
  12445. /* Number of times the tid pool alloc failed */
  12446. A_UINT32 tid_pool_alloc_fail;
  12447. /* Number of times the MPDU pool alloc failed */
  12448. A_UINT32 mpdu_pool_alloc_fail;
  12449. /* Number of times the MSDU pool alloc failed */
  12450. A_UINT32 msdu_pool_alloc_fail;
  12451. /* Number of times the tid pool freed */
  12452. A_UINT32 tid_pool_free;
  12453. /* Number of times the MPDU pool freed */
  12454. A_UINT32 mpdu_pool_free;
  12455. /* Number of times the MSDU pool freed */
  12456. A_UINT32 msdu_pool_free;
  12457. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12458. A_UINT32 msdu_queued;
  12459. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12460. A_UINT32 msdu_recycled;
  12461. /* Number of MPDUs with invalid peer but A2 found in AST */
  12462. A_UINT32 invalid_peer_a2_in_ast;
  12463. /* Number of MPDUs with invalid peer but A3 found in AST */
  12464. A_UINT32 invalid_peer_a3_in_ast;
  12465. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12466. A_UINT32 invalid_peer_bmc_mpdus;
  12467. /* Number of MSDUs with err attention word */
  12468. A_UINT32 rxdesc_err_att;
  12469. /* Number of MSDUs with flag of peer_idx_invalid */
  12470. A_UINT32 rxdesc_err_peer_idx_inv;
  12471. /* Number of MSDUs with flag of peer_idx_timeout */
  12472. A_UINT32 rxdesc_err_peer_idx_to;
  12473. /* Number of MSDUs with flag of overflow */
  12474. A_UINT32 rxdesc_err_ov;
  12475. /* Number of MSDUs with flag of msdu_length_err */
  12476. A_UINT32 rxdesc_err_msdu_len;
  12477. /* Number of MSDUs with flag of mpdu_length_err */
  12478. A_UINT32 rxdesc_err_mpdu_len;
  12479. /* Number of MSDUs with flag of tkip_mic_err */
  12480. A_UINT32 rxdesc_err_tkip_mic;
  12481. /* Number of MSDUs with flag of decrypt_err */
  12482. A_UINT32 rxdesc_err_decrypt;
  12483. /* Number of MSDUs with flag of fcs_err */
  12484. A_UINT32 rxdesc_err_fcs;
  12485. /* Number of Unicast (bc_mc bit is not set in attention word)
  12486. * frames with invalid peer handler
  12487. */
  12488. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12489. /* Number of unicast frame directly (direct bit is set in attention word)
  12490. * to DUT with invalid peer handler
  12491. */
  12492. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12493. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12494. * frames with invalid peer handler
  12495. */
  12496. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12497. /* Number of MSDUs dropped due to no first MSDU flag */
  12498. A_UINT32 rxdesc_no_1st_msdu;
  12499. /* Number of MSDUs droped due to ring overflow */
  12500. A_UINT32 msdu_drop_ring_ov;
  12501. /* Number of MSDUs dropped due to FC mismatch */
  12502. A_UINT32 msdu_drop_fc_mismatch;
  12503. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12504. A_UINT32 msdu_drop_mgmt_remote_ring;
  12505. /* Number of MSDUs dropped due to errors not reported in attention word */
  12506. A_UINT32 msdu_drop_misc;
  12507. /* Number of MSDUs go to offload before reorder */
  12508. A_UINT32 offload_msdu_wal;
  12509. /* Number of data frame dropped by offload after reorder */
  12510. A_UINT32 offload_msdu_reorder;
  12511. /* Number of MPDUs with sequence number in the past and within the BA window */
  12512. A_UINT32 dup_past_within_window;
  12513. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12514. A_UINT32 dup_past_outside_window;
  12515. /* Number of MSDUs with decrypt/MIC error */
  12516. A_UINT32 rxdesc_err_decrypt_mic;
  12517. /* Number of data MSDUs received on both local and remote rings */
  12518. A_UINT32 data_msdus_on_both_rings;
  12519. /* MPDUs never filled */
  12520. A_UINT32 holes_not_filled;
  12521. };
  12522. /*
  12523. * Rx Remote buffer statistics
  12524. * NB: all the fields must be defined in 4 octets size.
  12525. */
  12526. struct rx_remote_buffer_mgmt_stats {
  12527. /* Total number of MSDUs reaped for Rx processing */
  12528. A_UINT32 remote_reaped;
  12529. /* MSDUs recycled within firmware */
  12530. A_UINT32 remote_recycled;
  12531. /* MSDUs stored by Data Rx */
  12532. A_UINT32 data_rx_msdus_stored;
  12533. /* Number of HTT indications from WAL Rx MSDU */
  12534. A_UINT32 wal_rx_ind;
  12535. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12536. A_UINT32 wal_rx_ind_unconsumed;
  12537. /* Number of HTT indications from Data Rx MSDU */
  12538. A_UINT32 data_rx_ind;
  12539. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12540. A_UINT32 data_rx_ind_unconsumed;
  12541. /* Number of HTT indications from ATHBUF */
  12542. A_UINT32 athbuf_rx_ind;
  12543. /* Number of remote buffers requested for refill */
  12544. A_UINT32 refill_buf_req;
  12545. /* Number of remote buffers filled by the host */
  12546. A_UINT32 refill_buf_rsp;
  12547. /* Number of times MAC hw_index = f/w write_index */
  12548. A_INT32 mac_no_bufs;
  12549. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12550. A_INT32 fw_indices_equal;
  12551. /* Number of times f/w finds no buffers to post */
  12552. A_INT32 host_no_bufs;
  12553. };
  12554. /*
  12555. * TXBF MU/SU packets and NDPA statistics
  12556. * NB: all the fields must be defined in 4 octets size.
  12557. */
  12558. struct rx_txbf_musu_ndpa_pkts_stats {
  12559. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12560. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12561. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12562. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12563. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12564. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12565. };
  12566. /*
  12567. * htt_dbg_stats_status -
  12568. * present - The requested stats have been delivered in full.
  12569. * This indicates that either the stats information was contained
  12570. * in its entirety within this message, or else this message
  12571. * completes the delivery of the requested stats info that was
  12572. * partially delivered through earlier STATS_CONF messages.
  12573. * partial - The requested stats have been delivered in part.
  12574. * One or more subsequent STATS_CONF messages with the same
  12575. * cookie value will be sent to deliver the remainder of the
  12576. * information.
  12577. * error - The requested stats could not be delivered, for example due
  12578. * to a shortage of memory to construct a message holding the
  12579. * requested stats.
  12580. * invalid - The requested stat type is either not recognized, or the
  12581. * target is configured to not gather the stats type in question.
  12582. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12583. * series_done - This special value indicates that no further stats info
  12584. * elements are present within a series of stats info elems
  12585. * (within a stats upload confirmation message).
  12586. */
  12587. enum htt_dbg_stats_status {
  12588. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12589. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12590. HTT_DBG_STATS_STATUS_ERROR = 2,
  12591. HTT_DBG_STATS_STATUS_INVALID = 3,
  12592. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12593. };
  12594. /**
  12595. * @brief target -> host statistics upload
  12596. *
  12597. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12598. *
  12599. * @details
  12600. * The following field definitions describe the format of the HTT target
  12601. * to host stats upload confirmation message.
  12602. * The message contains a cookie echoed from the HTT host->target stats
  12603. * upload request, which identifies which request the confirmation is
  12604. * for, and a series of tag-length-value stats information elements.
  12605. * The tag-length header for each stats info element also includes a
  12606. * status field, to indicate whether the request for the stat type in
  12607. * question was fully met, partially met, unable to be met, or invalid
  12608. * (if the stat type in question is disabled in the target).
  12609. * A special value of all 1's in this status field is used to indicate
  12610. * the end of the series of stats info elements.
  12611. *
  12612. *
  12613. * |31 16|15 8|7 5|4 0|
  12614. * |------------------------------------------------------------|
  12615. * | reserved | msg type |
  12616. * |------------------------------------------------------------|
  12617. * | cookie LSBs |
  12618. * |------------------------------------------------------------|
  12619. * | cookie MSBs |
  12620. * |------------------------------------------------------------|
  12621. * | stats entry length | reserved | S |stat type|
  12622. * |------------------------------------------------------------|
  12623. * | |
  12624. * | type-specific stats info |
  12625. * | |
  12626. * |------------------------------------------------------------|
  12627. * | stats entry length | reserved | S |stat type|
  12628. * |------------------------------------------------------------|
  12629. * | |
  12630. * | type-specific stats info |
  12631. * | |
  12632. * |------------------------------------------------------------|
  12633. * | n/a | reserved | 111 | n/a |
  12634. * |------------------------------------------------------------|
  12635. * Header fields:
  12636. * - MSG_TYPE
  12637. * Bits 7:0
  12638. * Purpose: identifies this is a statistics upload confirmation message
  12639. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12640. * - COOKIE_LSBS
  12641. * Bits 31:0
  12642. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12643. * message with its preceding host->target stats request message.
  12644. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12645. * - COOKIE_MSBS
  12646. * Bits 31:0
  12647. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12648. * message with its preceding host->target stats request message.
  12649. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12650. *
  12651. * Stats Information Element tag-length header fields:
  12652. * - STAT_TYPE
  12653. * Bits 4:0
  12654. * Purpose: identifies the type of statistics info held in the
  12655. * following information element
  12656. * Value: htt_dbg_stats_type
  12657. * - STATUS
  12658. * Bits 7:5
  12659. * Purpose: indicate whether the requested stats are present
  12660. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12661. * the completion of the stats entry series
  12662. * - LENGTH
  12663. * Bits 31:16
  12664. * Purpose: indicate the stats information size
  12665. * Value: This field specifies the number of bytes of stats information
  12666. * that follows the element tag-length header.
  12667. * It is expected but not required that this length is a multiple of
  12668. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12669. * subsequent stats entry header will begin on a 4-byte aligned
  12670. * boundary.
  12671. */
  12672. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12673. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12674. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12675. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12676. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12677. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12678. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12679. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12680. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12681. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12682. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12683. do { \
  12684. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12685. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12686. } while (0)
  12687. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12688. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12689. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12690. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12691. do { \
  12692. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12693. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12694. } while (0)
  12695. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12696. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12697. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12698. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12699. do { \
  12700. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12701. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12702. } while (0)
  12703. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12704. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12705. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12706. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12707. #define HTT_MAX_AGGR 64
  12708. #define HTT_HL_MAX_AGGR 18
  12709. /**
  12710. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12711. *
  12712. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12713. *
  12714. * @details
  12715. * The following field definitions describe the format of the HTT host
  12716. * to target frag_desc/msdu_ext bank configuration message.
  12717. * The message contains the based address and the min and max id of the
  12718. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12719. * MSDU_EXT/FRAG_DESC.
  12720. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12721. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12722. * the hardware does the mapping/translation.
  12723. *
  12724. * Total banks that can be configured is configured to 16.
  12725. *
  12726. * This should be called before any TX has be initiated by the HTT
  12727. *
  12728. * |31 16|15 8|7 5|4 0|
  12729. * |------------------------------------------------------------|
  12730. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12731. * |------------------------------------------------------------|
  12732. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12733. #if HTT_PADDR64
  12734. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12735. #endif
  12736. * |------------------------------------------------------------|
  12737. * | ... |
  12738. * |------------------------------------------------------------|
  12739. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12740. #if HTT_PADDR64
  12741. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12742. #endif
  12743. * |------------------------------------------------------------|
  12744. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12745. * |------------------------------------------------------------|
  12746. * | ... |
  12747. * |------------------------------------------------------------|
  12748. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12749. * |------------------------------------------------------------|
  12750. * Header fields:
  12751. * - MSG_TYPE
  12752. * Bits 7:0
  12753. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12754. * for systems with 64-bit format for bus addresses:
  12755. * - BANKx_BASE_ADDRESS_LO
  12756. * Bits 31:0
  12757. * Purpose: Provide a mechanism to specify the base address of the
  12758. * MSDU_EXT bank physical/bus address.
  12759. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12760. * - BANKx_BASE_ADDRESS_HI
  12761. * Bits 31:0
  12762. * Purpose: Provide a mechanism to specify the base address of the
  12763. * MSDU_EXT bank physical/bus address.
  12764. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12765. * for systems with 32-bit format for bus addresses:
  12766. * - BANKx_BASE_ADDRESS
  12767. * Bits 31:0
  12768. * Purpose: Provide a mechanism to specify the base address of the
  12769. * MSDU_EXT bank physical/bus address.
  12770. * Value: MSDU_EXT bank physical / bus address
  12771. * - BANKx_MIN_ID
  12772. * Bits 15:0
  12773. * Purpose: Provide a mechanism to specify the min index that needs to
  12774. * mapped.
  12775. * - BANKx_MAX_ID
  12776. * Bits 31:16
  12777. * Purpose: Provide a mechanism to specify the max index that needs to
  12778. * mapped.
  12779. *
  12780. */
  12781. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12782. * safe value.
  12783. * @note MAX supported banks is 16.
  12784. */
  12785. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12786. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12787. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12788. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12789. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12790. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12791. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12792. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12793. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12794. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12795. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12796. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12797. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12798. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12799. do { \
  12800. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12801. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12802. } while (0)
  12803. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12804. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12805. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12806. do { \
  12807. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12808. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12809. } while (0)
  12810. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12811. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12812. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12813. do { \
  12814. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12815. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12816. } while (0)
  12817. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12818. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12819. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12820. do { \
  12821. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12822. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12823. } while (0)
  12824. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12825. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12826. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12827. do { \
  12828. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12829. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12830. } while (0)
  12831. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12832. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12833. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12834. do { \
  12835. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12836. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12837. } while (0)
  12838. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12839. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12840. /*
  12841. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12842. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12843. * addresses are stored in a XXX-bit field.
  12844. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12845. * htt_tx_frag_desc64_bank_cfg_t structs.
  12846. */
  12847. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12848. _paddr_bits_, \
  12849. _paddr__bank_base_address_) \
  12850. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12851. /** word 0 \
  12852. * msg_type: 8, \
  12853. * pdev_id: 2, \
  12854. * swap: 1, \
  12855. * reserved0: 5, \
  12856. * num_banks: 8, \
  12857. * desc_size: 8; \
  12858. */ \
  12859. A_UINT32 word0; \
  12860. /* \
  12861. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12862. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12863. * the second A_UINT32). \
  12864. */ \
  12865. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12866. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12867. } POSTPACK
  12868. /* define htt_tx_frag_desc32_bank_cfg_t */
  12869. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12870. /* define htt_tx_frag_desc64_bank_cfg_t */
  12871. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12872. /*
  12873. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12874. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12875. */
  12876. #if HTT_PADDR64
  12877. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12878. #else
  12879. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12880. #endif
  12881. /**
  12882. * @brief target -> host HTT TX Credit total count update message definition
  12883. *
  12884. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12885. *
  12886. *|31 16|15|14 9| 8 |7 0 |
  12887. *|---------------------+--+----------+-------+----------|
  12888. *|cur htt credit delta | Q| reserved | sign | msg type |
  12889. *|------------------------------------------------------|
  12890. *
  12891. * Header fields:
  12892. * - MSG_TYPE
  12893. * Bits 7:0
  12894. * Purpose: identifies this as a htt tx credit delta update message
  12895. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12896. * - SIGN
  12897. * Bits 8
  12898. * identifies whether credit delta is positive or negative
  12899. * Value:
  12900. * - 0x0: credit delta is positive, rebalance in some buffers
  12901. * - 0x1: credit delta is negative, rebalance out some buffers
  12902. * - reserved
  12903. * Bits 14:9
  12904. * Value: 0x0
  12905. * - TXQ_GRP
  12906. * Bit 15
  12907. * Purpose: indicates whether any tx queue group information elements
  12908. * are appended to the tx credit update message
  12909. * Value: 0 -> no tx queue group information element is present
  12910. * 1 -> a tx queue group information element immediately follows
  12911. * - DELTA_COUNT
  12912. * Bits 31:16
  12913. * Purpose: Specify current htt credit delta absolute count
  12914. */
  12915. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12916. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12917. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12918. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12919. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12920. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12921. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12922. do { \
  12923. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12924. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12925. } while (0)
  12926. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12927. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12928. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12929. do { \
  12930. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12931. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12932. } while (0)
  12933. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12934. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12935. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12936. do { \
  12937. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12938. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12939. } while (0)
  12940. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12941. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12942. #define HTT_TX_CREDIT_MSG_BYTES 4
  12943. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12944. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12945. /**
  12946. * @brief HTT WDI_IPA Operation Response Message
  12947. *
  12948. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12949. *
  12950. * @details
  12951. * HTT WDI_IPA Operation Response message is sent by target
  12952. * to host confirming suspend or resume operation.
  12953. * |31 24|23 16|15 8|7 0|
  12954. * |----------------+----------------+----------------+----------------|
  12955. * | op_code | Rsvd | msg_type |
  12956. * |-------------------------------------------------------------------|
  12957. * | Rsvd | Response len |
  12958. * |-------------------------------------------------------------------|
  12959. * | |
  12960. * | Response-type specific info |
  12961. * | |
  12962. * | |
  12963. * |-------------------------------------------------------------------|
  12964. * Header fields:
  12965. * - MSG_TYPE
  12966. * Bits 7:0
  12967. * Purpose: Identifies this as WDI_IPA Operation Response message
  12968. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12969. * - OP_CODE
  12970. * Bits 31:16
  12971. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12972. * value: = enum htt_wdi_ipa_op_code
  12973. * - RSP_LEN
  12974. * Bits 16:0
  12975. * Purpose: length for the response-type specific info
  12976. * value: = length in bytes for response-type specific info
  12977. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12978. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12979. */
  12980. PREPACK struct htt_wdi_ipa_op_response_t
  12981. {
  12982. /* DWORD 0: flags and meta-data */
  12983. A_UINT32
  12984. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12985. reserved1: 8,
  12986. op_code: 16;
  12987. A_UINT32
  12988. rsp_len: 16,
  12989. reserved2: 16;
  12990. } POSTPACK;
  12991. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12992. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12993. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12994. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12995. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12996. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12997. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12998. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12999. do { \
  13000. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13001. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13002. } while (0)
  13003. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13004. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13005. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13006. do { \
  13007. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13008. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13009. } while (0)
  13010. enum htt_phy_mode {
  13011. htt_phy_mode_11a = 0,
  13012. htt_phy_mode_11g = 1,
  13013. htt_phy_mode_11b = 2,
  13014. htt_phy_mode_11g_only = 3,
  13015. htt_phy_mode_11na_ht20 = 4,
  13016. htt_phy_mode_11ng_ht20 = 5,
  13017. htt_phy_mode_11na_ht40 = 6,
  13018. htt_phy_mode_11ng_ht40 = 7,
  13019. htt_phy_mode_11ac_vht20 = 8,
  13020. htt_phy_mode_11ac_vht40 = 9,
  13021. htt_phy_mode_11ac_vht80 = 10,
  13022. htt_phy_mode_11ac_vht20_2g = 11,
  13023. htt_phy_mode_11ac_vht40_2g = 12,
  13024. htt_phy_mode_11ac_vht80_2g = 13,
  13025. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13026. htt_phy_mode_11ac_vht160 = 15,
  13027. htt_phy_mode_max,
  13028. };
  13029. /**
  13030. * @brief target -> host HTT channel change indication
  13031. *
  13032. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13033. *
  13034. * @details
  13035. * Specify when a channel change occurs.
  13036. * This allows the host to precisely determine which rx frames arrived
  13037. * on the old channel and which rx frames arrived on the new channel.
  13038. *
  13039. *|31 |7 0 |
  13040. *|-------------------------------------------+----------|
  13041. *| reserved | msg type |
  13042. *|------------------------------------------------------|
  13043. *| primary_chan_center_freq_mhz |
  13044. *|------------------------------------------------------|
  13045. *| contiguous_chan1_center_freq_mhz |
  13046. *|------------------------------------------------------|
  13047. *| contiguous_chan2_center_freq_mhz |
  13048. *|------------------------------------------------------|
  13049. *| phy_mode |
  13050. *|------------------------------------------------------|
  13051. *
  13052. * Header fields:
  13053. * - MSG_TYPE
  13054. * Bits 7:0
  13055. * Purpose: identifies this as a htt channel change indication message
  13056. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13057. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13058. * Bits 31:0
  13059. * Purpose: identify the (center of the) new 20 MHz primary channel
  13060. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13061. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13062. * Bits 31:0
  13063. * Purpose: identify the (center of the) contiguous frequency range
  13064. * comprising the new channel.
  13065. * For example, if the new channel is a 80 MHz channel extending
  13066. * 60 MHz beyond the primary channel, this field would be 30 larger
  13067. * than the primary channel center frequency field.
  13068. * Value: center frequency of the contiguous frequency range comprising
  13069. * the full channel in MHz units
  13070. * (80+80 channels also use the CONTIG_CHAN2 field)
  13071. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13072. * Bits 31:0
  13073. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13074. * within a VHT 80+80 channel.
  13075. * This field is only relevant for VHT 80+80 channels.
  13076. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13077. * channel (arbitrary value for cases besides VHT 80+80)
  13078. * - PHY_MODE
  13079. * Bits 31:0
  13080. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13081. * and band
  13082. * Value: htt_phy_mode enum value
  13083. */
  13084. PREPACK struct htt_chan_change_t
  13085. {
  13086. /* DWORD 0: flags and meta-data */
  13087. A_UINT32
  13088. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13089. reserved1: 24;
  13090. A_UINT32 primary_chan_center_freq_mhz;
  13091. A_UINT32 contig_chan1_center_freq_mhz;
  13092. A_UINT32 contig_chan2_center_freq_mhz;
  13093. A_UINT32 phy_mode;
  13094. } POSTPACK;
  13095. /*
  13096. * Due to historical / backwards-compatibility reasons, maintain the
  13097. * below htt_chan_change_msg struct definition, which needs to be
  13098. * consistent with the above htt_chan_change_t struct definition
  13099. * (aside from the htt_chan_change_t definition including the msg_type
  13100. * dword within the message, and the htt_chan_change_msg only containing
  13101. * the payload of the message that follows the msg_type dword).
  13102. */
  13103. PREPACK struct htt_chan_change_msg {
  13104. A_UINT32 chan_mhz; /* frequency in mhz */
  13105. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13106. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13107. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13108. } POSTPACK;
  13109. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13110. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13111. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13112. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13113. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13114. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13115. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13116. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13117. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13118. do { \
  13119. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13120. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13121. } while (0)
  13122. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13123. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13124. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13125. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13126. do { \
  13127. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13128. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13129. } while (0)
  13130. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13131. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13132. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13133. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13134. do { \
  13135. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13136. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13137. } while (0)
  13138. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13139. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13140. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13141. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13142. do { \
  13143. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13144. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13145. } while (0)
  13146. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13147. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13148. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13149. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13150. /**
  13151. * @brief rx offload packet error message
  13152. *
  13153. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13154. *
  13155. * @details
  13156. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13157. * of target payload like mic err.
  13158. *
  13159. * |31 24|23 16|15 8|7 0|
  13160. * |----------------+----------------+----------------+----------------|
  13161. * | tid | vdev_id | msg_sub_type | msg_type |
  13162. * |-------------------------------------------------------------------|
  13163. * : (sub-type dependent content) :
  13164. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13165. * Header fields:
  13166. * - msg_type
  13167. * Bits 7:0
  13168. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13169. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13170. * - msg_sub_type
  13171. * Bits 15:8
  13172. * Purpose: Identifies which type of rx error is reported by this message
  13173. * value: htt_rx_ofld_pkt_err_type
  13174. * - vdev_id
  13175. * Bits 23:16
  13176. * Purpose: Identifies which vdev received the erroneous rx frame
  13177. * value:
  13178. * - tid
  13179. * Bits 31:24
  13180. * Purpose: Identifies the traffic type of the rx frame
  13181. * value:
  13182. *
  13183. * - The payload fields used if the sub-type == MIC error are shown below.
  13184. * Note - MIC err is per MSDU, while PN is per MPDU.
  13185. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13186. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13187. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13188. * instead of sending separate HTT messages for each wrong MSDU within
  13189. * the MPDU.
  13190. *
  13191. * |31 24|23 16|15 8|7 0|
  13192. * |----------------+----------------+----------------+----------------|
  13193. * | Rsvd | key_id | peer_id |
  13194. * |-------------------------------------------------------------------|
  13195. * | receiver MAC addr 31:0 |
  13196. * |-------------------------------------------------------------------|
  13197. * | Rsvd | receiver MAC addr 47:32 |
  13198. * |-------------------------------------------------------------------|
  13199. * | transmitter MAC addr 31:0 |
  13200. * |-------------------------------------------------------------------|
  13201. * | Rsvd | transmitter MAC addr 47:32 |
  13202. * |-------------------------------------------------------------------|
  13203. * | PN 31:0 |
  13204. * |-------------------------------------------------------------------|
  13205. * | Rsvd | PN 47:32 |
  13206. * |-------------------------------------------------------------------|
  13207. * - peer_id
  13208. * Bits 15:0
  13209. * Purpose: identifies which peer is frame is from
  13210. * value:
  13211. * - key_id
  13212. * Bits 23:16
  13213. * Purpose: identifies key_id of rx frame
  13214. * value:
  13215. * - RA_31_0 (receiver MAC addr 31:0)
  13216. * Bits 31:0
  13217. * Purpose: identifies by MAC address which vdev received the frame
  13218. * value: MAC address lower 4 bytes
  13219. * - RA_47_32 (receiver MAC addr 47:32)
  13220. * Bits 15:0
  13221. * Purpose: identifies by MAC address which vdev received the frame
  13222. * value: MAC address upper 2 bytes
  13223. * - TA_31_0 (transmitter MAC addr 31:0)
  13224. * Bits 31:0
  13225. * Purpose: identifies by MAC address which peer transmitted the frame
  13226. * value: MAC address lower 4 bytes
  13227. * - TA_47_32 (transmitter MAC addr 47:32)
  13228. * Bits 15:0
  13229. * Purpose: identifies by MAC address which peer transmitted the frame
  13230. * value: MAC address upper 2 bytes
  13231. * - PN_31_0
  13232. * Bits 31:0
  13233. * Purpose: Identifies pn of rx frame
  13234. * value: PN lower 4 bytes
  13235. * - PN_47_32
  13236. * Bits 15:0
  13237. * Purpose: Identifies pn of rx frame
  13238. * value:
  13239. * TKIP or CCMP: PN upper 2 bytes
  13240. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13241. */
  13242. enum htt_rx_ofld_pkt_err_type {
  13243. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13244. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13245. };
  13246. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13247. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13248. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13249. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13250. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13251. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13252. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13253. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13254. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13255. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13256. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13257. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13258. do { \
  13259. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13260. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13261. } while (0)
  13262. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13263. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13264. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13265. do { \
  13266. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13267. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13268. } while (0)
  13269. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13270. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13271. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13272. do { \
  13273. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13274. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13275. } while (0)
  13276. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13277. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13278. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13279. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13280. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13281. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13282. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13283. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13284. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13285. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13286. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13287. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13288. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13289. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13290. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13291. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13292. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13293. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13294. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13295. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13296. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13297. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13298. do { \
  13299. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13300. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13301. } while (0)
  13302. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13303. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13304. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13305. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13306. do { \
  13307. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13308. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13309. } while (0)
  13310. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13311. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13312. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13313. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13314. do { \
  13315. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13316. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13317. } while (0)
  13318. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13319. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13320. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13321. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13322. do { \
  13323. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13324. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13325. } while (0)
  13326. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13327. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13328. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13329. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13330. do { \
  13331. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13332. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13333. } while (0)
  13334. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13335. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13336. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13337. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13338. do { \
  13339. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13340. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13341. } while (0)
  13342. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13343. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13344. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13345. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13346. do { \
  13347. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13348. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13349. } while (0)
  13350. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13351. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13352. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13353. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13354. do { \
  13355. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13356. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13357. } while (0)
  13358. /**
  13359. * @brief target -> host peer rate report message
  13360. *
  13361. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13362. *
  13363. * @details
  13364. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13365. * justified rate of all the peers.
  13366. *
  13367. * |31 24|23 16|15 8|7 0|
  13368. * |----------------+----------------+----------------+----------------|
  13369. * | peer_count | | msg_type |
  13370. * |-------------------------------------------------------------------|
  13371. * : Payload (variant number of peer rate report) :
  13372. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13373. * Header fields:
  13374. * - msg_type
  13375. * Bits 7:0
  13376. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13377. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13378. * - reserved
  13379. * Bits 15:8
  13380. * Purpose:
  13381. * value:
  13382. * - peer_count
  13383. * Bits 31:16
  13384. * Purpose: Specify how many peer rate report elements are present in the payload.
  13385. * value:
  13386. *
  13387. * Payload:
  13388. * There are variant number of peer rate report follow the first 32 bits.
  13389. * The peer rate report is defined as follows.
  13390. *
  13391. * |31 20|19 16|15 0|
  13392. * |-----------------------+---------+---------------------------------|-
  13393. * | reserved | phy | peer_id | \
  13394. * |-------------------------------------------------------------------| -> report #0
  13395. * | rate | /
  13396. * |-----------------------+---------+---------------------------------|-
  13397. * | reserved | phy | peer_id | \
  13398. * |-------------------------------------------------------------------| -> report #1
  13399. * | rate | /
  13400. * |-----------------------+---------+---------------------------------|-
  13401. * | reserved | phy | peer_id | \
  13402. * |-------------------------------------------------------------------| -> report #2
  13403. * | rate | /
  13404. * |-------------------------------------------------------------------|-
  13405. * : :
  13406. * : :
  13407. * : :
  13408. * :-------------------------------------------------------------------:
  13409. *
  13410. * - peer_id
  13411. * Bits 15:0
  13412. * Purpose: identify the peer
  13413. * value:
  13414. * - phy
  13415. * Bits 19:16
  13416. * Purpose: identify which phy is in use
  13417. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13418. * Please see enum htt_peer_report_phy_type for detail.
  13419. * - reserved
  13420. * Bits 31:20
  13421. * Purpose:
  13422. * value:
  13423. * - rate
  13424. * Bits 31:0
  13425. * Purpose: represent the justified rate of the peer specified by peer_id
  13426. * value:
  13427. */
  13428. enum htt_peer_rate_report_phy_type {
  13429. HTT_PEER_RATE_REPORT_11B = 0,
  13430. HTT_PEER_RATE_REPORT_11A_G,
  13431. HTT_PEER_RATE_REPORT_11N,
  13432. HTT_PEER_RATE_REPORT_11AC,
  13433. };
  13434. #define HTT_PEER_RATE_REPORT_SIZE 8
  13435. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13436. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13437. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13438. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13439. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13440. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13441. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13442. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13443. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13444. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13445. do { \
  13446. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13447. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13448. } while (0)
  13449. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13450. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13451. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13452. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13453. do { \
  13454. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13455. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13456. } while (0)
  13457. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13458. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13459. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13460. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13461. do { \
  13462. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13463. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13464. } while (0)
  13465. /**
  13466. * @brief target -> host flow pool map message
  13467. *
  13468. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13469. *
  13470. * @details
  13471. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13472. * a flow of descriptors.
  13473. *
  13474. * This message is in TLV format and indicates the parameters to be setup a
  13475. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13476. * receive descriptors from a specified pool.
  13477. *
  13478. * The message would appear as follows:
  13479. *
  13480. * |31 24|23 16|15 8|7 0|
  13481. * |----------------+----------------+----------------+----------------|
  13482. * header | reserved | num_flows | msg_type |
  13483. * |-------------------------------------------------------------------|
  13484. * | |
  13485. * : payload :
  13486. * | |
  13487. * |-------------------------------------------------------------------|
  13488. *
  13489. * The header field is one DWORD long and is interpreted as follows:
  13490. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13491. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13492. * this message
  13493. * b'16-31 - reserved: These bits are reserved for future use
  13494. *
  13495. * Payload:
  13496. * The payload would contain multiple objects of the following structure. Each
  13497. * object represents a flow.
  13498. *
  13499. * |31 24|23 16|15 8|7 0|
  13500. * |----------------+----------------+----------------+----------------|
  13501. * header | reserved | num_flows | msg_type |
  13502. * |-------------------------------------------------------------------|
  13503. * payload0| flow_type |
  13504. * |-------------------------------------------------------------------|
  13505. * | flow_id |
  13506. * |-------------------------------------------------------------------|
  13507. * | reserved0 | flow_pool_id |
  13508. * |-------------------------------------------------------------------|
  13509. * | reserved1 | flow_pool_size |
  13510. * |-------------------------------------------------------------------|
  13511. * | reserved2 |
  13512. * |-------------------------------------------------------------------|
  13513. * payload1| flow_type |
  13514. * |-------------------------------------------------------------------|
  13515. * | flow_id |
  13516. * |-------------------------------------------------------------------|
  13517. * | reserved0 | flow_pool_id |
  13518. * |-------------------------------------------------------------------|
  13519. * | reserved1 | flow_pool_size |
  13520. * |-------------------------------------------------------------------|
  13521. * | reserved2 |
  13522. * |-------------------------------------------------------------------|
  13523. * | . |
  13524. * | . |
  13525. * | . |
  13526. * |-------------------------------------------------------------------|
  13527. *
  13528. * Each payload is 5 DWORDS long and is interpreted as follows:
  13529. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13530. * this flow is associated. It can be VDEV, peer,
  13531. * or tid (AC). Based on enum htt_flow_type.
  13532. *
  13533. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13534. * object. For flow_type vdev it is set to the
  13535. * vdevid, for peer it is peerid and for tid, it is
  13536. * tid_num.
  13537. *
  13538. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13539. * in the host for this flow
  13540. * b'16:31 - reserved0: This field in reserved for the future. In case
  13541. * we have a hierarchical implementation (HCM) of
  13542. * pools, it can be used to indicate the ID of the
  13543. * parent-pool.
  13544. *
  13545. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13546. * Descriptors for this flow will be
  13547. * allocated from this pool in the host.
  13548. * b'16:31 - reserved1: This field in reserved for the future. In case
  13549. * we have a hierarchical implementation of pools,
  13550. * it can be used to indicate the max number of
  13551. * descriptors in the pool. The b'0:15 can be used
  13552. * to indicate min number of descriptors in the
  13553. * HCM scheme.
  13554. *
  13555. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13556. * we have a hierarchical implementation of pools,
  13557. * b'0:15 can be used to indicate the
  13558. * priority-based borrowing (PBB) threshold of
  13559. * the flow's pool. The b'16:31 are still left
  13560. * reserved.
  13561. */
  13562. enum htt_flow_type {
  13563. FLOW_TYPE_VDEV = 0,
  13564. /* Insert new flow types above this line */
  13565. };
  13566. PREPACK struct htt_flow_pool_map_payload_t {
  13567. A_UINT32 flow_type;
  13568. A_UINT32 flow_id;
  13569. A_UINT32 flow_pool_id:16,
  13570. reserved0:16;
  13571. A_UINT32 flow_pool_size:16,
  13572. reserved1:16;
  13573. A_UINT32 reserved2;
  13574. } POSTPACK;
  13575. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13576. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13577. (sizeof(struct htt_flow_pool_map_payload_t))
  13578. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13579. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13580. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13581. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13582. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13583. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13584. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13585. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13586. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13587. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13588. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13589. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13590. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13591. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13592. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13593. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13594. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13595. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13596. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13597. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13598. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13599. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13600. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13601. do { \
  13602. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13603. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13604. } while (0)
  13605. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13606. do { \
  13607. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13608. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13609. } while (0)
  13610. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13611. do { \
  13612. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13613. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13614. } while (0)
  13615. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13616. do { \
  13617. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13618. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13619. } while (0)
  13620. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13621. do { \
  13622. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13623. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13624. } while (0)
  13625. /**
  13626. * @brief target -> host flow pool unmap message
  13627. *
  13628. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13629. *
  13630. * @details
  13631. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13632. * down a flow of descriptors.
  13633. * This message indicates that for the flow (whose ID is provided) is wanting
  13634. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13635. * pool of descriptors from where descriptors are being allocated for this
  13636. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13637. * be unmapped by the host.
  13638. *
  13639. * The message would appear as follows:
  13640. *
  13641. * |31 24|23 16|15 8|7 0|
  13642. * |----------------+----------------+----------------+----------------|
  13643. * | reserved0 | msg_type |
  13644. * |-------------------------------------------------------------------|
  13645. * | flow_type |
  13646. * |-------------------------------------------------------------------|
  13647. * | flow_id |
  13648. * |-------------------------------------------------------------------|
  13649. * | reserved1 | flow_pool_id |
  13650. * |-------------------------------------------------------------------|
  13651. *
  13652. * The message is interpreted as follows:
  13653. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13654. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13655. * b'8:31 - reserved0: Reserved for future use
  13656. *
  13657. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13658. * this flow is associated. It can be VDEV, peer,
  13659. * or tid (AC). Based on enum htt_flow_type.
  13660. *
  13661. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13662. * object. For flow_type vdev it is set to the
  13663. * vdevid, for peer it is peerid and for tid, it is
  13664. * tid_num.
  13665. *
  13666. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13667. * used in the host for this flow
  13668. * b'16:31 - reserved0: This field in reserved for the future.
  13669. *
  13670. */
  13671. PREPACK struct htt_flow_pool_unmap_t {
  13672. A_UINT32 msg_type:8,
  13673. reserved0:24;
  13674. A_UINT32 flow_type;
  13675. A_UINT32 flow_id;
  13676. A_UINT32 flow_pool_id:16,
  13677. reserved1:16;
  13678. } POSTPACK;
  13679. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13680. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13681. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13682. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13683. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13684. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13685. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13686. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13687. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13688. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13689. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13690. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13691. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13692. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13693. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13694. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13695. do { \
  13696. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13697. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13698. } while (0)
  13699. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13700. do { \
  13701. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13702. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13703. } while (0)
  13704. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13705. do { \
  13706. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13707. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13708. } while (0)
  13709. /**
  13710. * @brief target -> host SRING setup done message
  13711. *
  13712. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13713. *
  13714. * @details
  13715. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13716. * SRNG ring setup is done
  13717. *
  13718. * This message indicates whether the last setup operation is successful.
  13719. * It will be sent to host when host set respose_required bit in
  13720. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13721. * The message would appear as follows:
  13722. *
  13723. * |31 24|23 16|15 8|7 0|
  13724. * |--------------- +----------------+----------------+----------------|
  13725. * | setup_status | ring_id | pdev_id | msg_type |
  13726. * |-------------------------------------------------------------------|
  13727. *
  13728. * The message is interpreted as follows:
  13729. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13730. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13731. * b'8:15 - pdev_id:
  13732. * 0 (for rings at SOC/UMAC level),
  13733. * 1/2/3 mac id (for rings at LMAC level)
  13734. * b'16:23 - ring_id: Identify the ring which is set up
  13735. * More details can be got from enum htt_srng_ring_id
  13736. * b'24:31 - setup_status: Indicate status of setup operation
  13737. * Refer to htt_ring_setup_status
  13738. */
  13739. PREPACK struct htt_sring_setup_done_t {
  13740. A_UINT32 msg_type: 8,
  13741. pdev_id: 8,
  13742. ring_id: 8,
  13743. setup_status: 8;
  13744. } POSTPACK;
  13745. enum htt_ring_setup_status {
  13746. htt_ring_setup_status_ok = 0,
  13747. htt_ring_setup_status_error,
  13748. };
  13749. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13750. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13751. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13752. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13753. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13754. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13755. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13756. do { \
  13757. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13758. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13759. } while (0)
  13760. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13761. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13762. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13763. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13764. HTT_SRING_SETUP_DONE_RING_ID_S)
  13765. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13766. do { \
  13767. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13768. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13769. } while (0)
  13770. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13771. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13772. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13773. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13774. HTT_SRING_SETUP_DONE_STATUS_S)
  13775. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13776. do { \
  13777. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13778. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13779. } while (0)
  13780. /**
  13781. * @brief target -> flow map flow info
  13782. *
  13783. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13784. *
  13785. * @details
  13786. * HTT TX map flow entry with tqm flow pointer
  13787. * Sent from firmware to host to add tqm flow pointer in corresponding
  13788. * flow search entry. Flow metadata is replayed back to host as part of this
  13789. * struct to enable host to find the specific flow search entry
  13790. *
  13791. * The message would appear as follows:
  13792. *
  13793. * |31 28|27 18|17 14|13 8|7 0|
  13794. * |-------+------------------------------------------+----------------|
  13795. * | rsvd0 | fse_hsh_idx | msg_type |
  13796. * |-------------------------------------------------------------------|
  13797. * | rsvd1 | tid | peer_id |
  13798. * |-------------------------------------------------------------------|
  13799. * | tqm_flow_pntr_lo |
  13800. * |-------------------------------------------------------------------|
  13801. * | tqm_flow_pntr_hi |
  13802. * |-------------------------------------------------------------------|
  13803. * | fse_meta_data |
  13804. * |-------------------------------------------------------------------|
  13805. *
  13806. * The message is interpreted as follows:
  13807. *
  13808. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13809. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13810. *
  13811. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13812. * for this flow entry
  13813. *
  13814. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13815. *
  13816. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13817. *
  13818. * dword1 - b'14:17 - tid
  13819. *
  13820. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13821. *
  13822. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13823. *
  13824. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13825. *
  13826. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13827. * given by host
  13828. */
  13829. PREPACK struct htt_tx_map_flow_info {
  13830. A_UINT32
  13831. msg_type: 8,
  13832. fse_hsh_idx: 20,
  13833. rsvd0: 4;
  13834. A_UINT32
  13835. peer_id: 14,
  13836. tid: 4,
  13837. rsvd1: 14;
  13838. A_UINT32 tqm_flow_pntr_lo;
  13839. A_UINT32 tqm_flow_pntr_hi;
  13840. struct htt_tx_flow_metadata fse_meta_data;
  13841. } POSTPACK;
  13842. /* DWORD 0 */
  13843. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13844. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13845. /* DWORD 1 */
  13846. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13847. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13848. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13849. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13850. /* DWORD 0 */
  13851. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13852. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13853. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13854. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13855. do { \
  13856. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13857. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13858. } while (0)
  13859. /* DWORD 1 */
  13860. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13861. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13862. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13863. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13864. do { \
  13865. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13866. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13867. } while (0)
  13868. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13869. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13870. HTT_TX_MAP_FLOW_INFO_TID_S)
  13871. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13872. do { \
  13873. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13874. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13875. } while (0)
  13876. /*
  13877. * htt_dbg_ext_stats_status -
  13878. * present - The requested stats have been delivered in full.
  13879. * This indicates that either the stats information was contained
  13880. * in its entirety within this message, or else this message
  13881. * completes the delivery of the requested stats info that was
  13882. * partially delivered through earlier STATS_CONF messages.
  13883. * partial - The requested stats have been delivered in part.
  13884. * One or more subsequent STATS_CONF messages with the same
  13885. * cookie value will be sent to deliver the remainder of the
  13886. * information.
  13887. * error - The requested stats could not be delivered, for example due
  13888. * to a shortage of memory to construct a message holding the
  13889. * requested stats.
  13890. * invalid - The requested stat type is either not recognized, or the
  13891. * target is configured to not gather the stats type in question.
  13892. */
  13893. enum htt_dbg_ext_stats_status {
  13894. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13895. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13896. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13897. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13898. };
  13899. /**
  13900. * @brief target -> host ppdu stats upload
  13901. *
  13902. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13903. *
  13904. * @details
  13905. * The following field definitions describe the format of the HTT target
  13906. * to host ppdu stats indication message.
  13907. *
  13908. *
  13909. * |31 16|15 12|11 10|9 8|7 0 |
  13910. * |----------------------------------------------------------------------|
  13911. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13912. * |----------------------------------------------------------------------|
  13913. * | ppdu_id |
  13914. * |----------------------------------------------------------------------|
  13915. * | Timestamp in us |
  13916. * |----------------------------------------------------------------------|
  13917. * | reserved |
  13918. * |----------------------------------------------------------------------|
  13919. * | type-specific stats info |
  13920. * | (see htt_ppdu_stats.h) |
  13921. * |----------------------------------------------------------------------|
  13922. * Header fields:
  13923. * - MSG_TYPE
  13924. * Bits 7:0
  13925. * Purpose: Identifies this is a PPDU STATS indication
  13926. * message.
  13927. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13928. * - mac_id
  13929. * Bits 9:8
  13930. * Purpose: mac_id of this ppdu_id
  13931. * Value: 0-3
  13932. * - pdev_id
  13933. * Bits 11:10
  13934. * Purpose: pdev_id of this ppdu_id
  13935. * Value: 0-3
  13936. * 0 (for rings at SOC level),
  13937. * 1/2/3 PDEV -> 0/1/2
  13938. * - payload_size
  13939. * Bits 31:16
  13940. * Purpose: total tlv size
  13941. * Value: payload_size in bytes
  13942. */
  13943. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13944. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13945. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13946. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13947. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13948. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13949. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13950. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13951. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13952. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13953. do { \
  13954. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13955. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13956. } while (0)
  13957. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13958. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13959. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13960. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13961. do { \
  13962. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13963. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13964. } while (0)
  13965. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13966. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13967. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13968. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13969. do { \
  13970. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13971. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13972. } while (0)
  13973. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13974. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13975. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13976. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13977. do { \
  13978. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13979. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13980. } while (0)
  13981. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13982. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13983. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13984. /* htt_t2h_ppdu_stats_ind_hdr_t
  13985. * This struct contains the fields within the header of the
  13986. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13987. * stats info.
  13988. * This struct assumes little-endian layout, and thus is only
  13989. * suitable for use within processors known to be little-endian
  13990. * (such as the target).
  13991. * In contrast, the above macros provide endian-portable methods
  13992. * to get and set the bitfields within this PPDU_STATS_IND header.
  13993. */
  13994. typedef struct {
  13995. A_UINT32 msg_type: 8, /* bits 7:0 */
  13996. mac_id: 2, /* bits 9:8 */
  13997. pdev_id: 2, /* bits 11:10 */
  13998. reserved1: 4, /* bits 15:12 */
  13999. payload_size: 16; /* bits 31:16 */
  14000. A_UINT32 ppdu_id;
  14001. A_UINT32 timestamp_us;
  14002. A_UINT32 reserved2;
  14003. } htt_t2h_ppdu_stats_ind_hdr_t;
  14004. /**
  14005. * @brief target -> host extended statistics upload
  14006. *
  14007. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14008. *
  14009. * @details
  14010. * The following field definitions describe the format of the HTT target
  14011. * to host stats upload confirmation message.
  14012. * The message contains a cookie echoed from the HTT host->target stats
  14013. * upload request, which identifies which request the confirmation is
  14014. * for, and a single stats can span over multiple HTT stats indication
  14015. * due to the HTT message size limitation so every HTT ext stats indication
  14016. * will have tag-length-value stats information elements.
  14017. * The tag-length header for each HTT stats IND message also includes a
  14018. * status field, to indicate whether the request for the stat type in
  14019. * question was fully met, partially met, unable to be met, or invalid
  14020. * (if the stat type in question is disabled in the target).
  14021. * A Done bit 1's indicate the end of the of stats info elements.
  14022. *
  14023. *
  14024. * |31 16|15 12|11|10 8|7 5|4 0|
  14025. * |--------------------------------------------------------------|
  14026. * | reserved | msg type |
  14027. * |--------------------------------------------------------------|
  14028. * | cookie LSBs |
  14029. * |--------------------------------------------------------------|
  14030. * | cookie MSBs |
  14031. * |--------------------------------------------------------------|
  14032. * | stats entry length | rsvd | D| S | stat type |
  14033. * |--------------------------------------------------------------|
  14034. * | type-specific stats info |
  14035. * | (see htt_stats.h) |
  14036. * |--------------------------------------------------------------|
  14037. * Header fields:
  14038. * - MSG_TYPE
  14039. * Bits 7:0
  14040. * Purpose: Identifies this is a extended statistics upload confirmation
  14041. * message.
  14042. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14043. * - COOKIE_LSBS
  14044. * Bits 31:0
  14045. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14046. * message with its preceding host->target stats request message.
  14047. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14048. * - COOKIE_MSBS
  14049. * Bits 31:0
  14050. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14051. * message with its preceding host->target stats request message.
  14052. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14053. *
  14054. * Stats Information Element tag-length header fields:
  14055. * - STAT_TYPE
  14056. * Bits 7:0
  14057. * Purpose: identifies the type of statistics info held in the
  14058. * following information element
  14059. * Value: htt_dbg_ext_stats_type
  14060. * - STATUS
  14061. * Bits 10:8
  14062. * Purpose: indicate whether the requested stats are present
  14063. * Value: htt_dbg_ext_stats_status
  14064. * - DONE
  14065. * Bits 11
  14066. * Purpose:
  14067. * Indicates the completion of the stats entry, this will be the last
  14068. * stats conf HTT segment for the requested stats type.
  14069. * Value:
  14070. * 0 -> the stats retrieval is ongoing
  14071. * 1 -> the stats retrieval is complete
  14072. * - LENGTH
  14073. * Bits 31:16
  14074. * Purpose: indicate the stats information size
  14075. * Value: This field specifies the number of bytes of stats information
  14076. * that follows the element tag-length header.
  14077. * It is expected but not required that this length is a multiple of
  14078. * 4 bytes.
  14079. */
  14080. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14081. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14082. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14083. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14084. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14085. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14086. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14087. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14088. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14089. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14090. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14091. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14092. do { \
  14093. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14094. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14095. } while (0)
  14096. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14097. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14098. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14099. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14100. do { \
  14101. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14102. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14103. } while (0)
  14104. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14105. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14106. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14107. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14108. do { \
  14109. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14110. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14111. } while (0)
  14112. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14113. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14114. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14115. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14116. do { \
  14117. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14118. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14119. } while (0)
  14120. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14121. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14122. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14123. typedef enum {
  14124. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14125. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14126. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14127. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14128. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14129. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14130. /* Reserved from 128 - 255 for target internal use.*/
  14131. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14132. } HTT_PEER_TYPE;
  14133. /** macro to convert MAC address from char array to HTT word format */
  14134. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14135. (phtt_mac_addr)->mac_addr31to0 = \
  14136. (((c_macaddr)[0] << 0) | \
  14137. ((c_macaddr)[1] << 8) | \
  14138. ((c_macaddr)[2] << 16) | \
  14139. ((c_macaddr)[3] << 24)); \
  14140. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14141. } while (0)
  14142. /**
  14143. * @brief target -> host monitor mac header indication message
  14144. *
  14145. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14146. *
  14147. * @details
  14148. * The following diagram shows the format of the monitor mac header message
  14149. * sent from the target to the host.
  14150. * This message is primarily sent when promiscuous rx mode is enabled.
  14151. * One message is sent per rx PPDU.
  14152. *
  14153. * |31 24|23 16|15 8|7 0|
  14154. * |-------------------------------------------------------------|
  14155. * | peer_id | reserved0 | msg_type |
  14156. * |-------------------------------------------------------------|
  14157. * | reserved1 | num_mpdu |
  14158. * |-------------------------------------------------------------|
  14159. * | struct hw_rx_desc |
  14160. * | (see wal_rx_desc.h) |
  14161. * |-------------------------------------------------------------|
  14162. * | struct ieee80211_frame_addr4 |
  14163. * | (see ieee80211_defs.h) |
  14164. * |-------------------------------------------------------------|
  14165. * | struct ieee80211_frame_addr4 |
  14166. * | (see ieee80211_defs.h) |
  14167. * |-------------------------------------------------------------|
  14168. * | ...... |
  14169. * |-------------------------------------------------------------|
  14170. *
  14171. * Header fields:
  14172. * - msg_type
  14173. * Bits 7:0
  14174. * Purpose: Identifies this is a monitor mac header indication message.
  14175. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14176. * - peer_id
  14177. * Bits 31:16
  14178. * Purpose: Software peer id given by host during association,
  14179. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14180. * for rx PPDUs received from unassociated peers.
  14181. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14182. * - num_mpdu
  14183. * Bits 15:0
  14184. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14185. * delivered within the message.
  14186. * Value: 1 to 32
  14187. * num_mpdu is limited to a maximum value of 32, due to buffer
  14188. * size limits. For PPDUs with more than 32 MPDUs, only the
  14189. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14190. * the PPDU will be provided.
  14191. */
  14192. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14193. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14194. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14195. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14196. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14197. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14198. do { \
  14199. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14200. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14201. } while (0)
  14202. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14203. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14204. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14205. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14206. do { \
  14207. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14208. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14209. } while (0)
  14210. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14211. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14212. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14213. /**
  14214. * @brief target -> host flow pool resize Message
  14215. *
  14216. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14217. *
  14218. * @details
  14219. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14220. * the flow pool associated with the specified ID is resized
  14221. *
  14222. * The message would appear as follows:
  14223. *
  14224. * |31 16|15 8|7 0|
  14225. * |---------------------------------+----------------+----------------|
  14226. * | reserved0 | Msg type |
  14227. * |-------------------------------------------------------------------|
  14228. * | flow pool new size | flow pool ID |
  14229. * |-------------------------------------------------------------------|
  14230. *
  14231. * The message is interpreted as follows:
  14232. * b'0:7 - msg_type: This will be set to 0x21
  14233. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14234. *
  14235. * b'0:15 - flow pool ID: Existing flow pool ID
  14236. *
  14237. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14238. *
  14239. */
  14240. PREPACK struct htt_flow_pool_resize_t {
  14241. A_UINT32 msg_type:8,
  14242. reserved0:24;
  14243. A_UINT32 flow_pool_id:16,
  14244. flow_pool_new_size:16;
  14245. } POSTPACK;
  14246. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14247. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14248. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14249. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14250. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14251. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14252. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14253. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14254. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14255. do { \
  14256. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14257. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14258. } while (0)
  14259. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14260. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14261. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14262. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14263. do { \
  14264. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14265. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14266. } while (0)
  14267. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14268. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14269. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14270. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14271. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14272. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14273. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14274. /*
  14275. * The read and write indices point to the data within the host buffer.
  14276. * Because the first 4 bytes of the host buffer is used for the read index and
  14277. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14278. * The read index and write index are the byte offsets from the base of the
  14279. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14280. * Refer the ASCII text picture below.
  14281. */
  14282. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14283. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14284. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14285. /*
  14286. ***************************************************************************
  14287. *
  14288. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14289. *
  14290. ***************************************************************************
  14291. *
  14292. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14293. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14294. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14295. * written into the Host memory region mentioned below.
  14296. *
  14297. * Read index is updated by the Host. At any point of time, the read index will
  14298. * indicate the index that will next be read by the Host. The read index is
  14299. * in units of bytes offset from the base of the meta-data buffer.
  14300. *
  14301. * Write index is updated by the FW. At any point of time, the write index will
  14302. * indicate from where the FW can start writing any new data. The write index is
  14303. * in units of bytes offset from the base of the meta-data buffer.
  14304. *
  14305. * If the Host is not fast enough in reading the CFR data, any new capture data
  14306. * would be dropped if there is no space left to write the new captures.
  14307. *
  14308. * The last 4 bytes of the memory region will have the magic pattern
  14309. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14310. * not overrun the host buffer.
  14311. *
  14312. * ,--------------------. read and write indices store the
  14313. * | | byte offset from the base of the
  14314. * | ,--------+--------. meta-data buffer to the next
  14315. * | | | | location within the data buffer
  14316. * | | v v that will be read / written
  14317. * ************************************************************************
  14318. * * Read * Write * * Magic *
  14319. * * index * index * CFR data1 ...... CFR data N * pattern *
  14320. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14321. * ************************************************************************
  14322. * |<---------- data buffer ---------->|
  14323. *
  14324. * |<----------------- meta-data buffer allocated in Host ----------------|
  14325. *
  14326. * Note:
  14327. * - Considering the 4 bytes needed to store the Read index (R) and the
  14328. * Write index (W), the initial value is as follows:
  14329. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14330. * - Buffer empty condition:
  14331. * R = W
  14332. *
  14333. * Regarding CFR data format:
  14334. * --------------------------
  14335. *
  14336. * Each CFR tone is stored in HW as 16-bits with the following format:
  14337. * {bits[15:12], bits[11:6], bits[5:0]} =
  14338. * {unsigned exponent (4 bits),
  14339. * signed mantissa_real (6 bits),
  14340. * signed mantissa_imag (6 bits)}
  14341. *
  14342. * CFR_real = mantissa_real * 2^(exponent-5)
  14343. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14344. *
  14345. *
  14346. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14347. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14348. *
  14349. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14350. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14351. * .
  14352. * .
  14353. * .
  14354. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14355. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14356. */
  14357. /* Bandwidth of peer CFR captures */
  14358. typedef enum {
  14359. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14360. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14361. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14362. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14363. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14364. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14365. } HTT_PEER_CFR_CAPTURE_BW;
  14366. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14367. * was captured
  14368. */
  14369. typedef enum {
  14370. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14371. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14372. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14373. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14374. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14375. } HTT_PEER_CFR_CAPTURE_MODE;
  14376. typedef enum {
  14377. /* This message type is currently used for the below purpose:
  14378. *
  14379. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14380. * wmi_peer_cfr_capture_cmd.
  14381. * If payload_present bit is set to 0 then the associated memory region
  14382. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14383. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14384. * message; the CFR dump will be present at the end of the message,
  14385. * after the chan_phy_mode.
  14386. */
  14387. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14388. /* Always keep this last */
  14389. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14390. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14391. /**
  14392. * @brief target -> host CFR dump completion indication message definition
  14393. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14394. *
  14395. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14396. *
  14397. * @details
  14398. * The following diagram shows the format of the Channel Frequency Response
  14399. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14400. * the channel capture of a peer is copied by Firmware into the Host memory
  14401. *
  14402. * **************************************************************************
  14403. *
  14404. * Message format when the CFR capture message type is
  14405. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14406. *
  14407. * **************************************************************************
  14408. *
  14409. * |31 16|15 |8|7 0|
  14410. * |----------------------------------------------------------------|
  14411. * header: | reserved |P| msg_type |
  14412. * word 0 | | | |
  14413. * |----------------------------------------------------------------|
  14414. * payload: | cfr_capture_msg_type |
  14415. * word 1 | |
  14416. * |----------------------------------------------------------------|
  14417. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14418. * word 2 | | | | | | | | |
  14419. * |----------------------------------------------------------------|
  14420. * | mac_addr31to0 |
  14421. * word 3 | |
  14422. * |----------------------------------------------------------------|
  14423. * | unused / reserved | mac_addr47to32 |
  14424. * word 4 | | |
  14425. * |----------------------------------------------------------------|
  14426. * | index |
  14427. * word 5 | |
  14428. * |----------------------------------------------------------------|
  14429. * | length |
  14430. * word 6 | |
  14431. * |----------------------------------------------------------------|
  14432. * | timestamp |
  14433. * word 7 | |
  14434. * |----------------------------------------------------------------|
  14435. * | counter |
  14436. * word 8 | |
  14437. * |----------------------------------------------------------------|
  14438. * | chan_mhz |
  14439. * word 9 | |
  14440. * |----------------------------------------------------------------|
  14441. * | band_center_freq1 |
  14442. * word 10 | |
  14443. * |----------------------------------------------------------------|
  14444. * | band_center_freq2 |
  14445. * word 11 | |
  14446. * |----------------------------------------------------------------|
  14447. * | chan_phy_mode |
  14448. * word 12 | |
  14449. * |----------------------------------------------------------------|
  14450. * where,
  14451. * P - payload present bit (payload_present explained below)
  14452. * req_id - memory request id (mem_req_id explained below)
  14453. * S - status field (status explained below)
  14454. * capbw - capture bandwidth (capture_bw explained below)
  14455. * mode - mode of capture (mode explained below)
  14456. * sts - space time streams (sts_count explained below)
  14457. * chbw - channel bandwidth (channel_bw explained below)
  14458. * captype - capture type (cap_type explained below)
  14459. *
  14460. * The following field definitions describe the format of the CFR dump
  14461. * completion indication sent from the target to the host
  14462. *
  14463. * Header fields:
  14464. *
  14465. * Word 0
  14466. * - msg_type
  14467. * Bits 7:0
  14468. * Purpose: Identifies this as CFR TX completion indication
  14469. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14470. * - payload_present
  14471. * Bit 8
  14472. * Purpose: Identifies how CFR data is sent to host
  14473. * Value: 0 - If CFR Payload is written to host memory
  14474. * 1 - If CFR Payload is sent as part of HTT message
  14475. * (This is the requirement for SDIO/USB where it is
  14476. * not possible to write CFR data to host memory)
  14477. * - reserved
  14478. * Bits 31:9
  14479. * Purpose: Reserved
  14480. * Value: 0
  14481. *
  14482. * Payload fields:
  14483. *
  14484. * Word 1
  14485. * - cfr_capture_msg_type
  14486. * Bits 31:0
  14487. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14488. * to specify the format used for the remainder of the message
  14489. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14490. * (currently only MSG_TYPE_1 is defined)
  14491. *
  14492. * Word 2
  14493. * - mem_req_id
  14494. * Bits 6:0
  14495. * Purpose: Contain the mem request id of the region where the CFR capture
  14496. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14497. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14498. this value is invalid)
  14499. * - status
  14500. * Bit 7
  14501. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14502. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14503. * - capture_bw
  14504. * Bits 10:8
  14505. * Purpose: Carry the bandwidth of the CFR capture
  14506. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14507. * - mode
  14508. * Bits 13:11
  14509. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14510. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14511. * - sts_count
  14512. * Bits 16:14
  14513. * Purpose: Carry the number of space time streams
  14514. * Value: Number of space time streams
  14515. * - channel_bw
  14516. * Bits 19:17
  14517. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14518. * measurement
  14519. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14520. * - cap_type
  14521. * Bits 23:20
  14522. * Purpose: Carry the type of the capture
  14523. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14524. * - vdev_id
  14525. * Bits 31:24
  14526. * Purpose: Carry the virtual device id
  14527. * Value: vdev ID
  14528. *
  14529. * Word 3
  14530. * - mac_addr31to0
  14531. * Bits 31:0
  14532. * Purpose: Contain the bits 31:0 of the peer MAC address
  14533. * Value: Bits 31:0 of the peer MAC address
  14534. *
  14535. * Word 4
  14536. * - mac_addr47to32
  14537. * Bits 15:0
  14538. * Purpose: Contain the bits 47:32 of the peer MAC address
  14539. * Value: Bits 47:32 of the peer MAC address
  14540. *
  14541. * Word 5
  14542. * - index
  14543. * Bits 31:0
  14544. * Purpose: Contain the index at which this CFR dump was written in the Host
  14545. * allocated memory. This index is the number of bytes from the base address.
  14546. * Value: Index position
  14547. *
  14548. * Word 6
  14549. * - length
  14550. * Bits 31:0
  14551. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14552. * Value: Length of the CFR capture of the peer
  14553. *
  14554. * Word 7
  14555. * - timestamp
  14556. * Bits 31:0
  14557. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14558. * clock used for this timestamp is private to the target and not visible to
  14559. * the host i.e., Host can interpret only the relative timestamp deltas from
  14560. * one message to the next, but can't interpret the absolute timestamp from a
  14561. * single message.
  14562. * Value: Timestamp in microseconds
  14563. *
  14564. * Word 8
  14565. * - counter
  14566. * Bits 31:0
  14567. * Purpose: Carry the count of the current CFR capture from FW. This is
  14568. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14569. * in host memory)
  14570. * Value: Count of the current CFR capture
  14571. *
  14572. * Word 9
  14573. * - chan_mhz
  14574. * Bits 31:0
  14575. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14576. * Value: Primary 20 channel frequency
  14577. *
  14578. * Word 10
  14579. * - band_center_freq1
  14580. * Bits 31:0
  14581. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14582. * Value: Center frequency 1 in MHz
  14583. *
  14584. * Word 11
  14585. * - band_center_freq2
  14586. * Bits 31:0
  14587. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14588. * the VDEV
  14589. * 80plus80 mode
  14590. * Value: Center frequency 2 in MHz
  14591. *
  14592. * Word 12
  14593. * - chan_phy_mode
  14594. * Bits 31:0
  14595. * Purpose: Carry the phy mode of the channel, of the VDEV
  14596. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14597. */
  14598. PREPACK struct htt_cfr_dump_ind_type_1 {
  14599. A_UINT32 mem_req_id:7,
  14600. status:1,
  14601. capture_bw:3,
  14602. mode:3,
  14603. sts_count:3,
  14604. channel_bw:3,
  14605. cap_type:4,
  14606. vdev_id:8;
  14607. htt_mac_addr addr;
  14608. A_UINT32 index;
  14609. A_UINT32 length;
  14610. A_UINT32 timestamp;
  14611. A_UINT32 counter;
  14612. struct htt_chan_change_msg chan;
  14613. } POSTPACK;
  14614. PREPACK struct htt_cfr_dump_compl_ind {
  14615. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14616. union {
  14617. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14618. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14619. /* If there is a need to change the memory layout and its associated
  14620. * HTT indication format, a new CFR capture message type can be
  14621. * introduced and added into this union.
  14622. */
  14623. };
  14624. } POSTPACK;
  14625. /*
  14626. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14627. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14628. */
  14629. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14630. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14631. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14632. do { \
  14633. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14634. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14635. } while(0)
  14636. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14637. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14638. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14639. /*
  14640. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14641. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14642. */
  14643. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14644. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14645. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14646. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14647. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14648. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14649. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14650. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14651. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14652. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14653. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14654. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14655. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14656. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14657. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14658. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14659. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14660. do { \
  14661. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14662. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14663. } while (0)
  14664. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14665. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14666. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14667. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14668. do { \
  14669. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14670. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14671. } while (0)
  14672. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14673. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14674. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14675. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14676. do { \
  14677. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14678. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14679. } while (0)
  14680. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14681. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14682. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14683. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14684. do { \
  14685. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14686. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14687. } while (0)
  14688. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14689. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14690. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14691. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14692. do { \
  14693. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14694. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14695. } while (0)
  14696. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14697. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14698. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14699. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14700. do { \
  14701. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14702. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14703. } while (0)
  14704. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14705. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14706. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14707. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14708. do { \
  14709. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14710. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14711. } while (0)
  14712. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14713. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14714. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14715. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14716. do { \
  14717. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14718. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14719. } while (0)
  14720. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14721. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14722. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14723. /**
  14724. * @brief target -> host peer (PPDU) stats message
  14725. *
  14726. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14727. *
  14728. * @details
  14729. * This message is generated by FW when FW is sending stats to host
  14730. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14731. * This message is sent autonomously by the target rather than upon request
  14732. * by the host.
  14733. * The following field definitions describe the format of the HTT target
  14734. * to host peer stats indication message.
  14735. *
  14736. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14737. * or more PPDU stats records.
  14738. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14739. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14740. * then the message would start with the
  14741. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14742. * below.
  14743. *
  14744. * |31 16|15|14|13 11|10 9|8|7 0|
  14745. * |-------------------------------------------------------------|
  14746. * | reserved |MSG_TYPE |
  14747. * |-------------------------------------------------------------|
  14748. * rec 0 | TLV header |
  14749. * rec 0 |-------------------------------------------------------------|
  14750. * rec 0 | ppdu successful bytes |
  14751. * rec 0 |-------------------------------------------------------------|
  14752. * rec 0 | ppdu retry bytes |
  14753. * rec 0 |-------------------------------------------------------------|
  14754. * rec 0 | ppdu failed bytes |
  14755. * rec 0 |-------------------------------------------------------------|
  14756. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14757. * rec 0 |-------------------------------------------------------------|
  14758. * rec 0 | retried MSDUs | successful MSDUs |
  14759. * rec 0 |-------------------------------------------------------------|
  14760. * rec 0 | TX duration | failed MSDUs |
  14761. * rec 0 |-------------------------------------------------------------|
  14762. * ...
  14763. * |-------------------------------------------------------------|
  14764. * rec N | TLV header |
  14765. * rec N |-------------------------------------------------------------|
  14766. * rec N | ppdu successful bytes |
  14767. * rec N |-------------------------------------------------------------|
  14768. * rec N | ppdu retry bytes |
  14769. * rec N |-------------------------------------------------------------|
  14770. * rec N | ppdu failed bytes |
  14771. * rec N |-------------------------------------------------------------|
  14772. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14773. * rec N |-------------------------------------------------------------|
  14774. * rec N | retried MSDUs | successful MSDUs |
  14775. * rec N |-------------------------------------------------------------|
  14776. * rec N | TX duration | failed MSDUs |
  14777. * rec N |-------------------------------------------------------------|
  14778. *
  14779. * where:
  14780. * A = is A-MPDU flag
  14781. * BA = block-ack failure flags
  14782. * BW = bandwidth spec
  14783. * SG = SGI enabled spec
  14784. * S = skipped rate ctrl
  14785. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14786. *
  14787. * Header
  14788. * ------
  14789. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14790. * dword0 - b'8:31 - reserved : Reserved for future use
  14791. *
  14792. * payload include below peer_stats information
  14793. * --------------------------------------------
  14794. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14795. * @tx_success_bytes : total successful bytes in the PPDU.
  14796. * @tx_retry_bytes : total retried bytes in the PPDU.
  14797. * @tx_failed_bytes : total failed bytes in the PPDU.
  14798. * @tx_ratecode : rate code used for the PPDU.
  14799. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14800. * @ba_ack_failed : BA/ACK failed for this PPDU
  14801. * b00 -> BA received
  14802. * b01 -> BA failed once
  14803. * b10 -> BA failed twice, when HW retry is enabled.
  14804. * @bw : BW
  14805. * b00 -> 20 MHz
  14806. * b01 -> 40 MHz
  14807. * b10 -> 80 MHz
  14808. * b11 -> 160 MHz (or 80+80)
  14809. * @sg : SGI enabled
  14810. * @s : skipped ratectrl
  14811. * @peer_id : peer id
  14812. * @tx_success_msdus : successful MSDUs
  14813. * @tx_retry_msdus : retried MSDUs
  14814. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14815. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14816. */
  14817. /**
  14818. * @brief target -> host backpressure event
  14819. *
  14820. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14821. *
  14822. * @details
  14823. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14824. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14825. * This message will only be sent if the backpressure condition has existed
  14826. * continuously for an initial period (100 ms).
  14827. * Repeat messages with updated information will be sent after each
  14828. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14829. * This message indicates the ring id along with current head and tail index
  14830. * locations (i.e. write and read indices).
  14831. * The backpressure time indicates the time in ms for which continous
  14832. * backpressure has been observed in the ring.
  14833. *
  14834. * The message format is as follows:
  14835. *
  14836. * |31 24|23 16|15 8|7 0|
  14837. * |----------------+----------------+----------------+----------------|
  14838. * | ring_id | ring_type | pdev_id | msg_type |
  14839. * |-------------------------------------------------------------------|
  14840. * | tail_idx | head_idx |
  14841. * |-------------------------------------------------------------------|
  14842. * | backpressure_time_ms |
  14843. * |-------------------------------------------------------------------|
  14844. *
  14845. * The message is interpreted as follows:
  14846. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14847. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14848. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14849. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14850. the msg is for LMAC ring.
  14851. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14852. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14853. * htt_backpressure_lmac_ring_id. This represents
  14854. * the ring id for which continous backpressure is seen
  14855. *
  14856. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14857. * the ring indicated by the ring_id
  14858. *
  14859. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14860. * the ring indicated by the ring id
  14861. *
  14862. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14863. * backpressure has been seen in the ring
  14864. * indicated by the ring_id.
  14865. * Units = milliseconds
  14866. */
  14867. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14868. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14869. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14870. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14871. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14872. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14873. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14874. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14875. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14876. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14877. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14878. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14879. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14880. do { \
  14881. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14882. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14883. } while (0)
  14884. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14885. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14886. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14887. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14888. do { \
  14889. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14890. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14891. } while (0)
  14892. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14893. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14894. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14895. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14896. do { \
  14897. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14898. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14899. } while (0)
  14900. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14901. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14902. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14903. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14904. do { \
  14905. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14906. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14907. } while (0)
  14908. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14909. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14910. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14911. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14912. do { \
  14913. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14914. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14915. } while (0)
  14916. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14917. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14918. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14919. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14920. do { \
  14921. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14922. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14923. } while (0)
  14924. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14925. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14926. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14927. enum htt_backpressure_ring_type {
  14928. HTT_SW_RING_TYPE_UMAC,
  14929. HTT_SW_RING_TYPE_LMAC,
  14930. HTT_SW_RING_TYPE_MAX,
  14931. };
  14932. /* Ring id for which the message is sent to host */
  14933. enum htt_backpressure_umac_ringid {
  14934. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14935. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14936. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14937. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14938. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14939. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14940. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14941. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14942. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14943. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14944. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14945. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14946. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14947. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14948. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14949. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14950. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14951. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14952. HTT_SW_UMAC_RING_IDX_MAX,
  14953. };
  14954. enum htt_backpressure_lmac_ringid {
  14955. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14956. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14957. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14958. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14959. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14960. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14961. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14962. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14963. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14964. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14965. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14966. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14967. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14968. HTT_SW_LMAC_RING_IDX_MAX,
  14969. };
  14970. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14971. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14972. pdev_id: 8,
  14973. ring_type: 8, /* htt_backpressure_ring_type */
  14974. /*
  14975. * ring_id holds an enum value from either
  14976. * htt_backpressure_umac_ringid or
  14977. * htt_backpressure_lmac_ringid, based on
  14978. * the ring_type setting.
  14979. */
  14980. ring_id: 8;
  14981. A_UINT16 head_idx;
  14982. A_UINT16 tail_idx;
  14983. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14984. } POSTPACK;
  14985. /*
  14986. * Defines two 32 bit words that can be used by the target to indicate a per
  14987. * user RU allocation and rate information.
  14988. *
  14989. * This information is currently provided in the "sw_response_reference_ptr"
  14990. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14991. * "rx_ppdu_end_user_stats" TLV.
  14992. *
  14993. * VALID:
  14994. * The consumer of these words must explicitly check the valid bit,
  14995. * and only attempt interpretation of any of the remaining fields if
  14996. * the valid bit is set to 1.
  14997. *
  14998. * VERSION:
  14999. * The consumer of these words must also explicitly check the version bit,
  15000. * and only use the V0 definition if the VERSION field is set to 0.
  15001. *
  15002. * Version 1 is currently undefined, with the exception of the VALID and
  15003. * VERSION fields.
  15004. *
  15005. * Version 0:
  15006. *
  15007. * The fields below are duplicated per BW.
  15008. *
  15009. * The consumer must determine which BW field to use, based on the UL OFDMA
  15010. * PPDU BW indicated by HW.
  15011. *
  15012. * RU_START: RU26 start index for the user.
  15013. * Note that this is always using the RU26 index, regardless
  15014. * of the actual RU assigned to the user
  15015. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15016. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15017. *
  15018. * For example, 20MHz (the value in the top row is RU_START)
  15019. *
  15020. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15021. * RU Size 1 (52): | | | | | |
  15022. * RU Size 2 (106): | | | |
  15023. * RU Size 3 (242): | |
  15024. *
  15025. * RU_SIZE: Indicates the RU size, as defined by enum
  15026. * htt_ul_ofdma_user_info_ru_size.
  15027. *
  15028. * LDPC: LDPC enabled (if 0, BCC is used)
  15029. *
  15030. * DCM: DCM enabled
  15031. *
  15032. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15033. * |---------------------------------+--------------------------------|
  15034. * |Ver|Valid| FW internal |
  15035. * |---------------------------------+--------------------------------|
  15036. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15037. * |---------------------------------+--------------------------------|
  15038. */
  15039. enum htt_ul_ofdma_user_info_ru_size {
  15040. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15041. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15042. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15043. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15044. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15045. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15046. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15047. };
  15048. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15049. struct htt_ul_ofdma_user_info_v0 {
  15050. A_UINT32 word0;
  15051. A_UINT32 word1;
  15052. };
  15053. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15054. A_UINT32 w0_fw_rsvd:30; \
  15055. A_UINT32 w0_valid:1; \
  15056. A_UINT32 w0_version:1;
  15057. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15058. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15059. };
  15060. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15061. A_UINT32 w1_nss:3; \
  15062. A_UINT32 w1_mcs:4; \
  15063. A_UINT32 w1_ldpc:1; \
  15064. A_UINT32 w1_dcm:1; \
  15065. A_UINT32 w1_ru_start:7; \
  15066. A_UINT32 w1_ru_size:3; \
  15067. A_UINT32 w1_trig_type:4; \
  15068. A_UINT32 w1_unused:9;
  15069. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15070. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15071. };
  15072. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15073. A_UINT32 w0_fw_rsvd:27; \
  15074. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15075. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15076. 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) */
  15077. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15078. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15079. };
  15080. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15081. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15082. A_UINT32 w1_trig_type:4; \
  15083. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15084. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15085. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15086. };
  15087. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15088. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15089. union {
  15090. A_UINT32 word0;
  15091. struct {
  15092. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15093. };
  15094. };
  15095. union {
  15096. A_UINT32 word1;
  15097. struct {
  15098. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15099. };
  15100. };
  15101. } POSTPACK;
  15102. /*
  15103. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15104. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15105. * this should be picked.
  15106. */
  15107. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15108. union {
  15109. A_UINT32 word0;
  15110. struct {
  15111. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15112. };
  15113. };
  15114. union {
  15115. A_UINT32 word1;
  15116. struct {
  15117. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15118. };
  15119. };
  15120. } POSTPACK;
  15121. enum HTT_UL_OFDMA_TRIG_TYPE {
  15122. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15123. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15124. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15125. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15126. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15127. };
  15128. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15129. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15130. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15131. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15132. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15133. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15134. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15135. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15136. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15137. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15138. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15139. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15140. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15141. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15142. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15143. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15144. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15145. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15146. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15147. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15148. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15149. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15150. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15151. /*--- word 0 ---*/
  15152. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15153. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15154. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15155. do { \
  15156. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15157. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15158. } while (0)
  15159. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15160. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15161. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15162. do { \
  15163. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15164. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15165. } while (0)
  15166. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15167. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15168. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15169. do { \
  15170. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15171. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15172. } while (0)
  15173. /*--- word 1 ---*/
  15174. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15175. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15176. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15177. do { \
  15178. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15179. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15180. } while (0)
  15181. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15182. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15183. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15184. do { \
  15185. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15186. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15187. } while (0)
  15188. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15189. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15190. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15191. do { \
  15192. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15193. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15194. } while (0)
  15195. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15196. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15197. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15198. do { \
  15199. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15200. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15201. } while (0)
  15202. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15203. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15204. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15205. do { \
  15206. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15207. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15208. } while (0)
  15209. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15210. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15211. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15212. do { \
  15213. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15214. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15215. } while (0)
  15216. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15217. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15218. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15219. do { \
  15220. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15221. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15222. } while (0)
  15223. /**
  15224. * @brief target -> host channel calibration data message
  15225. *
  15226. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15227. *
  15228. * @brief host -> target channel calibration data message
  15229. *
  15230. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15231. *
  15232. * @details
  15233. * The following field definitions describe the format of the channel
  15234. * calibration data message sent from the target to the host when
  15235. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15236. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15237. * The message is defined as htt_chan_caldata_msg followed by a variable
  15238. * number of 32-bit character values.
  15239. *
  15240. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15241. * |------------------------------------------------------------------|
  15242. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15243. * |------------------------------------------------------------------|
  15244. * | payload size | mhz |
  15245. * |------------------------------------------------------------------|
  15246. * | center frequency 2 | center frequency 1 |
  15247. * |------------------------------------------------------------------|
  15248. * | check sum |
  15249. * |------------------------------------------------------------------|
  15250. * | payload |
  15251. * |------------------------------------------------------------------|
  15252. * message info field:
  15253. * - MSG_TYPE
  15254. * Bits 7:0
  15255. * Purpose: identifies this as a channel calibration data message
  15256. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15257. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15258. * - SUB_TYPE
  15259. * Bits 11:8
  15260. * Purpose: T2H: indicates whether target is providing chan cal data
  15261. * to the host to store, or requesting that the host
  15262. * download previously-stored data.
  15263. * H2T: indicates whether the host is providing the requested
  15264. * channel cal data, or if it is rejecting the data
  15265. * request because it does not have the requested data.
  15266. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15267. * - CHKSUM_VALID
  15268. * Bit 12
  15269. * Purpose: indicates if the checksum field is valid
  15270. * value:
  15271. * - FRAG
  15272. * Bit 19:16
  15273. * Purpose: indicates the fragment index for message
  15274. * value: 0 for first fragment, 1 for second fragment, ...
  15275. * - APPEND
  15276. * Bit 20
  15277. * Purpose: indicates if this is the last fragment
  15278. * value: 0 = final fragment, 1 = more fragments will be appended
  15279. *
  15280. * channel and payload size field
  15281. * - MHZ
  15282. * Bits 15:0
  15283. * Purpose: indicates the channel primary frequency
  15284. * Value:
  15285. * - PAYLOAD_SIZE
  15286. * Bits 31:16
  15287. * Purpose: indicates the bytes of calibration data in payload
  15288. * Value:
  15289. *
  15290. * center frequency field
  15291. * - CENTER FREQUENCY 1
  15292. * Bits 15:0
  15293. * Purpose: indicates the channel center frequency
  15294. * Value: channel center frequency, in MHz units
  15295. * - CENTER FREQUENCY 2
  15296. * Bits 31:16
  15297. * Purpose: indicates the secondary channel center frequency,
  15298. * only for 11acvht 80plus80 mode
  15299. * Value: secondary channel center frequeny, in MHz units, if applicable
  15300. *
  15301. * checksum field
  15302. * - CHECK_SUM
  15303. * Bits 31:0
  15304. * Purpose: check the payload data, it is just for this fragment.
  15305. * This is intended for the target to check that the channel
  15306. * calibration data returned by the host is the unmodified data
  15307. * that was previously provided to the host by the target.
  15308. * value: checksum of fragment payload
  15309. */
  15310. PREPACK struct htt_chan_caldata_msg {
  15311. /* DWORD 0: message info */
  15312. A_UINT32
  15313. msg_type: 8,
  15314. sub_type: 4 ,
  15315. chksum_valid: 1, /** 1:valid, 0:invalid */
  15316. reserved1: 3,
  15317. frag_idx: 4, /** fragment index for calibration data */
  15318. appending: 1, /** 0: no fragment appending,
  15319. * 1: extra fragment appending */
  15320. reserved2: 11;
  15321. /* DWORD 1: channel and payload size */
  15322. A_UINT32
  15323. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15324. payload_size: 16; /** unit: bytes */
  15325. /* DWORD 2: center frequency */
  15326. A_UINT32
  15327. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15328. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15329. * valid only for 11acvht 80plus80 mode */
  15330. /* DWORD 3: check sum */
  15331. A_UINT32 chksum;
  15332. /* variable length for calibration data */
  15333. A_UINT32 payload[1/* or more */];
  15334. } POSTPACK;
  15335. /* T2H SUBTYPE */
  15336. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15337. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15338. /* H2T SUBTYPE */
  15339. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15340. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15341. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15342. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15343. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15344. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15345. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15346. do { \
  15347. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15348. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15349. } while (0)
  15350. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15351. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15352. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15353. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15354. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15355. do { \
  15356. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15357. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15358. } while (0)
  15359. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15360. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15361. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15362. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15363. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15364. do { \
  15365. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15366. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15367. } while (0)
  15368. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15369. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15370. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15371. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15372. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15373. do { \
  15374. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15375. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15376. } while (0)
  15377. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15378. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15379. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15380. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15381. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15382. do { \
  15383. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15384. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15385. } while (0)
  15386. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15387. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15388. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15389. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15390. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15391. do { \
  15392. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15393. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15394. } while (0)
  15395. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15396. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15397. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15398. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15399. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15400. do { \
  15401. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15402. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15403. } while (0)
  15404. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15405. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15406. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15407. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15408. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15409. do { \
  15410. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15411. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15412. } while (0)
  15413. /**
  15414. * @brief target -> host FSE CMEM based send
  15415. *
  15416. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15417. *
  15418. * @details
  15419. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15420. * FSE placement in CMEM is enabled.
  15421. *
  15422. * This message sends the non-secure CMEM base address.
  15423. * It will be sent to host in response to message
  15424. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15425. * The message would appear as follows:
  15426. *
  15427. * |31 24|23 16|15 8|7 0|
  15428. * |----------------+----------------+----------------+----------------|
  15429. * | reserved | num_entries | msg_type |
  15430. * |----------------+----------------+----------------+----------------|
  15431. * | base_address_lo |
  15432. * |----------------+----------------+----------------+----------------|
  15433. * | base_address_hi |
  15434. * |-------------------------------------------------------------------|
  15435. *
  15436. * The message is interpreted as follows:
  15437. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15438. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15439. * b'8:15 - number_entries: Indicated the number of entries
  15440. * programmed.
  15441. * b'16:31 - reserved.
  15442. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15443. * CMEM base address
  15444. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15445. * CMEM base address
  15446. */
  15447. PREPACK struct htt_cmem_base_send_t {
  15448. A_UINT32 msg_type: 8,
  15449. num_entries: 8,
  15450. reserved: 16;
  15451. A_UINT32 base_address_lo;
  15452. A_UINT32 base_address_hi;
  15453. } POSTPACK;
  15454. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15455. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15456. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15457. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15458. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15459. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15460. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15461. do { \
  15462. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15463. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15464. } while (0)
  15465. /**
  15466. * @brief - HTT PPDU ID format
  15467. *
  15468. * @details
  15469. * The following field definitions describe the format of the PPDU ID.
  15470. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15471. *
  15472. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15473. * +--------------------------------------------------------------------------
  15474. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15475. * +--------------------------------------------------------------------------
  15476. *
  15477. * sch id :Schedule command id
  15478. * Bits [11 : 0] : monotonically increasing counter to track the
  15479. * PPDU posted to a specific transmit queue.
  15480. *
  15481. * hwq_id: Hardware Queue ID.
  15482. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15483. *
  15484. * mac_id: MAC ID
  15485. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15486. *
  15487. * seq_idx: Sequence index.
  15488. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15489. * a particular TXOP.
  15490. *
  15491. * tqm_cmd: HWSCH/TQM flag.
  15492. * Bit [23] : Always set to 0.
  15493. *
  15494. * seq_cmd_type: Sequence command type.
  15495. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15496. * Refer to enum HTT_STATS_FTYPE for values.
  15497. */
  15498. PREPACK struct htt_ppdu_id {
  15499. A_UINT32
  15500. sch_id: 12,
  15501. hwq_id: 5,
  15502. mac_id: 2,
  15503. seq_idx: 2,
  15504. reserved1: 2,
  15505. tqm_cmd: 1,
  15506. seq_cmd_type: 6,
  15507. reserved2: 2;
  15508. } POSTPACK;
  15509. #define HTT_PPDU_ID_SCH_ID_S 0
  15510. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15511. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15512. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15513. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15514. do { \
  15515. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15516. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15517. } while (0)
  15518. #define HTT_PPDU_ID_HWQ_ID_S 12
  15519. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15520. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15521. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15522. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15523. do { \
  15524. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15525. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15526. } while (0)
  15527. #define HTT_PPDU_ID_MAC_ID_S 17
  15528. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15529. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15530. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15531. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15532. do { \
  15533. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15534. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15535. } while (0)
  15536. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15537. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15538. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15539. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15540. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15541. do { \
  15542. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15543. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15544. } while (0)
  15545. #define HTT_PPDU_ID_TQM_CMD_S 23
  15546. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15547. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15548. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15549. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15550. do { \
  15551. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15552. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15553. } while (0)
  15554. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15555. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15556. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15557. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15558. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15559. do { \
  15560. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15561. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15562. } while (0)
  15563. /**
  15564. * @brief target -> RX PEER METADATA V0 format
  15565. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15566. * message from target, and will confirm to the target which peer metadata
  15567. * version to use in the wmi_init message.
  15568. *
  15569. * The following diagram shows the format of the RX PEER METADATA.
  15570. *
  15571. * |31 24|23 16|15 8|7 0|
  15572. * |-----------------------------------------------------------------------|
  15573. * | Reserved | VDEV ID | PEER ID |
  15574. * |-----------------------------------------------------------------------|
  15575. */
  15576. PREPACK struct htt_rx_peer_metadata_v0 {
  15577. A_UINT32
  15578. peer_id: 16,
  15579. vdev_id: 8,
  15580. reserved1: 8;
  15581. } POSTPACK;
  15582. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15583. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15584. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15585. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15586. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15587. do { \
  15588. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15589. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15590. } while (0)
  15591. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15592. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15593. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15594. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15595. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15596. do { \
  15597. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15598. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15599. } while (0)
  15600. /**
  15601. * @brief target -> RX PEER METADATA V1 format
  15602. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15603. * message from target, and will confirm to the target which peer metadata
  15604. * version to use in the wmi_init message.
  15605. *
  15606. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15607. *
  15608. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15609. * |-----------------------------------------------------------------------|
  15610. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15611. * |-----------------------------------------------------------------------|
  15612. */
  15613. PREPACK struct htt_rx_peer_metadata_v1 {
  15614. A_UINT32
  15615. peer_id: 13,
  15616. ml_peer_valid: 1,
  15617. reserved1: 2,
  15618. vdev_id: 8,
  15619. lmac_id: 2,
  15620. chip_id: 3,
  15621. reserved2: 3;
  15622. } POSTPACK;
  15623. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15624. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15625. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15626. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15627. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15628. do { \
  15629. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15630. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15631. } while (0)
  15632. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15633. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15634. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15635. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15636. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15637. do { \
  15638. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15639. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15640. } while (0)
  15641. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15642. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15643. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15644. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15645. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15646. do { \
  15647. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15648. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15649. } while (0)
  15650. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15651. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15652. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15653. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15654. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15655. do { \
  15656. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15657. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15658. } while (0)
  15659. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15660. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15661. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15662. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15663. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15664. do { \
  15665. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15666. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15667. } while (0)
  15668. /*
  15669. * In some systems, the host SW wants to specify priorities between
  15670. * different MSDU / flow queues within the same peer-TID.
  15671. * The below enums are used for the host to identify to the target
  15672. * which MSDU queue's priority it wants to adjust.
  15673. */
  15674. /*
  15675. * The MSDUQ index describe index of TCL HW, where each index is
  15676. * used for queuing particular types of MSDUs.
  15677. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15678. */
  15679. enum HTT_MSDUQ_INDEX {
  15680. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15681. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15682. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15683. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15684. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15685. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15686. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15687. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15688. HTT_MSDUQ_MAX_INDEX,
  15689. };
  15690. /* MSDU qtype definition */
  15691. enum HTT_MSDU_QTYPE {
  15692. /*
  15693. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15694. * relative priority. Instead, the relative priority of CRIT_0 versus
  15695. * CRIT_1 is controlled by the FW, through the configuration parameters
  15696. * it applies to the queues.
  15697. */
  15698. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15699. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15700. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15701. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15702. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15703. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15704. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15705. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15706. /* New MSDU_QTYPE should be added above this line */
  15707. /*
  15708. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15709. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15710. * any host/target message definitions. The QTYPE_MAX value can
  15711. * only be used internally within the host or within the target.
  15712. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15713. * it must regard the unexpected value as a default qtype value,
  15714. * or ignore it.
  15715. */
  15716. HTT_MSDU_QTYPE_MAX,
  15717. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15718. };
  15719. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15720. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15721. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15722. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15723. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15724. };
  15725. /**
  15726. * @brief target -> host mlo timestamp offset indication
  15727. *
  15728. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15729. *
  15730. * @details
  15731. * The following field definitions describe the format of the HTT target
  15732. * to host mlo timestamp offset indication message.
  15733. *
  15734. *
  15735. * |31 16|15 12|11 10|9 8|7 0 |
  15736. * |----------------------------------------------------------------------|
  15737. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15738. * |----------------------------------------------------------------------|
  15739. * | Sync time stamp lo in us |
  15740. * |----------------------------------------------------------------------|
  15741. * | Sync time stamp hi in us |
  15742. * |----------------------------------------------------------------------|
  15743. * | mlo time stamp offset lo in us |
  15744. * |----------------------------------------------------------------------|
  15745. * | mlo time stamp offset hi in us |
  15746. * |----------------------------------------------------------------------|
  15747. * | mlo time stamp offset clocks in clock ticks |
  15748. * |----------------------------------------------------------------------|
  15749. * |31 26|25 16|15 0 |
  15750. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15751. * | | compensation in clks | |
  15752. * |----------------------------------------------------------------------|
  15753. * |31 22|21 0 |
  15754. * | rsvd 3 | mlo time stamp comp timer period |
  15755. * |----------------------------------------------------------------------|
  15756. * The message is interpreted as follows:
  15757. *
  15758. * dword0 - b'0:7 - msg_type: This will be set to
  15759. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15760. * value: 0x28
  15761. *
  15762. * dword0 - b'9:8 - pdev_id
  15763. *
  15764. * dword0 - b'11:10 - chip_id
  15765. *
  15766. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15767. *
  15768. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15769. *
  15770. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15771. * which last sync interrupt was received
  15772. *
  15773. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15774. * which last sync interrupt was received
  15775. *
  15776. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15777. *
  15778. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15779. *
  15780. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15781. *
  15782. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15783. *
  15784. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15785. * for sub us resolution
  15786. *
  15787. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15788. *
  15789. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15790. * is applied, in us
  15791. *
  15792. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15793. */
  15794. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15795. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15796. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15797. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15798. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15799. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15800. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15801. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15802. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15803. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15804. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15805. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15806. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15807. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15808. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15809. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15810. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15811. do { \
  15812. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15813. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15814. } while (0)
  15815. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15816. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15817. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15818. do { \
  15819. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15820. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15821. } while (0)
  15822. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15823. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15824. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15825. do { \
  15826. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15827. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15828. } while (0)
  15829. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15830. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15831. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15832. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15833. do { \
  15834. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15835. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15836. } while (0)
  15837. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15838. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15839. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15840. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15841. do { \
  15842. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15843. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15844. } while (0)
  15845. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15846. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15847. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15848. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15849. do { \
  15850. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15851. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15852. } while (0)
  15853. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15854. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15855. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15856. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15857. do { \
  15858. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15859. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15860. } while (0)
  15861. typedef struct {
  15862. A_UINT32 msg_type: 8, /* bits 7:0 */
  15863. pdev_id: 2, /* bits 9:8 */
  15864. chip_id: 2, /* bits 11:10 */
  15865. reserved1: 4, /* bits 15:12 */
  15866. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15867. A_UINT32 sync_timestamp_lo_us;
  15868. A_UINT32 sync_timestamp_hi_us;
  15869. A_UINT32 mlo_timestamp_offset_lo_us;
  15870. A_UINT32 mlo_timestamp_offset_hi_us;
  15871. A_UINT32 mlo_timestamp_offset_clks;
  15872. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15873. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15874. reserved2: 6; /* bits 31:26 */
  15875. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15876. reserved3: 10; /* bits 31:22 */
  15877. } htt_t2h_mlo_offset_ind_t;
  15878. /*
  15879. * @brief target -> host VDEV TX RX STATS
  15880. *
  15881. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15882. *
  15883. * @details
  15884. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15885. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15886. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15887. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15888. * periodically by target even in the absence of any further HTT request
  15889. * messages from host.
  15890. *
  15891. * The message is formatted as follows:
  15892. *
  15893. * |31 16|15 8|7 0|
  15894. * |---------------------------------+----------------+----------------|
  15895. * | payload_size | pdev_id | msg_type |
  15896. * |---------------------------------+----------------+----------------|
  15897. * | reserved0 |
  15898. * |-------------------------------------------------------------------|
  15899. * | reserved1 |
  15900. * |-------------------------------------------------------------------|
  15901. * | reserved2 |
  15902. * |-------------------------------------------------------------------|
  15903. * | |
  15904. * | VDEV specific Tx Rx stats info |
  15905. * | |
  15906. * |-------------------------------------------------------------------|
  15907. *
  15908. * The message is interpreted as follows:
  15909. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15910. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15911. * b'8:15 - pdev_id
  15912. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15913. * message header fields (msg_type through reserved2)
  15914. * dword1 - b'0:31 - reserved0.
  15915. * dword2 - b'0:31 - reserved1.
  15916. * dword3 - b'0:31 - reserved2.
  15917. */
  15918. typedef struct {
  15919. A_UINT32 msg_type: 8,
  15920. pdev_id: 8,
  15921. payload_size: 16;
  15922. A_UINT32 reserved0;
  15923. A_UINT32 reserved1;
  15924. A_UINT32 reserved2;
  15925. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15926. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15927. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15928. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15929. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15930. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15931. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15932. do { \
  15933. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15934. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15935. } while (0)
  15936. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15937. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15938. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15939. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15940. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15941. do { \
  15942. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15943. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15944. } while (0)
  15945. /* SOC related stats */
  15946. typedef struct {
  15947. htt_tlv_hdr_t tlv_hdr;
  15948. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15949. * This can be due to either the peer is deleted or deletion is ongoing
  15950. * */
  15951. A_UINT32 inv_peers_msdu_drop_count_lo;
  15952. A_UINT32 inv_peers_msdu_drop_count_hi;
  15953. } htt_t2h_soc_txrx_stats_common_tlv;
  15954. /* VDEV HW Tx/Rx stats */
  15955. typedef struct {
  15956. htt_tlv_hdr_t tlv_hdr;
  15957. A_UINT32 vdev_id;
  15958. /* Rx msdu byte cnt */
  15959. A_UINT32 rx_msdu_byte_cnt_lo;
  15960. A_UINT32 rx_msdu_byte_cnt_hi;
  15961. /* Rx msdu cnt */
  15962. A_UINT32 rx_msdu_cnt_lo;
  15963. A_UINT32 rx_msdu_cnt_hi;
  15964. /* tx msdu byte cnt */
  15965. A_UINT32 tx_msdu_byte_cnt_lo;
  15966. A_UINT32 tx_msdu_byte_cnt_hi;
  15967. /* tx msdu cnt */
  15968. A_UINT32 tx_msdu_cnt_lo;
  15969. A_UINT32 tx_msdu_cnt_hi;
  15970. /* tx excessive retry discarded msdu cnt */
  15971. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15972. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15973. /* TX congestion ctrl msdu drop cnt */
  15974. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15975. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15976. /* discarded tx msdus cnt coz of time to live expiry */
  15977. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15978. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15979. /* tx excessive retry discarded msdu byte cnt */
  15980. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15981. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15982. /* TX congestion ctrl msdu drop byte cnt */
  15983. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15984. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15985. /* discarded tx msdus byte cnt coz of time to live expiry */
  15986. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15987. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15988. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15989. /*
  15990. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15991. *
  15992. * @details
  15993. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  15994. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  15995. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  15996. * the default MSDU queues of the peer-TID specified in the
  15997. * SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  15998. * If the default MSDU queues of the specified peer-TID are not linked to
  15999. * a service class, the status field of the SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16000. * will specify that no such mapping exists of the default MSDU queues to a
  16001. * service class.
  16002. *
  16003. * |31 16|15 12|11 8|7 0|
  16004. * |------------------------------+------+-------+--------------|
  16005. * | peer ID | rsvd | TID | msg type |
  16006. * |------------------------------+--------------+--------------|
  16007. * | reserved | svc class ID | status |
  16008. * |------------------------------------------------------------|
  16009. * Header fields:
  16010. * dword0 - b'7:0 - msg_type: This will be set to
  16011. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16012. * b'11:8 - TID
  16013. * b'31:16 - peer ID
  16014. * dword1 - b'7:0 - status (htt_t2h_sawf_def_queues_map_report_status)
  16015. * b'15:8 - svc class ID (only valid if status == MAPPED)
  16016. */
  16017. enum htt_t2h_sawf_def_queues_map_report_status {
  16018. /* MAPPED:
  16019. * The default MSDU queues for the peer-TID are linked to a service class.
  16020. * The svc_class_id field shows which service class the default MSDU queues
  16021. * are associated with.
  16022. */
  16023. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_MAPPED = 0,
  16024. /* UNMAPPED:
  16025. * The default MSDU queues for the peer-TID are not linked to any
  16026. * service class.
  16027. */
  16028. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_UNMAPPED = 1,
  16029. /* INVALID_IDS:
  16030. * One or more of pdev_id, vdev_id, peer_id, and TID were invalid.
  16031. */
  16032. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_INVALID_IDS = 2,
  16033. };
  16034. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16035. A_UINT32 msg_type :8,
  16036. tid :4,
  16037. reserved0 :4,
  16038. peer_id :16;
  16039. A_UINT32 status :8,
  16040. svc_class_id :8,
  16041. reserved1 :16;
  16042. } POSTPACK;
  16043. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_BYTES 8
  16044. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x00000F00
  16045. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 8
  16046. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16047. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16048. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16049. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16050. do { \
  16051. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16052. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S));\
  16053. } while (0)
  16054. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16055. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16056. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16057. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16058. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16059. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16060. do { \
  16061. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16062. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16063. } while (0)
  16064. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M 0x000000FF
  16065. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S 0
  16066. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_GET(_var) \
  16067. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M) >> \
  16068. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)
  16069. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_SET(_var, _val) \
  16070. do { \
  16071. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS, _val); \
  16072. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)); \
  16073. } while (0)
  16074. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16075. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16076. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16077. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16078. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16079. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16080. do { \
  16081. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16082. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16083. } while (0)
  16084. #endif