htt.h 801 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479
  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. */
  220. #define HTT_CURRENT_VERSION_MAJOR 3
  221. #define HTT_CURRENT_VERSION_MINOR 99
  222. #define HTT_NUM_TX_FRAG_DESC 1024
  223. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  224. #define HTT_CHECK_SET_VAL(field, val) \
  225. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  226. /* macros to assist in sign-extending fields from HTT messages */
  227. #define HTT_SIGN_BIT_MASK(field) \
  228. ((field ## _M + (1 << field ## _S)) >> 1)
  229. #define HTT_SIGN_BIT(_val, field) \
  230. (_val & HTT_SIGN_BIT_MASK(field))
  231. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  232. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  233. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  234. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  235. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  236. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  237. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  238. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  239. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  240. /*
  241. * TEMPORARY:
  242. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  243. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  244. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  245. * updated.
  246. */
  247. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  248. /*
  249. * TEMPORARY:
  250. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  251. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  252. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  253. * updated.
  254. */
  255. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  256. /*
  257. * htt_dbg_stats_type -
  258. * bit positions for each stats type within a stats type bitmask
  259. * The bitmask contains 24 bits.
  260. */
  261. enum htt_dbg_stats_type {
  262. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  263. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  264. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  265. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  266. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  267. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  268. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  269. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  270. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  271. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  272. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  273. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  274. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  275. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  276. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  277. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  278. /* bits 16-23 currently reserved */
  279. /* keep this last */
  280. HTT_DBG_NUM_STATS
  281. };
  282. /*=== HTT option selection TLVs ===
  283. * Certain HTT messages have alternatives or options.
  284. * For such cases, the host and target need to agree on which option to use.
  285. * Option specification TLVs can be appended to the VERSION_REQ and
  286. * VERSION_CONF messages to select options other than the default.
  287. * These TLVs are entirely optional - if they are not provided, there is a
  288. * well-defined default for each option. If they are provided, they can be
  289. * provided in any order. Each TLV can be present or absent independent of
  290. * the presence / absence of other TLVs.
  291. *
  292. * The HTT option selection TLVs use the following format:
  293. * |31 16|15 8|7 0|
  294. * |---------------------------------+----------------+----------------|
  295. * | value (payload) | length | tag |
  296. * |-------------------------------------------------------------------|
  297. * The value portion need not be only 2 bytes; it can be extended by any
  298. * integer number of 4-byte units. The total length of the TLV, including
  299. * the tag and length fields, must be a multiple of 4 bytes. The length
  300. * field specifies the total TLV size in 4-byte units. Thus, the typical
  301. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  302. * field, would store 0x1 in its length field, to show that the TLV occupies
  303. * a single 4-byte unit.
  304. */
  305. /*--- TLV header format - applies to all HTT option TLVs ---*/
  306. enum HTT_OPTION_TLV_TAGS {
  307. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  308. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  309. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  310. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  311. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  312. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  313. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  314. };
  315. PREPACK struct htt_option_tlv_header_t {
  316. A_UINT8 tag;
  317. A_UINT8 length;
  318. } POSTPACK;
  319. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  320. #define HTT_OPTION_TLV_TAG_S 0
  321. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  322. #define HTT_OPTION_TLV_LENGTH_S 8
  323. /*
  324. * value0 - 16 bit value field stored in word0
  325. * The TLV's value field may be longer than 2 bytes, in which case
  326. * the remainder of the value is stored in word1, word2, etc.
  327. */
  328. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  329. #define HTT_OPTION_TLV_VALUE0_S 16
  330. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_TAG_GET(word) \
  336. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  337. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  343. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  344. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  345. do { \
  346. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  347. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  348. } while (0)
  349. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  350. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  351. /*--- format of specific HTT option TLVs ---*/
  352. /*
  353. * HTT option TLV for specifying LL bus address size
  354. * Some chips require bus addresses used by the target to access buffers
  355. * within the host's memory to be 32 bits; others require bus addresses
  356. * used by the target to access buffers within the host's memory to be
  357. * 64 bits.
  358. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  359. * a suffix to the VERSION_CONF message to specify which bus address format
  360. * the target requires.
  361. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  362. * default to providing bus addresses to the target in 32-bit format.
  363. */
  364. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  365. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  366. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  367. };
  368. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  369. struct htt_option_tlv_header_t hdr;
  370. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  371. } POSTPACK;
  372. /*
  373. * HTT option TLV for specifying whether HL systems should indicate
  374. * over-the-air tx completion for individual frames, or should instead
  375. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  376. * requests an OTA tx completion for a particular tx frame.
  377. * This option does not apply to LL systems, where the TX_COMPL_IND
  378. * is mandatory.
  379. * This option is primarily intended for HL systems in which the tx frame
  380. * downloads over the host --> target bus are as slow as or slower than
  381. * the transmissions over the WLAN PHY. For cases where the bus is faster
  382. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  383. * and consquently will send one TX_COMPL_IND message that covers several
  384. * tx frames. For cases where the WLAN PHY is faster than the bus,
  385. * the target will end up transmitting very short A-MPDUs, and consequently
  386. * sending many TX_COMPL_IND messages, which each cover a very small number
  387. * of tx frames.
  388. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  389. * a suffix to the VERSION_REQ message to request whether the host desires to
  390. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  391. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  392. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  393. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  394. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  395. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  396. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  397. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  398. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  399. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  400. * TLV.
  401. */
  402. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  403. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  404. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  405. };
  406. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  407. struct htt_option_tlv_header_t hdr;
  408. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  409. } POSTPACK;
  410. /*
  411. * HTT option TLV for specifying how many tx queue groups the target
  412. * may establish.
  413. * This TLV specifies the maximum value the target may send in the
  414. * txq_group_id field of any TXQ_GROUP information elements sent by
  415. * the target to the host. This allows the host to pre-allocate an
  416. * appropriate number of tx queue group structs.
  417. *
  418. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  419. * a suffix to the VERSION_REQ message to specify whether the host supports
  420. * tx queue groups at all, and if so if there is any limit on the number of
  421. * tx queue groups that the host supports.
  422. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  423. * a suffix to the VERSION_CONF message. If the host has specified in the
  424. * VER_REQ message a limit on the number of tx queue groups the host can
  425. * supprt, the target shall limit its specification of the maximum tx groups
  426. * to be no larger than this host-specified limit.
  427. *
  428. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  429. * shall preallocate 4 tx queue group structs, and the target shall not
  430. * specify a txq_group_id larger than 3.
  431. */
  432. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  433. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  434. /*
  435. * values 1 through N specify the max number of tx queue groups
  436. * the sender supports
  437. */
  438. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  439. };
  440. /* TEMPORARY backwards-compatibility alias for a typo fix -
  441. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  442. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  443. * to support the old name (with the typo) until all references to the
  444. * old name are replaced with the new name.
  445. */
  446. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  447. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  448. struct htt_option_tlv_header_t hdr;
  449. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  450. } POSTPACK;
  451. /*
  452. * HTT option TLV for specifying whether the target supports an extended
  453. * version of the HTT tx descriptor. If the target provides this TLV
  454. * and specifies in the TLV that the target supports an extended version
  455. * of the HTT tx descriptor, the target must check the "extension" bit in
  456. * the HTT tx descriptor, and if the extension bit is set, to expect a
  457. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  458. * descriptor. Furthermore, the target must provide room for the HTT
  459. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  460. * This option is intended for systems where the host needs to explicitly
  461. * control the transmission parameters such as tx power for individual
  462. * tx frames.
  463. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  464. * as a suffix to the VERSION_CONF message to explicitly specify whether
  465. * the target supports the HTT tx MSDU extension descriptor.
  466. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  467. * by the host as lack of target support for the HTT tx MSDU extension
  468. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  469. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  470. * the HTT tx MSDU extension descriptor.
  471. * The host is not required to provide the HTT tx MSDU extension descriptor
  472. * just because the target supports it; the target must check the
  473. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  474. * extension descriptor is present.
  475. */
  476. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  477. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  478. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  479. };
  480. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  481. struct htt_option_tlv_header_t hdr;
  482. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  483. } POSTPACK;
  484. /*
  485. * For the tcl data command V2 and higher support added a new
  486. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  487. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  488. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  489. * HTT option TLV for specifying which version of the TCL metadata struct
  490. * should be used:
  491. * V1 -> use htt_tx_tcl_metadata struct
  492. * V2 -> use htt_tx_tcl_metadata_v2 struct
  493. * Old FW will only support V1.
  494. * New FW will support V2. New FW will still support V1, at least during
  495. * a transition period.
  496. * Similarly, old host will only support V1, and new host will support V1 + V2.
  497. *
  498. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  499. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  500. * of TCL metadata the host supports. If the host doesn't provide a
  501. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  502. * is implicitly understood that the host only supports V1.
  503. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  504. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  505. * the host shall use. The target shall only select one of the versions
  506. * supported by the host. If the target doesn't provide a
  507. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  508. * is implicitly understood that the V1 TCL metadata shall be used.
  509. */
  510. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  511. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  512. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  513. };
  514. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  515. struct htt_option_tlv_header_t hdr;
  516. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  517. } POSTPACK;
  518. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  519. HTT_OPTION_TLV_VALUE0_SET(word, value)
  520. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  521. HTT_OPTION_TLV_VALUE0_GET(word)
  522. typedef struct {
  523. union {
  524. /* BIT [11 : 0] :- tag
  525. * BIT [23 : 12] :- length
  526. * BIT [31 : 24] :- reserved
  527. */
  528. A_UINT32 tag__length;
  529. /*
  530. * The following struct is not endian-portable.
  531. * It is suitable for use within the target, which is known to be
  532. * little-endian.
  533. * The host should use the above endian-portable macros to access
  534. * the tag and length bitfields in an endian-neutral manner.
  535. */
  536. struct {
  537. A_UINT32 tag : 12, /* BIT [11 : 0] */
  538. length : 12, /* BIT [23 : 12] */
  539. reserved : 8; /* BIT [31 : 24] */
  540. };
  541. };
  542. } htt_tlv_hdr_t;
  543. typedef enum {
  544. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  545. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  546. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  547. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  548. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  549. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  550. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  551. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  552. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  553. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  554. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  555. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  556. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  557. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  558. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  559. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  560. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  561. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  562. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  563. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  564. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  565. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  566. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  567. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  568. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  569. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  570. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  571. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  572. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  573. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  574. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  575. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  576. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  577. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  578. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  579. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  580. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  581. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  582. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  583. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  584. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  585. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  586. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  587. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  588. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  589. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  590. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  591. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  592. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  593. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  594. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  595. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  596. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  597. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  598. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  599. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  600. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  601. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  602. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  603. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  604. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  605. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  606. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  607. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  608. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  609. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  610. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  611. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  612. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  613. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  614. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  615. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  616. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  617. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  618. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  619. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  620. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  621. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  622. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  623. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  624. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  625. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  626. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  627. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  628. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  629. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  630. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  631. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  632. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  633. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  634. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  635. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  636. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  637. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  638. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  639. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  640. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  641. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  642. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  643. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  644. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  645. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  646. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  647. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  648. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  649. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  650. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  651. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  652. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  653. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  654. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  655. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  656. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  657. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  658. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  659. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  660. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  661. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  662. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  663. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  664. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  665. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  666. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  667. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  668. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  669. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  670. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  671. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  672. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  673. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  674. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  675. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  676. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  677. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  678. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  679. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  680. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  681. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  682. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  683. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  684. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  685. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  686. HTT_STATS_MAX_TAG,
  687. } htt_tlv_tag_t;
  688. #define HTT_STATS_TLV_TAG_M 0x00000fff
  689. #define HTT_STATS_TLV_TAG_S 0
  690. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  691. #define HTT_STATS_TLV_LENGTH_S 12
  692. #define HTT_STATS_TLV_TAG_GET(_var) \
  693. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  694. HTT_STATS_TLV_TAG_S)
  695. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  696. do { \
  697. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  698. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  699. } while (0)
  700. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  701. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  702. HTT_STATS_TLV_LENGTH_S)
  703. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  704. do { \
  705. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  706. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  707. } while (0)
  708. /*=== host -> target messages ===============================================*/
  709. enum htt_h2t_msg_type {
  710. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  711. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  712. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  713. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  714. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  715. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  716. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  717. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  718. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  719. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  720. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  721. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  722. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  723. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  724. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  725. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  726. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  727. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  728. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  729. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  730. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  731. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  732. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  733. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  734. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  735. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  736. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  737. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  738. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  739. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  740. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  741. /* keep this last */
  742. HTT_H2T_NUM_MSGS
  743. };
  744. /*
  745. * HTT host to target message type -
  746. * stored in bits 7:0 of the first word of the message
  747. */
  748. #define HTT_H2T_MSG_TYPE_M 0xff
  749. #define HTT_H2T_MSG_TYPE_S 0
  750. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  751. do { \
  752. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  753. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  754. } while (0)
  755. #define HTT_H2T_MSG_TYPE_GET(word) \
  756. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  757. /**
  758. * @brief host -> target version number request message definition
  759. *
  760. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  761. *
  762. *
  763. * |31 24|23 16|15 8|7 0|
  764. * |----------------+----------------+----------------+----------------|
  765. * | reserved | msg type |
  766. * |-------------------------------------------------------------------|
  767. * : option request TLV (optional) |
  768. * :...................................................................:
  769. *
  770. * The VER_REQ message may consist of a single 4-byte word, or may be
  771. * extended with TLVs that specify which HTT options the host is requesting
  772. * from the target.
  773. * The following option TLVs may be appended to the VER_REQ message:
  774. * - HL_SUPPRESS_TX_COMPL_IND
  775. * - HL_MAX_TX_QUEUE_GROUPS
  776. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  777. * may be appended to the VER_REQ message (but only one TLV of each type).
  778. *
  779. * Header fields:
  780. * - MSG_TYPE
  781. * Bits 7:0
  782. * Purpose: identifies this as a version number request message
  783. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  784. */
  785. #define HTT_VER_REQ_BYTES 4
  786. /* TBDXXX: figure out a reasonable number */
  787. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  788. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  789. /**
  790. * @brief HTT tx MSDU descriptor
  791. *
  792. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  793. *
  794. * @details
  795. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  796. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  797. * the target firmware needs for the FW's tx processing, particularly
  798. * for creating the HW msdu descriptor.
  799. * The same HTT tx descriptor is used for HL and LL systems, though
  800. * a few fields within the tx descriptor are used only by LL or
  801. * only by HL.
  802. * The HTT tx descriptor is defined in two manners: by a struct with
  803. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  804. * definitions.
  805. * The target should use the struct def, for simplicitly and clarity,
  806. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  807. * neutral. Specifically, the host shall use the get/set macros built
  808. * around the mask + shift defs.
  809. */
  810. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  811. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  812. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  813. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  814. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  815. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  816. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  817. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  818. #define HTT_TX_VDEV_ID_WORD 0
  819. #define HTT_TX_VDEV_ID_MASK 0x3f
  820. #define HTT_TX_VDEV_ID_SHIFT 16
  821. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  822. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  823. #define HTT_TX_MSDU_LEN_DWORD 1
  824. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  825. /*
  826. * HTT_VAR_PADDR macros
  827. * Allow physical / bus addresses to be either a single 32-bit value,
  828. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  829. */
  830. #define HTT_VAR_PADDR32(var_name) \
  831. A_UINT32 var_name
  832. #define HTT_VAR_PADDR64_LE(var_name) \
  833. struct { \
  834. /* little-endian: lo precedes hi */ \
  835. A_UINT32 lo; \
  836. A_UINT32 hi; \
  837. } var_name
  838. /*
  839. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  840. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  841. * addresses are stored in a XXX-bit field.
  842. * This macro is used to define both htt_tx_msdu_desc32_t and
  843. * htt_tx_msdu_desc64_t structs.
  844. */
  845. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  846. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  847. { \
  848. /* DWORD 0: flags and meta-data */ \
  849. A_UINT32 \
  850. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  851. \
  852. /* pkt_subtype - \
  853. * Detailed specification of the tx frame contents, extending the \
  854. * general specification provided by pkt_type. \
  855. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  856. * pkt_type | pkt_subtype \
  857. * ============================================================== \
  858. * 802.3 | bit 0:3 - Reserved \
  859. * | bit 4: 0x0 - Copy-Engine Classification Results \
  860. * | not appended to the HTT message \
  861. * | 0x1 - Copy-Engine Classification Results \
  862. * | appended to the HTT message in the \
  863. * | format: \
  864. * | [HTT tx desc, frame header, \
  865. * | CE classification results] \
  866. * | The CE classification results begin \
  867. * | at the next 4-byte boundary after \
  868. * | the frame header. \
  869. * ------------+------------------------------------------------- \
  870. * Eth2 | bit 0:3 - Reserved \
  871. * | bit 4: 0x0 - Copy-Engine Classification Results \
  872. * | not appended to the HTT message \
  873. * | 0x1 - Copy-Engine Classification Results \
  874. * | appended to the HTT message. \
  875. * | See the above specification of the \
  876. * | CE classification results location. \
  877. * ------------+------------------------------------------------- \
  878. * native WiFi | bit 0:3 - Reserved \
  879. * | bit 4: 0x0 - Copy-Engine Classification Results \
  880. * | not appended to the HTT message \
  881. * | 0x1 - Copy-Engine Classification Results \
  882. * | appended to the HTT message. \
  883. * | See the above specification of the \
  884. * | CE classification results location. \
  885. * ------------+------------------------------------------------- \
  886. * mgmt | 0x0 - 802.11 MAC header absent \
  887. * | 0x1 - 802.11 MAC header present \
  888. * ------------+------------------------------------------------- \
  889. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  890. * | 0x1 - 802.11 MAC header present \
  891. * | bit 1: 0x0 - allow aggregation \
  892. * | 0x1 - don't allow aggregation \
  893. * | bit 2: 0x0 - perform encryption \
  894. * | 0x1 - don't perform encryption \
  895. * | bit 3: 0x0 - perform tx classification / queuing \
  896. * | 0x1 - don't perform tx classification; \
  897. * | insert the frame into the "misc" \
  898. * | tx queue \
  899. * | bit 4: 0x0 - Copy-Engine Classification Results \
  900. * | not appended to the HTT message \
  901. * | 0x1 - Copy-Engine Classification Results \
  902. * | appended to the HTT message. \
  903. * | See the above specification of the \
  904. * | CE classification results location. \
  905. */ \
  906. pkt_subtype: 5, \
  907. \
  908. /* pkt_type - \
  909. * General specification of the tx frame contents. \
  910. * The htt_pkt_type enum should be used to specify and check the \
  911. * value of this field. \
  912. */ \
  913. pkt_type: 3, \
  914. \
  915. /* vdev_id - \
  916. * ID for the vdev that is sending this tx frame. \
  917. * For certain non-standard packet types, e.g. pkt_type == raw \
  918. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  919. * This field is used primarily for determining where to queue \
  920. * broadcast and multicast frames. \
  921. */ \
  922. vdev_id: 6, \
  923. /* ext_tid - \
  924. * The extended traffic ID. \
  925. * If the TID is unknown, the extended TID is set to \
  926. * HTT_TX_EXT_TID_INVALID. \
  927. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  928. * value of the QoS TID. \
  929. * If the tx frame is non-QoS data, then the extended TID is set to \
  930. * HTT_TX_EXT_TID_NON_QOS. \
  931. * If the tx frame is multicast or broadcast, then the extended TID \
  932. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  933. */ \
  934. ext_tid: 5, \
  935. \
  936. /* postponed - \
  937. * This flag indicates whether the tx frame has been downloaded to \
  938. * the target before but discarded by the target, and now is being \
  939. * downloaded again; or if this is a new frame that is being \
  940. * downloaded for the first time. \
  941. * This flag allows the target to determine the correct order for \
  942. * transmitting new vs. old frames. \
  943. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  944. * This flag only applies to HL systems, since in LL systems, \
  945. * the tx flow control is handled entirely within the target. \
  946. */ \
  947. postponed: 1, \
  948. \
  949. /* extension - \
  950. * This flag indicates whether a HTT tx MSDU extension descriptor \
  951. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  952. * \
  953. * 0x0 - no extension MSDU descriptor is present \
  954. * 0x1 - an extension MSDU descriptor immediately follows the \
  955. * regular MSDU descriptor \
  956. */ \
  957. extension: 1, \
  958. \
  959. /* cksum_offload - \
  960. * This flag indicates whether checksum offload is enabled or not \
  961. * for this frame. Target FW use this flag to turn on HW checksumming \
  962. * 0x0 - No checksum offload \
  963. * 0x1 - L3 header checksum only \
  964. * 0x2 - L4 checksum only \
  965. * 0x3 - L3 header checksum + L4 checksum \
  966. */ \
  967. cksum_offload: 2, \
  968. \
  969. /* tx_comp_req - \
  970. * This flag indicates whether Tx Completion \
  971. * from fw is required or not. \
  972. * This flag is only relevant if tx completion is not \
  973. * universally enabled. \
  974. * For all LL systems, tx completion is mandatory, \
  975. * so this flag will be irrelevant. \
  976. * For HL systems tx completion is optional, but HL systems in which \
  977. * the bus throughput exceeds the WLAN throughput will \
  978. * probably want to always use tx completion, and thus \
  979. * would not check this flag. \
  980. * This flag is required when tx completions are not used universally, \
  981. * but are still required for certain tx frames for which \
  982. * an OTA delivery acknowledgment is needed by the host. \
  983. * In practice, this would be for HL systems in which the \
  984. * bus throughput is less than the WLAN throughput. \
  985. * \
  986. * 0x0 - Tx Completion Indication from Fw not required \
  987. * 0x1 - Tx Completion Indication from Fw is required \
  988. */ \
  989. tx_compl_req: 1; \
  990. \
  991. \
  992. /* DWORD 1: MSDU length and ID */ \
  993. A_UINT32 \
  994. len: 16, /* MSDU length, in bytes */ \
  995. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  996. * and this id is used to calculate fragmentation \
  997. * descriptor pointer inside the target based on \
  998. * the base address, configured inside the target. \
  999. */ \
  1000. \
  1001. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1002. /* frags_desc_ptr - \
  1003. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1004. * where the tx frame's fragments reside in memory. \
  1005. * This field only applies to LL systems, since in HL systems the \
  1006. * (degenerate single-fragment) fragmentation descriptor is created \
  1007. * within the target. \
  1008. */ \
  1009. _paddr__frags_desc_ptr_; \
  1010. \
  1011. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1012. /* \
  1013. * Peer ID : Target can use this value to know which peer-id packet \
  1014. * destined to. \
  1015. * It's intended to be specified by host in case of NAWDS. \
  1016. */ \
  1017. A_UINT16 peerid; \
  1018. \
  1019. /* \
  1020. * Channel frequency: This identifies the desired channel \
  1021. * frequency (in mhz) for tx frames. This is used by FW to help \
  1022. * determine when it is safe to transmit or drop frames for \
  1023. * off-channel operation. \
  1024. * The default value of zero indicates to FW that the corresponding \
  1025. * VDEV's home channel (if there is one) is the desired channel \
  1026. * frequency. \
  1027. */ \
  1028. A_UINT16 chanfreq; \
  1029. \
  1030. /* Reason reserved is commented is increasing the htt structure size \
  1031. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1032. * A_UINT32 reserved_dword3_bits0_31; \
  1033. */ \
  1034. } POSTPACK
  1035. /* define a htt_tx_msdu_desc32_t type */
  1036. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1037. /* define a htt_tx_msdu_desc64_t type */
  1038. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1039. /*
  1040. * Make htt_tx_msdu_desc_t be an alias for either
  1041. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1042. */
  1043. #if HTT_PADDR64
  1044. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1045. #else
  1046. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1047. #endif
  1048. /* decriptor information for Management frame*/
  1049. /*
  1050. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1051. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1052. */
  1053. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1054. extern A_UINT32 mgmt_hdr_len;
  1055. PREPACK struct htt_mgmt_tx_desc_t {
  1056. A_UINT32 msg_type;
  1057. #if HTT_PADDR64
  1058. A_UINT64 frag_paddr; /* DMAble address of the data */
  1059. #else
  1060. A_UINT32 frag_paddr; /* DMAble address of the data */
  1061. #endif
  1062. A_UINT32 desc_id; /* returned to host during completion
  1063. * to free the meory*/
  1064. A_UINT32 len; /* Fragment length */
  1065. A_UINT32 vdev_id; /* virtual device ID*/
  1066. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1067. } POSTPACK;
  1068. PREPACK struct htt_mgmt_tx_compl_ind {
  1069. A_UINT32 desc_id;
  1070. A_UINT32 status;
  1071. } POSTPACK;
  1072. /*
  1073. * This SDU header size comes from the summation of the following:
  1074. * 1. Max of:
  1075. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1076. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1077. * b. 802.11 header, for raw frames: 36 bytes
  1078. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1079. * QoS header, HT header)
  1080. * c. 802.3 header, for ethernet frames: 14 bytes
  1081. * (destination address, source address, ethertype / length)
  1082. * 2. Max of:
  1083. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1084. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1085. * 3. 802.1Q VLAN header: 4 bytes
  1086. * 4. LLC/SNAP header: 8 bytes
  1087. */
  1088. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1089. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1090. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1091. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1092. A_COMPILE_TIME_ASSERT(
  1093. htt_encap_hdr_size_max_check_nwifi,
  1094. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1095. A_COMPILE_TIME_ASSERT(
  1096. htt_encap_hdr_size_max_check_enet,
  1097. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1098. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1099. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1100. #define HTT_TX_HDR_SIZE_802_1Q 4
  1101. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1102. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1103. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1104. HTT_TX_HDR_SIZE_802_1Q + \
  1105. HTT_TX_HDR_SIZE_LLC_SNAP)
  1106. #define HTT_HL_TX_FRM_HDR_LEN \
  1107. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1108. #define HTT_LL_TX_FRM_HDR_LEN \
  1109. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1110. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1111. /* dword 0 */
  1112. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1113. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1114. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1115. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1116. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1117. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1118. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1119. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1120. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1121. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1122. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1123. #define HTT_TX_DESC_PKT_TYPE_S 13
  1124. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1125. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1126. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1127. #define HTT_TX_DESC_VDEV_ID_S 16
  1128. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1129. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1130. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1131. #define HTT_TX_DESC_EXT_TID_S 22
  1132. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1133. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1134. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1135. #define HTT_TX_DESC_POSTPONED_S 27
  1136. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1137. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1138. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1139. #define HTT_TX_DESC_EXTENSION_S 28
  1140. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1141. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1142. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1143. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1144. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1145. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1146. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1147. #define HTT_TX_DESC_TX_COMP_S 31
  1148. /* dword 1 */
  1149. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1150. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1151. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1152. #define HTT_TX_DESC_FRM_LEN_S 0
  1153. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1154. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1155. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1156. #define HTT_TX_DESC_FRM_ID_S 16
  1157. /* dword 2 */
  1158. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1159. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1160. /* for systems using 64-bit format for bus addresses */
  1161. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1162. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1163. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1164. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1165. /* for systems using 32-bit format for bus addresses */
  1166. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1167. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1168. /* dword 3 */
  1169. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1170. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1171. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1172. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1173. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1174. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1175. #if HTT_PADDR64
  1176. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1177. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1178. #else
  1179. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1180. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1181. #endif
  1182. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1183. #define HTT_TX_DESC_PEER_ID_S 0
  1184. /*
  1185. * TEMPORARY:
  1186. * The original definitions for the PEER_ID fields contained typos
  1187. * (with _DESC_PADDR appended to this PEER_ID field name).
  1188. * Retain deprecated original names for PEER_ID fields until all code that
  1189. * refers to them has been updated.
  1190. */
  1191. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1192. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1193. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1194. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1195. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1196. HTT_TX_DESC_PEER_ID_M
  1197. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1198. HTT_TX_DESC_PEER_ID_S
  1199. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1200. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1201. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1202. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1203. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1204. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1205. #if HTT_PADDR64
  1206. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1207. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1208. #else
  1209. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1210. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1211. #endif
  1212. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1213. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1214. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1215. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1216. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1217. do { \
  1218. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1219. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1220. } while (0)
  1221. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1222. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1223. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1224. do { \
  1225. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1226. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1227. } while (0)
  1228. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1229. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1230. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1231. do { \
  1232. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1233. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1234. } while (0)
  1235. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1236. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1237. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1238. do { \
  1239. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1240. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1241. } while (0)
  1242. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1243. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1244. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1245. do { \
  1246. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1247. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1248. } while (0)
  1249. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1250. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1251. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1252. do { \
  1253. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1254. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1255. } while (0)
  1256. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1257. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1258. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1259. do { \
  1260. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1261. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1262. } while (0)
  1263. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1264. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1265. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1266. do { \
  1267. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1268. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1269. } while (0)
  1270. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1271. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1272. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1273. do { \
  1274. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1275. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1276. } while (0)
  1277. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1278. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1279. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1280. do { \
  1281. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1282. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1283. } while (0)
  1284. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1285. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1286. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1287. do { \
  1288. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1289. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1290. } while (0)
  1291. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1292. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1293. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1294. do { \
  1295. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1296. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1297. } while (0)
  1298. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1299. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1300. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1303. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1304. } while (0)
  1305. /* enums used in the HTT tx MSDU extension descriptor */
  1306. enum {
  1307. htt_tx_guard_interval_regular = 0,
  1308. htt_tx_guard_interval_short = 1,
  1309. };
  1310. enum {
  1311. htt_tx_preamble_type_ofdm = 0,
  1312. htt_tx_preamble_type_cck = 1,
  1313. htt_tx_preamble_type_ht = 2,
  1314. htt_tx_preamble_type_vht = 3,
  1315. };
  1316. enum {
  1317. htt_tx_bandwidth_5MHz = 0,
  1318. htt_tx_bandwidth_10MHz = 1,
  1319. htt_tx_bandwidth_20MHz = 2,
  1320. htt_tx_bandwidth_40MHz = 3,
  1321. htt_tx_bandwidth_80MHz = 4,
  1322. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1323. };
  1324. /**
  1325. * @brief HTT tx MSDU extension descriptor
  1326. * @details
  1327. * If the target supports HTT tx MSDU extension descriptors, the host has
  1328. * the option of appending the following struct following the regular
  1329. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1330. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1331. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1332. * tx specs for each frame.
  1333. */
  1334. PREPACK struct htt_tx_msdu_desc_ext_t {
  1335. /* DWORD 0: flags */
  1336. A_UINT32
  1337. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1338. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1339. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1340. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1341. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1342. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1343. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1344. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1345. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1346. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1347. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1348. /* DWORD 1: tx power, tx rate, tx BW */
  1349. A_UINT32
  1350. /* pwr -
  1351. * Specify what power the tx frame needs to be transmitted at.
  1352. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1353. * The value needs to be appropriately sign-extended when extracting
  1354. * the value from the message and storing it in a variable that is
  1355. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1356. * automatically handles this sign-extension.)
  1357. * If the transmission uses multiple tx chains, this power spec is
  1358. * the total transmit power, assuming incoherent combination of
  1359. * per-chain power to produce the total power.
  1360. */
  1361. pwr: 8,
  1362. /* mcs_mask -
  1363. * Specify the allowable values for MCS index (modulation and coding)
  1364. * to use for transmitting the frame.
  1365. *
  1366. * For HT / VHT preamble types, this mask directly corresponds to
  1367. * the HT or VHT MCS indices that are allowed. For each bit N set
  1368. * within the mask, MCS index N is allowed for transmitting the frame.
  1369. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1370. * rates versus OFDM rates, so the host has the option of specifying
  1371. * that the target must transmit the frame with CCK or OFDM rates
  1372. * (not HT or VHT), but leaving the decision to the target whether
  1373. * to use CCK or OFDM.
  1374. *
  1375. * For CCK and OFDM, the bits within this mask are interpreted as
  1376. * follows:
  1377. * bit 0 -> CCK 1 Mbps rate is allowed
  1378. * bit 1 -> CCK 2 Mbps rate is allowed
  1379. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1380. * bit 3 -> CCK 11 Mbps rate is allowed
  1381. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1382. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1383. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1384. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1385. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1386. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1387. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1388. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1389. *
  1390. * The MCS index specification needs to be compatible with the
  1391. * bandwidth mask specification. For example, a MCS index == 9
  1392. * specification is inconsistent with a preamble type == VHT,
  1393. * Nss == 1, and channel bandwidth == 20 MHz.
  1394. *
  1395. * Furthermore, the host has only a limited ability to specify to
  1396. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1397. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1398. */
  1399. mcs_mask: 12,
  1400. /* nss_mask -
  1401. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1402. * Each bit in this mask corresponds to a Nss value:
  1403. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1404. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1405. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1406. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1407. * The values in the Nss mask must be suitable for the recipient, e.g.
  1408. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1409. * recipient which only supports 2x2 MIMO.
  1410. */
  1411. nss_mask: 4,
  1412. /* guard_interval -
  1413. * Specify a htt_tx_guard_interval enum value to indicate whether
  1414. * the transmission should use a regular guard interval or a
  1415. * short guard interval.
  1416. */
  1417. guard_interval: 1,
  1418. /* preamble_type_mask -
  1419. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1420. * may choose from for transmitting this frame.
  1421. * The bits in this mask correspond to the values in the
  1422. * htt_tx_preamble_type enum. For example, to allow the target
  1423. * to transmit the frame as either CCK or OFDM, this field would
  1424. * be set to
  1425. * (1 << htt_tx_preamble_type_ofdm) |
  1426. * (1 << htt_tx_preamble_type_cck)
  1427. */
  1428. preamble_type_mask: 4,
  1429. reserved1_31_29: 3; /* unused, set to 0x0 */
  1430. /* DWORD 2: tx chain mask, tx retries */
  1431. A_UINT32
  1432. /* chain_mask - specify which chains to transmit from */
  1433. chain_mask: 4,
  1434. /* retry_limit -
  1435. * Specify the maximum number of transmissions, including the
  1436. * initial transmission, to attempt before giving up if no ack
  1437. * is received.
  1438. * If the tx rate is specified, then all retries shall use the
  1439. * same rate as the initial transmission.
  1440. * If no tx rate is specified, the target can choose whether to
  1441. * retain the original rate during the retransmissions, or to
  1442. * fall back to a more robust rate.
  1443. */
  1444. retry_limit: 4,
  1445. /* bandwidth_mask -
  1446. * Specify what channel widths may be used for the transmission.
  1447. * A value of zero indicates "don't care" - the target may choose
  1448. * the transmission bandwidth.
  1449. * The bits within this mask correspond to the htt_tx_bandwidth
  1450. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1451. * The bandwidth_mask must be consistent with the preamble_type_mask
  1452. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1453. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1454. */
  1455. bandwidth_mask: 6,
  1456. reserved2_31_14: 18; /* unused, set to 0x0 */
  1457. /* DWORD 3: tx expiry time (TSF) LSBs */
  1458. A_UINT32 expire_tsf_lo;
  1459. /* DWORD 4: tx expiry time (TSF) MSBs */
  1460. A_UINT32 expire_tsf_hi;
  1461. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1462. } POSTPACK;
  1463. /* DWORD 0 */
  1464. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1465. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1466. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1467. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1468. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1469. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1470. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1484. /* DWORD 1 */
  1485. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1486. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1487. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1488. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1489. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1490. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1491. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1492. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1493. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1494. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1495. /* DWORD 2 */
  1496. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1497. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1498. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1499. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1500. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1501. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1502. /* DWORD 0 */
  1503. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1504. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1505. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1507. do { \
  1508. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1509. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1510. } while (0)
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1512. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1513. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1515. do { \
  1516. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1517. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1518. } while (0)
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1520. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1521. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1523. do { \
  1524. HTT_CHECK_SET_VAL( \
  1525. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1526. ((_var) |= ((_val) \
  1527. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1528. } while (0)
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1530. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1531. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1533. do { \
  1534. HTT_CHECK_SET_VAL( \
  1535. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1536. ((_var) |= ((_val) \
  1537. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1538. } while (0)
  1539. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1540. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1541. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1543. do { \
  1544. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1545. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1546. } while (0)
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1553. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1554. } while (0)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1562. } while (0)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1569. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1570. } while (0)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1573. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1577. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1578. } while (0)
  1579. /* DWORD 1 */
  1580. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1584. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1585. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1586. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1587. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1588. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1589. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1590. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1591. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1592. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1593. do { \
  1594. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1595. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1596. } while (0)
  1597. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1598. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1599. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1600. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1601. do { \
  1602. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1603. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1604. } while (0)
  1605. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1606. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1607. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1608. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1609. do { \
  1610. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1611. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1612. } while (0)
  1613. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1614. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1615. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1616. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1617. do { \
  1618. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1619. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1620. } while (0)
  1621. /* DWORD 2 */
  1622. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1623. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1624. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1625. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1626. do { \
  1627. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1628. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1629. } while (0)
  1630. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1631. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1632. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1633. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1634. do { \
  1635. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1636. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1637. } while (0)
  1638. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1639. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1640. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1641. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1642. do { \
  1643. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1644. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1645. } while (0)
  1646. typedef enum {
  1647. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1648. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1649. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1650. } htt_11ax_ltf_subtype_t;
  1651. typedef enum {
  1652. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1653. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1654. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1655. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1656. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1657. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1658. } htt_tx_ext2_preamble_type_t;
  1659. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1660. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1661. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1662. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1663. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1664. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1665. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1666. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1667. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1668. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1669. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1670. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1671. /**
  1672. * @brief HTT tx MSDU extension descriptor v2
  1673. * @details
  1674. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1675. * is received as tcl_exit_base->host_meta_info in firmware.
  1676. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1677. * are already part of tcl_exit_base.
  1678. */
  1679. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1680. /* DWORD 0: flags */
  1681. A_UINT32
  1682. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1683. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1684. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1685. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1686. valid_retries : 1, /* if set, tx retries spec is valid */
  1687. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1688. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1689. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1690. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1691. valid_key_flags : 1, /* if set, key flags is valid */
  1692. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1693. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1694. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1695. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1696. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1697. 1 = ENCRYPT,
  1698. 2 ~ 3 - Reserved */
  1699. /* retry_limit -
  1700. * Specify the maximum number of transmissions, including the
  1701. * initial transmission, to attempt before giving up if no ack
  1702. * is received.
  1703. * If the tx rate is specified, then all retries shall use the
  1704. * same rate as the initial transmission.
  1705. * If no tx rate is specified, the target can choose whether to
  1706. * retain the original rate during the retransmissions, or to
  1707. * fall back to a more robust rate.
  1708. */
  1709. retry_limit : 4,
  1710. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1711. * Valid only for 11ax preamble types HE_SU
  1712. * and HE_EXT_SU
  1713. */
  1714. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1715. * Valid only for 11ax preamble types HE_SU
  1716. * and HE_EXT_SU
  1717. */
  1718. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1719. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1720. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1721. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1722. */
  1723. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1724. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1725. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1726. * Use cases:
  1727. * Any time firmware uses TQM-BYPASS for Data
  1728. * TID, firmware expect host to set this bit.
  1729. */
  1730. /* DWORD 1: tx power, tx rate */
  1731. A_UINT32
  1732. power : 8, /* unit of the power field is 0.5 dbm
  1733. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1734. * signed value ranging from -64dbm to 63.5 dbm
  1735. */
  1736. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1737. * Setting more than one MCS isn't currently
  1738. * supported by the target (but is supported
  1739. * in the interface in case in the future
  1740. * the target supports specifications of
  1741. * a limited set of MCS values.
  1742. */
  1743. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1744. * Setting more than one Nss isn't currently
  1745. * supported by the target (but is supported
  1746. * in the interface in case in the future
  1747. * the target supports specifications of
  1748. * a limited set of Nss values.
  1749. */
  1750. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1751. update_peer_cache : 1; /* When set these custom values will be
  1752. * used for all packets, until the next
  1753. * update via this ext header.
  1754. * This is to make sure not all packets
  1755. * need to include this header.
  1756. */
  1757. /* DWORD 2: tx chain mask, tx retries */
  1758. A_UINT32
  1759. /* chain_mask - specify which chains to transmit from */
  1760. chain_mask : 8,
  1761. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1762. * TODO: Update Enum values for key_flags
  1763. */
  1764. /*
  1765. * Channel frequency: This identifies the desired channel
  1766. * frequency (in MHz) for tx frames. This is used by FW to help
  1767. * determine when it is safe to transmit or drop frames for
  1768. * off-channel operation.
  1769. * The default value of zero indicates to FW that the corresponding
  1770. * VDEV's home channel (if there is one) is the desired channel
  1771. * frequency.
  1772. */
  1773. chanfreq : 16;
  1774. /* DWORD 3: tx expiry time (TSF) LSBs */
  1775. A_UINT32 expire_tsf_lo;
  1776. /* DWORD 4: tx expiry time (TSF) MSBs */
  1777. A_UINT32 expire_tsf_hi;
  1778. /* DWORD 5: flags to control routing / processing of the MSDU */
  1779. A_UINT32
  1780. /* learning_frame
  1781. * When this flag is set, this frame will be dropped by FW
  1782. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1783. */
  1784. learning_frame : 1,
  1785. /* send_as_standalone
  1786. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1787. * i.e. with no A-MSDU or A-MPDU aggregation.
  1788. * The scope is extended to other use-cases.
  1789. */
  1790. send_as_standalone : 1,
  1791. /* is_host_opaque_valid
  1792. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1793. * with valid information.
  1794. */
  1795. is_host_opaque_valid : 1,
  1796. rsvd0 : 29;
  1797. /* DWORD 6 : Host opaque cookie for special frames */
  1798. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1799. rsvd1 : 16;
  1800. /*
  1801. * This structure can be expanded further up to 40 bytes
  1802. * by adding further DWORDs as needed.
  1803. */
  1804. } POSTPACK;
  1805. /* DWORD 0 */
  1806. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1807. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1808. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1809. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1810. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1811. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1832. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1833. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1834. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1835. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1836. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1837. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1838. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1839. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1840. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1841. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1842. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1843. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1844. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1845. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1846. /* DWORD 1 */
  1847. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1848. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1849. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1850. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1851. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1852. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1853. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1854. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1855. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1856. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1857. /* DWORD 2 */
  1858. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1859. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1860. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1861. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1862. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1863. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1864. /* DWORD 5 */
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1871. /* DWORD 6 */
  1872. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1873. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1874. /* DWORD 0 */
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1876. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1877. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1881. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1882. } while (0)
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1884. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1885. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1887. do { \
  1888. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1889. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1890. } while (0)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1892. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1893. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1895. do { \
  1896. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1897. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1898. } while (0)
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1900. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1901. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1903. do { \
  1904. HTT_CHECK_SET_VAL( \
  1905. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1906. ((_var) |= ((_val) \
  1907. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1908. } while (0)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1910. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1916. } while (0)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1918. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1924. } while (0)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL( \
  1931. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1932. ((_var) |= ((_val) \
  1933. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1934. } while (0)
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1936. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1939. do { \
  1940. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1941. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1942. } while (0)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1944. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1945. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1947. do { \
  1948. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1949. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1950. } while (0)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1952. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1953. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1955. do { \
  1956. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1957. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1958. } while (0)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1960. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1963. do { \
  1964. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1965. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1974. } while (0)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1982. } while (0)
  1983. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1984. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1985. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1986. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1990. } while (0)
  1991. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1998. } while (0)
  1999. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2025. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2026. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2030. } while (0)
  2031. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2032. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2033. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2034. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2038. } while (0)
  2039. /* DWORD 1 */
  2040. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2044. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2045. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2046. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2047. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2048. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2049. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2050. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2051. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2052. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2053. do { \
  2054. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2055. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2056. } while (0)
  2057. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2072. } while (0)
  2073. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2075. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2076. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2080. } while (0)
  2081. /* DWORD 2 */
  2082. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2083. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2084. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2085. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2089. } while (0)
  2090. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2091. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2092. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2093. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2094. do { \
  2095. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2096. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2097. } while (0)
  2098. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2099. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2100. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2101. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2105. } while (0)
  2106. /* DWORD 5 */
  2107. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2108. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2109. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2110. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2111. do { \
  2112. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2113. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2114. } while (0)
  2115. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2116. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2117. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2118. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2119. do { \
  2120. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2121. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2122. } while (0)
  2123. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2124. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2125. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2126. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2127. do { \
  2128. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2129. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2130. } while (0)
  2131. /* DWORD 6 */
  2132. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2133. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2134. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2135. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2136. do { \
  2137. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2138. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2139. } while (0)
  2140. typedef enum {
  2141. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2142. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2143. } htt_tcl_metadata_type;
  2144. /**
  2145. * @brief HTT TCL command number format
  2146. * @details
  2147. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2148. * available to firmware as tcl_exit_base->tcl_status_number.
  2149. * For regular / multicast packets host will send vdev and mac id and for
  2150. * NAWDS packets, host will send peer id.
  2151. * A_UINT32 is used to avoid endianness conversion problems.
  2152. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2153. */
  2154. typedef struct {
  2155. A_UINT32
  2156. type: 1, /* vdev_id based or peer_id based */
  2157. rsvd: 31;
  2158. } htt_tx_tcl_vdev_or_peer_t;
  2159. typedef struct {
  2160. A_UINT32
  2161. type: 1, /* vdev_id based or peer_id based */
  2162. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2163. vdev_id: 8,
  2164. pdev_id: 2,
  2165. host_inspected:1,
  2166. rsvd: 19;
  2167. } htt_tx_tcl_vdev_metadata;
  2168. typedef struct {
  2169. A_UINT32
  2170. type: 1, /* vdev_id based or peer_id based */
  2171. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2172. peer_id: 14,
  2173. rsvd: 16;
  2174. } htt_tx_tcl_peer_metadata;
  2175. PREPACK struct htt_tx_tcl_metadata {
  2176. union {
  2177. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2178. htt_tx_tcl_vdev_metadata vdev_meta;
  2179. htt_tx_tcl_peer_metadata peer_meta;
  2180. };
  2181. } POSTPACK;
  2182. /* DWORD 0 */
  2183. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2184. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2185. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2186. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2187. /* VDEV metadata */
  2188. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2189. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2190. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2191. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2192. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2193. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2194. /* PEER metadata */
  2195. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2196. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2197. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2198. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2199. HTT_TX_TCL_METADATA_TYPE_S)
  2200. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2201. do { \
  2202. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2203. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2204. } while (0)
  2205. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2206. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2207. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2208. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2209. do { \
  2210. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2211. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2212. } while (0)
  2213. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2214. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2215. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2216. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2217. do { \
  2218. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2219. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2220. } while (0)
  2221. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2222. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2223. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2224. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2225. do { \
  2226. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2227. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2228. } while (0)
  2229. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2230. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2231. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2232. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2233. do { \
  2234. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2235. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2236. } while (0)
  2237. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2238. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2239. HTT_TX_TCL_METADATA_PEER_ID_S)
  2240. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2241. do { \
  2242. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2243. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2244. } while (0)
  2245. /*------------------------------------------------------------------
  2246. * V2 Version of TCL Data Command
  2247. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2248. * MLO global_seq all flavours of TCL Data Cmd.
  2249. *-----------------------------------------------------------------*/
  2250. typedef enum {
  2251. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2252. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2253. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2254. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2255. } htt_tcl_metadata_type_v2;
  2256. /**
  2257. * @brief HTT TCL command number format
  2258. * @details
  2259. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2260. * available to firmware as tcl_exit_base->tcl_status_number.
  2261. * A_UINT32 is used to avoid endianness conversion problems.
  2262. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2263. */
  2264. typedef struct {
  2265. A_UINT32
  2266. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2267. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2268. vdev_id: 8,
  2269. pdev_id: 2,
  2270. host_inspected:1,
  2271. rsvd: 2,
  2272. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2273. } htt_tx_tcl_vdev_metadata_v2;
  2274. typedef struct {
  2275. A_UINT32
  2276. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2277. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2278. peer_id: 13,
  2279. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2280. } htt_tx_tcl_peer_metadata_v2;
  2281. typedef struct {
  2282. A_UINT32
  2283. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2284. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2285. svc_class_id: 8,
  2286. rsvd: 5,
  2287. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2288. } htt_tx_tcl_svc_class_id_metadata;
  2289. typedef struct {
  2290. A_UINT32
  2291. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2292. host_inspected: 1,
  2293. global_seq_no: 12,
  2294. rsvd: 1,
  2295. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2296. } htt_tx_tcl_global_seq_metadata;
  2297. PREPACK struct htt_tx_tcl_metadata_v2 {
  2298. union {
  2299. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2300. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2301. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2302. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2303. };
  2304. } POSTPACK;
  2305. /* DWORD 0 */
  2306. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2307. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2308. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2309. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2310. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2311. /* VDEV V2 metadata */
  2312. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2313. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2314. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2315. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2316. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2317. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2318. /* PEER V2 metadata */
  2319. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2320. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2321. /* SVC_CLASS_ID metadata */
  2322. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2323. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2324. /* Global Seq no metadata */
  2325. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2326. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2327. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2328. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2329. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2330. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2331. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2332. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2333. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2334. do { \
  2335. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2336. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2337. } while (0)
  2338. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2339. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2340. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2341. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2342. do { \
  2343. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2344. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2345. } while (0)
  2346. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2347. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2348. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2349. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2350. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2351. do { \
  2352. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2353. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2354. } while (0)
  2355. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2356. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2357. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2358. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2359. do { \
  2360. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2361. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2362. } while (0)
  2363. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2364. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2365. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2366. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2367. do { \
  2368. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2369. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2370. } while (0)
  2371. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2372. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2373. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2374. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2375. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2376. do { \
  2377. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2378. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2379. } while (0)
  2380. /*----- Get and Set V2 type field in Service Class fields ----*/
  2381. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2382. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2383. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2384. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2385. do { \
  2386. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2387. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2388. } while (0)
  2389. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2390. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2391. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2392. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2393. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2394. do { \
  2395. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2396. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2397. } while (0)
  2398. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2399. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2400. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2401. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2402. do { \
  2403. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2404. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2405. } while (0)
  2406. /*------------------------------------------------------------------
  2407. * End V2 Version of TCL Data Command
  2408. *-----------------------------------------------------------------*/
  2409. typedef enum {
  2410. HTT_TX_FW2WBM_TX_STATUS_OK,
  2411. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2412. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2413. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2414. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2415. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2416. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2417. HTT_TX_FW2WBM_TX_STATUS_MAX
  2418. } htt_tx_fw2wbm_tx_status_t;
  2419. typedef enum {
  2420. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2421. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2422. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2423. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2424. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2425. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2426. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2427. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2428. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2429. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2430. } htt_tx_fw2wbm_reinject_reason_t;
  2431. /**
  2432. * @brief HTT TX WBM Completion from firmware to host
  2433. * @details
  2434. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2435. * DWORD 3 and 4 for software based completions (Exception frames and
  2436. * TQM bypass frames)
  2437. * For software based completions, wbm_release_ring->release_source_module will
  2438. * be set to release_source_fw
  2439. */
  2440. PREPACK struct htt_tx_wbm_completion {
  2441. A_UINT32
  2442. sch_cmd_id: 24,
  2443. exception_frame: 1, /* If set, this packet was queued via exception path */
  2444. rsvd0_31_25: 7;
  2445. A_UINT32
  2446. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2447. * reception of an ACK or BA, this field indicates
  2448. * the RSSI of the received ACK or BA frame.
  2449. * When the frame is removed as result of a direct
  2450. * remove command from the SW, this field is set
  2451. * to 0x0 (which is never a valid value when real
  2452. * RSSI is available).
  2453. * Units: dB w.r.t noise floor
  2454. */
  2455. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2456. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2457. rsvd1_31_16: 16;
  2458. } POSTPACK;
  2459. /* DWORD 0 */
  2460. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2461. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2462. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2463. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2464. /* DWORD 1 */
  2465. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2466. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2467. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2468. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2469. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2470. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2471. /* DWORD 0 */
  2472. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2473. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2474. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2475. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2476. do { \
  2477. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2478. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2479. } while (0)
  2480. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2481. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2482. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2483. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2484. do { \
  2485. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2486. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2487. } while (0)
  2488. /* DWORD 1 */
  2489. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2490. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2491. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2492. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2493. do { \
  2494. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2495. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2496. } while (0)
  2497. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2498. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2499. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2500. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2501. do { \
  2502. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2503. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2504. } while (0)
  2505. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2506. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2507. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2508. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2509. do { \
  2510. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2511. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2512. } while (0)
  2513. /**
  2514. * @brief HTT TX WBM Completion from firmware to host
  2515. * @details
  2516. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2517. * (WBM) offload HW.
  2518. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2519. * For software based completions, release_source_module will
  2520. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2521. * struct wbm_release_ring and then switch to this after looking at
  2522. * release_source_module.
  2523. */
  2524. PREPACK struct htt_tx_wbm_completion_v2 {
  2525. A_UINT32
  2526. used_by_hw0; /* Refer to struct wbm_release_ring */
  2527. A_UINT32
  2528. used_by_hw1; /* Refer to struct wbm_release_ring */
  2529. A_UINT32
  2530. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2531. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2532. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2533. exception_frame: 1,
  2534. rsvd0: 12, /* For future use */
  2535. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2536. rsvd1: 1; /* For future use */
  2537. A_UINT32
  2538. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2539. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2540. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2541. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2542. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2543. */
  2544. A_UINT32
  2545. data1: 32;
  2546. A_UINT32
  2547. data2: 32;
  2548. A_UINT32
  2549. used_by_hw3; /* Refer to struct wbm_release_ring */
  2550. } POSTPACK;
  2551. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2552. /* DWORD 3 */
  2553. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2554. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2555. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2556. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2557. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2558. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2559. /* DWORD 3 */
  2560. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2561. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2562. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2563. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2564. do { \
  2565. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2566. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2567. } while (0)
  2568. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2569. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2570. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2571. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2572. do { \
  2573. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2574. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2575. } while (0)
  2576. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2577. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2578. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2579. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2580. do { \
  2581. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2582. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2583. } while (0)
  2584. typedef enum {
  2585. TX_FRAME_TYPE_UNDEFINED = 0,
  2586. TX_FRAME_TYPE_EAPOL = 1,
  2587. } htt_tx_wbm_status_frame_type;
  2588. /**
  2589. * @brief HTT TX WBM transmit status from firmware to host
  2590. * @details
  2591. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2592. * (WBM) offload HW.
  2593. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2594. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2595. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2596. */
  2597. PREPACK struct htt_tx_wbm_transmit_status {
  2598. A_UINT32
  2599. sch_cmd_id: 24,
  2600. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2601. * reception of an ACK or BA, this field indicates
  2602. * the RSSI of the received ACK or BA frame.
  2603. * When the frame is removed as result of a direct
  2604. * remove command from the SW, this field is set
  2605. * to 0x0 (which is never a valid value when real
  2606. * RSSI is available).
  2607. * Units: dB w.r.t noise floor
  2608. */
  2609. A_UINT32
  2610. sw_peer_id: 16,
  2611. tid_num: 5,
  2612. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2613. * and tid_num fields contain valid data.
  2614. * If this "valid" flag is not set, the
  2615. * sw_peer_id and tid_num fields must be ignored.
  2616. */
  2617. mcast: 1,
  2618. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2619. * contains valid data.
  2620. */
  2621. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2622. reserved: 4;
  2623. A_UINT32
  2624. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2625. * packets in the wbm completion path
  2626. */
  2627. } POSTPACK;
  2628. /* DWORD 4 */
  2629. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2630. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2631. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2632. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2633. /* DWORD 5 */
  2634. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2635. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2636. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2637. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2638. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2639. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2640. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2641. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2642. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2643. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2644. /* DWORD 4 */
  2645. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2646. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2647. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2648. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2652. } while (0)
  2653. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2654. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2655. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2656. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2657. do { \
  2658. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2659. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2660. } while (0)
  2661. /* DWORD 5 */
  2662. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2663. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2664. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2665. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2666. do { \
  2667. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2668. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2669. } while (0)
  2670. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2671. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2672. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2673. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2674. do { \
  2675. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2676. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2677. } while (0)
  2678. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2679. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2680. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2681. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2682. do { \
  2683. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2684. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2685. } while (0)
  2686. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2687. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2688. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2689. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2690. do { \
  2691. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2692. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2693. } while (0)
  2694. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2695. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2696. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2697. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2698. do { \
  2699. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2700. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2701. } while (0)
  2702. /**
  2703. * @brief HTT TX WBM reinject status from firmware to host
  2704. * @details
  2705. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2706. * (WBM) offload HW.
  2707. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2708. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2709. */
  2710. PREPACK struct htt_tx_wbm_reinject_status {
  2711. A_UINT32
  2712. reserved0: 32;
  2713. A_UINT32
  2714. reserved1: 32;
  2715. A_UINT32
  2716. reserved2: 32;
  2717. } POSTPACK;
  2718. /**
  2719. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2720. * @details
  2721. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2722. * (WBM) offload HW.
  2723. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2724. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2725. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2726. * STA side.
  2727. */
  2728. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2729. A_UINT32
  2730. mec_sa_addr_31_0;
  2731. A_UINT32
  2732. mec_sa_addr_47_32: 16,
  2733. sa_ast_index: 16;
  2734. A_UINT32
  2735. vdev_id: 8,
  2736. reserved0: 24;
  2737. } POSTPACK;
  2738. /* DWORD 4 - mec_sa_addr_31_0 */
  2739. /* DWORD 5 */
  2740. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2741. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2742. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2743. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2744. /* DWORD 6 */
  2745. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2746. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2747. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2748. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2749. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2750. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2753. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2754. } while (0)
  2755. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2756. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2757. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2758. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2761. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2762. } while (0)
  2763. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2764. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2765. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2766. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2769. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2770. } while (0)
  2771. typedef enum {
  2772. TX_FLOW_PRIORITY_BE,
  2773. TX_FLOW_PRIORITY_HIGH,
  2774. TX_FLOW_PRIORITY_LOW,
  2775. } htt_tx_flow_priority_t;
  2776. typedef enum {
  2777. TX_FLOW_LATENCY_SENSITIVE,
  2778. TX_FLOW_LATENCY_INSENSITIVE,
  2779. } htt_tx_flow_latency_t;
  2780. typedef enum {
  2781. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2782. TX_FLOW_INTERACTIVE_TRAFFIC,
  2783. TX_FLOW_PERIODIC_TRAFFIC,
  2784. TX_FLOW_BURSTY_TRAFFIC,
  2785. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2786. } htt_tx_flow_traffic_pattern_t;
  2787. /**
  2788. * @brief HTT TX Flow search metadata format
  2789. * @details
  2790. * Host will set this metadata in flow table's flow search entry along with
  2791. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2792. * firmware and TQM ring if the flow search entry wins.
  2793. * This metadata is available to firmware in that first MSDU's
  2794. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2795. * to one of the available flows for specific tid and returns the tqm flow
  2796. * pointer as part of htt_tx_map_flow_info message.
  2797. */
  2798. PREPACK struct htt_tx_flow_metadata {
  2799. A_UINT32
  2800. rsvd0_1_0: 2,
  2801. tid: 4,
  2802. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2803. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2804. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2805. * Else choose final tid based on latency, priority.
  2806. */
  2807. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2808. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2809. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2810. } POSTPACK;
  2811. /* DWORD 0 */
  2812. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2813. #define HTT_TX_FLOW_METADATA_TID_S 2
  2814. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2815. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2816. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2817. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2818. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2819. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2820. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2821. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2822. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2823. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2824. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2825. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2826. /* DWORD 0 */
  2827. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2828. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2829. HTT_TX_FLOW_METADATA_TID_S)
  2830. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2831. do { \
  2832. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2833. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2834. } while (0)
  2835. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2836. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2837. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2838. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2839. do { \
  2840. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2841. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2842. } while (0)
  2843. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2844. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2845. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2846. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2847. do { \
  2848. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2849. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2850. } while (0)
  2851. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2852. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2853. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2854. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2855. do { \
  2856. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2857. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2858. } while (0)
  2859. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2860. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2861. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2862. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2863. do { \
  2864. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2865. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2866. } while (0)
  2867. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2868. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2869. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2870. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2873. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2874. } while (0)
  2875. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2876. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2877. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2878. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2881. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2882. } while (0)
  2883. /**
  2884. * @brief host -> target ADD WDS Entry
  2885. *
  2886. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2887. *
  2888. * @brief host -> target DELETE WDS Entry
  2889. *
  2890. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2891. *
  2892. * @details
  2893. * HTT wds entry from source port learning
  2894. * Host will learn wds entries from rx and send this message to firmware
  2895. * to enable firmware to configure/delete AST entries for wds clients.
  2896. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2897. * and when SA's entry is deleted, firmware removes this AST entry
  2898. *
  2899. * The message would appear as follows:
  2900. *
  2901. * |31 30|29 |17 16|15 8|7 0|
  2902. * |----------------+----------------+----------------+----------------|
  2903. * | rsvd0 |PDVID| vdev_id | msg_type |
  2904. * |-------------------------------------------------------------------|
  2905. * | sa_addr_31_0 |
  2906. * |-------------------------------------------------------------------|
  2907. * | | ta_peer_id | sa_addr_47_32 |
  2908. * |-------------------------------------------------------------------|
  2909. * Where PDVID = pdev_id
  2910. *
  2911. * The message is interpreted as follows:
  2912. *
  2913. * dword0 - b'0:7 - msg_type: This will be set to
  2914. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2915. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2916. *
  2917. * dword0 - b'8:15 - vdev_id
  2918. *
  2919. * dword0 - b'16:17 - pdev_id
  2920. *
  2921. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2922. *
  2923. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2924. *
  2925. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2926. *
  2927. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2928. */
  2929. PREPACK struct htt_wds_entry {
  2930. A_UINT32
  2931. msg_type: 8,
  2932. vdev_id: 8,
  2933. pdev_id: 2,
  2934. rsvd0: 14;
  2935. A_UINT32 sa_addr_31_0;
  2936. A_UINT32
  2937. sa_addr_47_32: 16,
  2938. ta_peer_id: 14,
  2939. rsvd2: 2;
  2940. } POSTPACK;
  2941. /* DWORD 0 */
  2942. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2943. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2944. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2945. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2946. /* DWORD 2 */
  2947. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2948. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2949. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2950. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2951. /* DWORD 0 */
  2952. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2953. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2954. HTT_WDS_ENTRY_VDEV_ID_S)
  2955. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2958. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2959. } while (0)
  2960. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2961. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2962. HTT_WDS_ENTRY_PDEV_ID_S)
  2963. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2966. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2967. } while (0)
  2968. /* DWORD 2 */
  2969. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2970. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2971. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2972. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2973. do { \
  2974. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2975. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2976. } while (0)
  2977. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2978. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2979. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2980. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2981. do { \
  2982. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2983. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2984. } while (0)
  2985. /**
  2986. * @brief MAC DMA rx ring setup specification
  2987. *
  2988. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2989. *
  2990. * @details
  2991. * To allow for dynamic rx ring reconfiguration and to avoid race
  2992. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2993. * it uses. Instead, it sends this message to the target, indicating how
  2994. * the rx ring used by the host should be set up and maintained.
  2995. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2996. * specifications.
  2997. *
  2998. * |31 16|15 8|7 0|
  2999. * |---------------------------------------------------------------|
  3000. * header: | reserved | num rings | msg type |
  3001. * |---------------------------------------------------------------|
  3002. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3003. #if HTT_PADDR64
  3004. * | FW_IDX shadow register physical address (bits 63:32) |
  3005. #endif
  3006. * |---------------------------------------------------------------|
  3007. * | rx ring base physical address (bits 31:0) |
  3008. #if HTT_PADDR64
  3009. * | rx ring base physical address (bits 63:32) |
  3010. #endif
  3011. * |---------------------------------------------------------------|
  3012. * | rx ring buffer size | rx ring length |
  3013. * |---------------------------------------------------------------|
  3014. * | FW_IDX initial value | enabled flags |
  3015. * |---------------------------------------------------------------|
  3016. * | MSDU payload offset | 802.11 header offset |
  3017. * |---------------------------------------------------------------|
  3018. * | PPDU end offset | PPDU start offset |
  3019. * |---------------------------------------------------------------|
  3020. * | MPDU end offset | MPDU start offset |
  3021. * |---------------------------------------------------------------|
  3022. * | MSDU end offset | MSDU start offset |
  3023. * |---------------------------------------------------------------|
  3024. * | frag info offset | rx attention offset |
  3025. * |---------------------------------------------------------------|
  3026. * payload 2, if present, has the same format as payload 1
  3027. * Header fields:
  3028. * - MSG_TYPE
  3029. * Bits 7:0
  3030. * Purpose: identifies this as an rx ring configuration message
  3031. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3032. * - NUM_RINGS
  3033. * Bits 15:8
  3034. * Purpose: indicates whether the host is setting up one rx ring or two
  3035. * Value: 1 or 2
  3036. * Payload:
  3037. * for systems using 64-bit format for bus addresses:
  3038. * - IDX_SHADOW_REG_PADDR_LO
  3039. * Bits 31:0
  3040. * Value: lower 4 bytes of physical address of the host's
  3041. * FW_IDX shadow register
  3042. * - IDX_SHADOW_REG_PADDR_HI
  3043. * Bits 31:0
  3044. * Value: upper 4 bytes of physical address of the host's
  3045. * FW_IDX shadow register
  3046. * - RING_BASE_PADDR_LO
  3047. * Bits 31:0
  3048. * Value: lower 4 bytes of physical address of the host's rx ring
  3049. * - RING_BASE_PADDR_HI
  3050. * Bits 31:0
  3051. * Value: uppper 4 bytes of physical address of the host's rx ring
  3052. * for systems using 32-bit format for bus addresses:
  3053. * - IDX_SHADOW_REG_PADDR
  3054. * Bits 31:0
  3055. * Value: physical address of the host's FW_IDX shadow register
  3056. * - RING_BASE_PADDR
  3057. * Bits 31:0
  3058. * Value: physical address of the host's rx ring
  3059. * - RING_LEN
  3060. * Bits 15:0
  3061. * Value: number of elements in the rx ring
  3062. * - RING_BUF_SZ
  3063. * Bits 31:16
  3064. * Value: size of the buffers referenced by the rx ring, in byte units
  3065. * - ENABLED_FLAGS
  3066. * Bits 15:0
  3067. * Value: 1-bit flags to show whether different rx fields are enabled
  3068. * bit 0: 802.11 header enabled (1) or disabled (0)
  3069. * bit 1: MSDU payload enabled (1) or disabled (0)
  3070. * bit 2: PPDU start enabled (1) or disabled (0)
  3071. * bit 3: PPDU end enabled (1) or disabled (0)
  3072. * bit 4: MPDU start enabled (1) or disabled (0)
  3073. * bit 5: MPDU end enabled (1) or disabled (0)
  3074. * bit 6: MSDU start enabled (1) or disabled (0)
  3075. * bit 7: MSDU end enabled (1) or disabled (0)
  3076. * bit 8: rx attention enabled (1) or disabled (0)
  3077. * bit 9: frag info enabled (1) or disabled (0)
  3078. * bit 10: unicast rx enabled (1) or disabled (0)
  3079. * bit 11: multicast rx enabled (1) or disabled (0)
  3080. * bit 12: ctrl rx enabled (1) or disabled (0)
  3081. * bit 13: mgmt rx enabled (1) or disabled (0)
  3082. * bit 14: null rx enabled (1) or disabled (0)
  3083. * bit 15: phy data rx enabled (1) or disabled (0)
  3084. * - IDX_INIT_VAL
  3085. * Bits 31:16
  3086. * Purpose: Specify the initial value for the FW_IDX.
  3087. * Value: the number of buffers initially present in the host's rx ring
  3088. * - OFFSET_802_11_HDR
  3089. * Bits 15:0
  3090. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3091. * - OFFSET_MSDU_PAYLOAD
  3092. * Bits 31:16
  3093. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3094. * - OFFSET_PPDU_START
  3095. * Bits 15:0
  3096. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3097. * - OFFSET_PPDU_END
  3098. * Bits 31:16
  3099. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3100. * - OFFSET_MPDU_START
  3101. * Bits 15:0
  3102. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3103. * - OFFSET_MPDU_END
  3104. * Bits 31:16
  3105. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3106. * - OFFSET_MSDU_START
  3107. * Bits 15:0
  3108. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3109. * - OFFSET_MSDU_END
  3110. * Bits 31:16
  3111. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3112. * - OFFSET_RX_ATTN
  3113. * Bits 15:0
  3114. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3115. * - OFFSET_FRAG_INFO
  3116. * Bits 31:16
  3117. * Value: offset in QUAD-bytes of frag info table
  3118. */
  3119. /* header fields */
  3120. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3121. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3122. /* payload fields */
  3123. /* for systems using a 64-bit format for bus addresses */
  3124. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3125. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3126. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3127. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3128. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3129. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3130. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3131. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3132. /* for systems using a 32-bit format for bus addresses */
  3133. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3134. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3135. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3136. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3137. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3138. #define HTT_RX_RING_CFG_LEN_S 0
  3139. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3140. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3141. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3142. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3143. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3144. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3145. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3146. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3147. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3148. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3149. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3150. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3151. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3152. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3153. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3154. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3155. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3156. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3157. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3158. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3159. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3160. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3161. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3162. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3163. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3164. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3165. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3166. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3167. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3168. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3169. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3170. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3171. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3172. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3173. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3174. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3175. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3176. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3177. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3178. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3179. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3180. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3181. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3182. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3183. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3184. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3185. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3186. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3187. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3188. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3189. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3190. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3191. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3192. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3193. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3194. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3195. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3196. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3197. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3198. #if HTT_PADDR64
  3199. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3200. #else
  3201. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3202. #endif
  3203. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3204. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3205. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3206. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3207. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3208. do { \
  3209. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3210. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3211. } while (0)
  3212. /* degenerate case for 32-bit fields */
  3213. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3214. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3215. ((_var) = (_val))
  3216. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3217. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3218. ((_var) = (_val))
  3219. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3220. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3221. ((_var) = (_val))
  3222. /* degenerate case for 32-bit fields */
  3223. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3224. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3225. ((_var) = (_val))
  3226. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3227. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3228. ((_var) = (_val))
  3229. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3230. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3231. ((_var) = (_val))
  3232. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3233. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3234. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3235. do { \
  3236. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3237. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3238. } while (0)
  3239. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3240. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3241. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3242. do { \
  3243. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3244. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3245. } while (0)
  3246. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3247. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3248. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3249. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3250. do { \
  3251. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3252. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3253. } while (0)
  3254. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3255. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3256. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3257. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3258. do { \
  3259. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3260. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3261. } while (0)
  3262. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3263. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3264. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3265. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3266. do { \
  3267. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3268. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3269. } while (0)
  3270. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3271. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3272. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3273. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3274. do { \
  3275. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3276. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3277. } while (0)
  3278. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3279. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3280. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3281. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3282. do { \
  3283. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3284. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3285. } while (0)
  3286. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3287. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3288. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3289. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3290. do { \
  3291. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3292. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3293. } while (0)
  3294. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3295. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3296. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3297. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3298. do { \
  3299. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3300. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3301. } while (0)
  3302. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3303. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3304. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3305. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3306. do { \
  3307. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3308. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3309. } while (0)
  3310. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3311. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3312. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3313. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3314. do { \
  3315. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3316. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3317. } while (0)
  3318. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3319. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3320. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3321. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3322. do { \
  3323. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3324. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3325. } while (0)
  3326. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3327. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3328. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3329. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3330. do { \
  3331. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3332. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3333. } while (0)
  3334. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3335. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3336. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3337. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3338. do { \
  3339. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3340. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3341. } while (0)
  3342. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3343. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3344. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3345. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3346. do { \
  3347. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3348. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3349. } while (0)
  3350. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3351. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3352. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3353. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3354. do { \
  3355. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3356. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3357. } while (0)
  3358. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3359. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3360. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3361. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3362. do { \
  3363. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3364. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3365. } while (0)
  3366. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3367. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3368. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3369. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3370. do { \
  3371. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3372. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3373. } while (0)
  3374. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3375. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3376. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3377. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3378. do { \
  3379. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3380. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3381. } while (0)
  3382. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3383. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3384. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3385. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3386. do { \
  3387. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3388. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3389. } while (0)
  3390. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3391. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3392. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3393. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3396. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3397. } while (0)
  3398. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3399. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3400. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3401. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3402. do { \
  3403. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3404. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3405. } while (0)
  3406. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3407. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3408. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3409. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3412. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3413. } while (0)
  3414. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3415. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3416. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3417. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3418. do { \
  3419. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3420. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3421. } while (0)
  3422. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3423. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3424. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3425. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3426. do { \
  3427. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3428. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3429. } while (0)
  3430. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3431. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3432. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3433. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3436. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3437. } while (0)
  3438. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3439. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3440. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3441. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3444. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3445. } while (0)
  3446. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3447. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3448. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3449. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3450. do { \
  3451. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3452. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3453. } while (0)
  3454. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3455. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3456. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3457. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3458. do { \
  3459. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3460. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3461. } while (0)
  3462. /**
  3463. * @brief host -> target FW statistics retrieve
  3464. *
  3465. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3466. *
  3467. * @details
  3468. * The following field definitions describe the format of the HTT host
  3469. * to target FW stats retrieve message. The message specifies the type of
  3470. * stats host wants to retrieve.
  3471. *
  3472. * |31 24|23 16|15 8|7 0|
  3473. * |-----------------------------------------------------------|
  3474. * | stats types request bitmask | msg type |
  3475. * |-----------------------------------------------------------|
  3476. * | stats types reset bitmask | reserved |
  3477. * |-----------------------------------------------------------|
  3478. * | stats type | config value |
  3479. * |-----------------------------------------------------------|
  3480. * | cookie LSBs |
  3481. * |-----------------------------------------------------------|
  3482. * | cookie MSBs |
  3483. * |-----------------------------------------------------------|
  3484. * Header fields:
  3485. * - MSG_TYPE
  3486. * Bits 7:0
  3487. * Purpose: identifies this is a stats upload request message
  3488. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3489. * - UPLOAD_TYPES
  3490. * Bits 31:8
  3491. * Purpose: identifies which types of FW statistics to upload
  3492. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3493. * - RESET_TYPES
  3494. * Bits 31:8
  3495. * Purpose: identifies which types of FW statistics to reset
  3496. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3497. * - CFG_VAL
  3498. * Bits 23:0
  3499. * Purpose: give an opaque configuration value to the specified stats type
  3500. * Value: stats-type specific configuration value
  3501. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3502. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3503. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3504. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3505. * - CFG_STAT_TYPE
  3506. * Bits 31:24
  3507. * Purpose: specify which stats type (if any) the config value applies to
  3508. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3509. * a valid configuration specification
  3510. * - COOKIE_LSBS
  3511. * Bits 31:0
  3512. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3513. * message with its preceding host->target stats request message.
  3514. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3515. * - COOKIE_MSBS
  3516. * Bits 31:0
  3517. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3518. * message with its preceding host->target stats request message.
  3519. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3520. */
  3521. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3522. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3523. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3524. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3525. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3526. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3527. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3528. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3529. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3530. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3531. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3532. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3533. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3534. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3537. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3538. } while (0)
  3539. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3540. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3541. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3542. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3545. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3546. } while (0)
  3547. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3548. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3549. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3550. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3551. do { \
  3552. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3553. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3554. } while (0)
  3555. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3556. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3557. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3558. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3559. do { \
  3560. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3561. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3562. } while (0)
  3563. /**
  3564. * @brief host -> target HTT out-of-band sync request
  3565. *
  3566. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3567. *
  3568. * @details
  3569. * The HTT SYNC tells the target to suspend processing of subsequent
  3570. * HTT host-to-target messages until some other target agent locally
  3571. * informs the target HTT FW that the current sync counter is equal to
  3572. * or greater than (in a modulo sense) the sync counter specified in
  3573. * the SYNC message.
  3574. * This allows other host-target components to synchronize their operation
  3575. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3576. * security key has been downloaded to and activated by the target.
  3577. * In the absence of any explicit synchronization counter value
  3578. * specification, the target HTT FW will use zero as the default current
  3579. * sync value.
  3580. *
  3581. * |31 24|23 16|15 8|7 0|
  3582. * |-----------------------------------------------------------|
  3583. * | reserved | sync count | msg type |
  3584. * |-----------------------------------------------------------|
  3585. * Header fields:
  3586. * - MSG_TYPE
  3587. * Bits 7:0
  3588. * Purpose: identifies this as a sync message
  3589. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3590. * - SYNC_COUNT
  3591. * Bits 15:8
  3592. * Purpose: specifies what sync value the HTT FW will wait for from
  3593. * an out-of-band specification to resume its operation
  3594. * Value: in-band sync counter value to compare against the out-of-band
  3595. * counter spec.
  3596. * The HTT target FW will suspend its host->target message processing
  3597. * as long as
  3598. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3599. */
  3600. #define HTT_H2T_SYNC_MSG_SZ 4
  3601. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3602. #define HTT_H2T_SYNC_COUNT_S 8
  3603. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3604. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3605. HTT_H2T_SYNC_COUNT_S)
  3606. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3607. do { \
  3608. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3609. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3610. } while (0)
  3611. /**
  3612. * @brief host -> target HTT aggregation configuration
  3613. *
  3614. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3615. */
  3616. #define HTT_AGGR_CFG_MSG_SZ 4
  3617. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3618. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3619. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3620. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3621. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3622. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3623. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3624. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3625. do { \
  3626. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3627. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3628. } while (0)
  3629. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3630. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3631. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3632. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3633. do { \
  3634. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3635. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3636. } while (0)
  3637. /**
  3638. * @brief host -> target HTT configure max amsdu info per vdev
  3639. *
  3640. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3641. *
  3642. * @details
  3643. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3644. *
  3645. * |31 21|20 16|15 8|7 0|
  3646. * |-----------------------------------------------------------|
  3647. * | reserved | vdev id | max amsdu | msg type |
  3648. * |-----------------------------------------------------------|
  3649. * Header fields:
  3650. * - MSG_TYPE
  3651. * Bits 7:0
  3652. * Purpose: identifies this as a aggr cfg ex message
  3653. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3654. * - MAX_NUM_AMSDU_SUBFRM
  3655. * Bits 15:8
  3656. * Purpose: max MSDUs per A-MSDU
  3657. * - VDEV_ID
  3658. * Bits 20:16
  3659. * Purpose: ID of the vdev to which this limit is applied
  3660. */
  3661. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3662. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3663. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3664. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3665. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3666. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3667. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3668. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3669. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3672. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3673. } while (0)
  3674. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3675. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3676. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3677. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3680. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3681. } while (0)
  3682. /**
  3683. * @brief HTT WDI_IPA Config Message
  3684. *
  3685. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3686. *
  3687. * @details
  3688. * The HTT WDI_IPA config message is created/sent by host at driver
  3689. * init time. It contains information about data structures used on
  3690. * WDI_IPA TX and RX path.
  3691. * TX CE ring is used for pushing packet metadata from IPA uC
  3692. * to WLAN FW
  3693. * TX Completion ring is used for generating TX completions from
  3694. * WLAN FW to IPA uC
  3695. * RX Indication ring is used for indicating RX packets from FW
  3696. * to IPA uC
  3697. * RX Ring2 is used as either completion ring or as second
  3698. * indication ring. when Ring2 is used as completion ring, IPA uC
  3699. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3700. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3701. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3702. * indicated in RX Indication ring. Please see WDI_IPA specification
  3703. * for more details.
  3704. * |31 24|23 16|15 8|7 0|
  3705. * |----------------+----------------+----------------+----------------|
  3706. * | tx pkt pool size | Rsvd | msg_type |
  3707. * |-------------------------------------------------------------------|
  3708. * | tx comp ring base (bits 31:0) |
  3709. #if HTT_PADDR64
  3710. * | tx comp ring base (bits 63:32) |
  3711. #endif
  3712. * |-------------------------------------------------------------------|
  3713. * | tx comp ring size |
  3714. * |-------------------------------------------------------------------|
  3715. * | tx comp WR_IDX physical address (bits 31:0) |
  3716. #if HTT_PADDR64
  3717. * | tx comp WR_IDX physical address (bits 63:32) |
  3718. #endif
  3719. * |-------------------------------------------------------------------|
  3720. * | tx CE WR_IDX physical address (bits 31:0) |
  3721. #if HTT_PADDR64
  3722. * | tx CE WR_IDX physical address (bits 63:32) |
  3723. #endif
  3724. * |-------------------------------------------------------------------|
  3725. * | rx indication ring base (bits 31:0) |
  3726. #if HTT_PADDR64
  3727. * | rx indication ring base (bits 63:32) |
  3728. #endif
  3729. * |-------------------------------------------------------------------|
  3730. * | rx indication ring size |
  3731. * |-------------------------------------------------------------------|
  3732. * | rx ind RD_IDX physical address (bits 31:0) |
  3733. #if HTT_PADDR64
  3734. * | rx ind RD_IDX physical address (bits 63:32) |
  3735. #endif
  3736. * |-------------------------------------------------------------------|
  3737. * | rx ind WR_IDX physical address (bits 31:0) |
  3738. #if HTT_PADDR64
  3739. * | rx ind WR_IDX physical address (bits 63:32) |
  3740. #endif
  3741. * |-------------------------------------------------------------------|
  3742. * |-------------------------------------------------------------------|
  3743. * | rx ring2 base (bits 31:0) |
  3744. #if HTT_PADDR64
  3745. * | rx ring2 base (bits 63:32) |
  3746. #endif
  3747. * |-------------------------------------------------------------------|
  3748. * | rx ring2 size |
  3749. * |-------------------------------------------------------------------|
  3750. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3751. #if HTT_PADDR64
  3752. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3753. #endif
  3754. * |-------------------------------------------------------------------|
  3755. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3756. #if HTT_PADDR64
  3757. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3758. #endif
  3759. * |-------------------------------------------------------------------|
  3760. *
  3761. * Header fields:
  3762. * Header fields:
  3763. * - MSG_TYPE
  3764. * Bits 7:0
  3765. * Purpose: Identifies this as WDI_IPA config message
  3766. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3767. * - TX_PKT_POOL_SIZE
  3768. * Bits 15:0
  3769. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3770. * WDI_IPA TX path
  3771. * For systems using 32-bit format for bus addresses:
  3772. * - TX_COMP_RING_BASE_ADDR
  3773. * Bits 31:0
  3774. * Purpose: TX Completion Ring base address in DDR
  3775. * - TX_COMP_RING_SIZE
  3776. * Bits 31:0
  3777. * Purpose: TX Completion Ring size (must be power of 2)
  3778. * - TX_COMP_WR_IDX_ADDR
  3779. * Bits 31:0
  3780. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3781. * updates the Write Index for WDI_IPA TX completion ring
  3782. * - TX_CE_WR_IDX_ADDR
  3783. * Bits 31:0
  3784. * Purpose: DDR address where IPA uC
  3785. * updates the WR Index for TX CE ring
  3786. * (needed for fusion platforms)
  3787. * - RX_IND_RING_BASE_ADDR
  3788. * Bits 31:0
  3789. * Purpose: RX Indication Ring base address in DDR
  3790. * - RX_IND_RING_SIZE
  3791. * Bits 31:0
  3792. * Purpose: RX Indication Ring size
  3793. * - RX_IND_RD_IDX_ADDR
  3794. * Bits 31:0
  3795. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3796. * RX indication ring
  3797. * - RX_IND_WR_IDX_ADDR
  3798. * Bits 31:0
  3799. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3800. * updates the Write Index for WDI_IPA RX indication ring
  3801. * - RX_RING2_BASE_ADDR
  3802. * Bits 31:0
  3803. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3804. * - RX_RING2_SIZE
  3805. * Bits 31:0
  3806. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3807. * - RX_RING2_RD_IDX_ADDR
  3808. * Bits 31:0
  3809. * Purpose: If Second RX ring is Indication ring, DDR address where
  3810. * IPA uC updates the Read Index for Ring2.
  3811. * If Second RX ring is completion ring, this is NOT used
  3812. * - RX_RING2_WR_IDX_ADDR
  3813. * Bits 31:0
  3814. * Purpose: If Second RX ring is Indication ring, DDR address where
  3815. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3816. * If second RX ring is completion ring, DDR address where
  3817. * IPA uC updates the Write Index for Ring 2.
  3818. * For systems using 64-bit format for bus addresses:
  3819. * - TX_COMP_RING_BASE_ADDR_LO
  3820. * Bits 31:0
  3821. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3822. * - TX_COMP_RING_BASE_ADDR_HI
  3823. * Bits 31:0
  3824. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3825. * - TX_COMP_RING_SIZE
  3826. * Bits 31:0
  3827. * Purpose: TX Completion Ring size (must be power of 2)
  3828. * - TX_COMP_WR_IDX_ADDR_LO
  3829. * Bits 31:0
  3830. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3831. * Lower 4 bytes of DDR address where WIFI FW
  3832. * updates the Write Index for WDI_IPA TX completion ring
  3833. * - TX_COMP_WR_IDX_ADDR_HI
  3834. * Bits 31:0
  3835. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3836. * Higher 4 bytes of DDR address where WIFI FW
  3837. * updates the Write Index for WDI_IPA TX completion ring
  3838. * - TX_CE_WR_IDX_ADDR_LO
  3839. * Bits 31:0
  3840. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3841. * updates the WR Index for TX CE ring
  3842. * (needed for fusion platforms)
  3843. * - TX_CE_WR_IDX_ADDR_HI
  3844. * Bits 31:0
  3845. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3846. * updates the WR Index for TX CE ring
  3847. * (needed for fusion platforms)
  3848. * - RX_IND_RING_BASE_ADDR_LO
  3849. * Bits 31:0
  3850. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3851. * - RX_IND_RING_BASE_ADDR_HI
  3852. * Bits 31:0
  3853. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3854. * - RX_IND_RING_SIZE
  3855. * Bits 31:0
  3856. * Purpose: RX Indication Ring size
  3857. * - RX_IND_RD_IDX_ADDR_LO
  3858. * Bits 31:0
  3859. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3860. * for WDI_IPA RX indication ring
  3861. * - RX_IND_RD_IDX_ADDR_HI
  3862. * Bits 31:0
  3863. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3864. * for WDI_IPA RX indication ring
  3865. * - RX_IND_WR_IDX_ADDR_LO
  3866. * Bits 31:0
  3867. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3868. * Lower 4 bytes of DDR address where WIFI FW
  3869. * updates the Write Index for WDI_IPA RX indication ring
  3870. * - RX_IND_WR_IDX_ADDR_HI
  3871. * Bits 31:0
  3872. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3873. * Higher 4 bytes of DDR address where WIFI FW
  3874. * updates the Write Index for WDI_IPA RX indication ring
  3875. * - RX_RING2_BASE_ADDR_LO
  3876. * Bits 31:0
  3877. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3878. * - RX_RING2_BASE_ADDR_HI
  3879. * Bits 31:0
  3880. * Purpose: Higher 4 bytes of 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_LO
  3885. * Bits 31:0
  3886. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3887. * DDR address where IPA uC updates the Read Index for Ring2.
  3888. * If Second RX ring is completion ring, this is NOT used
  3889. * - RX_RING2_RD_IDX_ADDR_HI
  3890. * Bits 31:0
  3891. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3892. * DDR address where IPA uC updates the Read Index for Ring2.
  3893. * If Second RX ring is completion ring, this is NOT used
  3894. * - RX_RING2_WR_IDX_ADDR_LO
  3895. * Bits 31:0
  3896. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3897. * DDR address where WIFI FW updates the Write Index
  3898. * for WDI_IPA RX ring2
  3899. * If second RX ring is completion ring, lower 4 bytes of
  3900. * DDR address where IPA uC updates the Write Index for Ring 2.
  3901. * - RX_RING2_WR_IDX_ADDR_HI
  3902. * Bits 31:0
  3903. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3904. * DDR address where WIFI FW updates the Write Index
  3905. * for WDI_IPA RX ring2
  3906. * If second RX ring is completion ring, higher 4 bytes of
  3907. * DDR address where IPA uC updates the Write Index for Ring 2.
  3908. */
  3909. #if HTT_PADDR64
  3910. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3911. #else
  3912. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3913. #endif
  3914. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3915. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3916. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3917. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3918. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3919. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3920. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3921. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3922. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3923. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3924. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3925. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3926. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3927. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3928. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3929. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3930. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3931. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3932. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3933. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3934. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3935. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3936. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3937. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3938. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3939. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3940. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3941. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3942. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3943. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3944. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3945. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3946. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3947. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3948. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3949. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3950. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3951. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3952. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3953. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3954. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3955. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3956. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3957. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3958. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3962. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3963. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3964. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3965. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3966. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3970. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3971. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3972. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3973. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3974. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3975. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3976. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3977. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3978. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3979. do { \
  3980. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3981. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3982. } while (0)
  3983. /* for systems using 32-bit format for bus addr */
  3984. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3985. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3986. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3987. do { \
  3988. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3989. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3990. } while (0)
  3991. /* for systems using 64-bit format for bus addr */
  3992. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3993. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3994. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3995. do { \
  3996. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3997. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3998. } while (0)
  3999. /* for systems using 64-bit format for bus addr */
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4001. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4003. do { \
  4004. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4005. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4006. } while (0)
  4007. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4008. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4009. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4010. do { \
  4011. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4012. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4013. } while (0)
  4014. /* for systems using 32-bit format for bus addr */
  4015. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4016. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4017. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4018. do { \
  4019. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4020. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4021. } while (0)
  4022. /* for systems using 64-bit format for bus addr */
  4023. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4024. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4026. do { \
  4027. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4028. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4029. } while (0)
  4030. /* for systems using 64-bit format for bus addr */
  4031. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4032. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4033. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4034. do { \
  4035. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4036. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4037. } while (0)
  4038. /* for systems using 32-bit format for bus addr */
  4039. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4040. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4041. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4042. do { \
  4043. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4044. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4045. } while (0)
  4046. /* for systems using 64-bit format for bus addr */
  4047. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4048. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4049. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4050. do { \
  4051. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4052. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4053. } while (0)
  4054. /* for systems using 64-bit format for bus addr */
  4055. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4056. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4057. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4058. do { \
  4059. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4060. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4061. } while (0)
  4062. /* for systems using 32-bit format for bus addr */
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4064. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4066. do { \
  4067. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4068. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4069. } while (0)
  4070. /* for systems using 64-bit format for bus addr */
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4072. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4074. do { \
  4075. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4076. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4077. } while (0)
  4078. /* for systems using 64-bit format for bus addr */
  4079. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4080. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4081. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4082. do { \
  4083. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4084. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4085. } while (0)
  4086. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4087. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4088. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4089. do { \
  4090. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4091. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4092. } while (0)
  4093. /* for systems using 32-bit format for bus addr */
  4094. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4095. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4096. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4097. do { \
  4098. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4099. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4100. } while (0)
  4101. /* for systems using 64-bit format for bus addr */
  4102. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4103. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4104. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4105. do { \
  4106. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4107. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4108. } while (0)
  4109. /* for systems using 64-bit format for bus addr */
  4110. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4111. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4112. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4115. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4116. } while (0)
  4117. /* for systems using 32-bit format for bus addr */
  4118. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4119. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4120. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4123. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4124. } while (0)
  4125. /* for systems using 64-bit format for bus addr */
  4126. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4127. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4128. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4129. do { \
  4130. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4131. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4132. } while (0)
  4133. /* for systems using 64-bit format for bus addr */
  4134. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4135. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4136. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4139. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4140. } while (0)
  4141. /* for systems using 32-bit format for bus addr */
  4142. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4143. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4144. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4147. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4148. } while (0)
  4149. /* for systems using 64-bit format for bus addr */
  4150. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4151. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4152. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4153. do { \
  4154. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4155. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4156. } while (0)
  4157. /* for systems using 64-bit format for bus addr */
  4158. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4159. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4160. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4163. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4164. } while (0)
  4165. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4166. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4167. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4168. do { \
  4169. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4170. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4171. } while (0)
  4172. /* for systems using 32-bit format for bus addr */
  4173. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4174. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4175. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4176. do { \
  4177. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4178. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4179. } while (0)
  4180. /* for systems using 64-bit format for bus addr */
  4181. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4182. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4183. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4184. do { \
  4185. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4186. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4187. } while (0)
  4188. /* for systems using 64-bit format for bus addr */
  4189. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4190. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4191. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4194. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4195. } while (0)
  4196. /* for systems using 32-bit format for bus addr */
  4197. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4198. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4199. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4202. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4203. } while (0)
  4204. /* for systems using 64-bit format for bus addr */
  4205. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4206. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4207. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4208. do { \
  4209. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4210. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4211. } while (0)
  4212. /* for systems using 64-bit format for bus addr */
  4213. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4214. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4215. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4219. } while (0)
  4220. /*
  4221. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4222. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4223. * addresses are stored in a XXX-bit field.
  4224. * This macro is used to define both htt_wdi_ipa_config32_t and
  4225. * htt_wdi_ipa_config64_t structs.
  4226. */
  4227. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4228. _paddr__tx_comp_ring_base_addr_, \
  4229. _paddr__tx_comp_wr_idx_addr_, \
  4230. _paddr__tx_ce_wr_idx_addr_, \
  4231. _paddr__rx_ind_ring_base_addr_, \
  4232. _paddr__rx_ind_rd_idx_addr_, \
  4233. _paddr__rx_ind_wr_idx_addr_, \
  4234. _paddr__rx_ring2_base_addr_,\
  4235. _paddr__rx_ring2_rd_idx_addr_,\
  4236. _paddr__rx_ring2_wr_idx_addr_) \
  4237. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4238. { \
  4239. /* DWORD 0: flags and meta-data */ \
  4240. A_UINT32 \
  4241. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4242. reserved: 8, \
  4243. tx_pkt_pool_size: 16;\
  4244. /* DWORD 1 */\
  4245. _paddr__tx_comp_ring_base_addr_;\
  4246. /* DWORD 2 (or 3)*/\
  4247. A_UINT32 tx_comp_ring_size;\
  4248. /* DWORD 3 (or 4)*/\
  4249. _paddr__tx_comp_wr_idx_addr_;\
  4250. /* DWORD 4 (or 6)*/\
  4251. _paddr__tx_ce_wr_idx_addr_;\
  4252. /* DWORD 5 (or 8)*/\
  4253. _paddr__rx_ind_ring_base_addr_;\
  4254. /* DWORD 6 (or 10)*/\
  4255. A_UINT32 rx_ind_ring_size;\
  4256. /* DWORD 7 (or 11)*/\
  4257. _paddr__rx_ind_rd_idx_addr_;\
  4258. /* DWORD 8 (or 13)*/\
  4259. _paddr__rx_ind_wr_idx_addr_;\
  4260. /* DWORD 9 (or 15)*/\
  4261. _paddr__rx_ring2_base_addr_;\
  4262. /* DWORD 10 (or 17) */\
  4263. A_UINT32 rx_ring2_size;\
  4264. /* DWORD 11 (or 18) */\
  4265. _paddr__rx_ring2_rd_idx_addr_;\
  4266. /* DWORD 12 (or 20) */\
  4267. _paddr__rx_ring2_wr_idx_addr_;\
  4268. } POSTPACK
  4269. /* define a htt_wdi_ipa_config32_t type */
  4270. 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));
  4271. /* define a htt_wdi_ipa_config64_t type */
  4272. 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));
  4273. #if HTT_PADDR64
  4274. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4275. #else
  4276. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4277. #endif
  4278. enum htt_wdi_ipa_op_code {
  4279. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4280. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4281. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4282. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4283. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4284. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4285. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4286. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4287. /* keep this last */
  4288. HTT_WDI_IPA_OPCODE_MAX
  4289. };
  4290. /**
  4291. * @brief HTT WDI_IPA Operation Request Message
  4292. *
  4293. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4294. *
  4295. * @details
  4296. * HTT WDI_IPA Operation Request message is sent by host
  4297. * to either suspend or resume WDI_IPA TX or RX path.
  4298. * |31 24|23 16|15 8|7 0|
  4299. * |----------------+----------------+----------------+----------------|
  4300. * | op_code | Rsvd | msg_type |
  4301. * |-------------------------------------------------------------------|
  4302. *
  4303. * Header fields:
  4304. * - MSG_TYPE
  4305. * Bits 7:0
  4306. * Purpose: Identifies this as WDI_IPA Operation Request message
  4307. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4308. * - OP_CODE
  4309. * Bits 31:16
  4310. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4311. * value: = enum htt_wdi_ipa_op_code
  4312. */
  4313. PREPACK struct htt_wdi_ipa_op_request_t
  4314. {
  4315. /* DWORD 0: flags and meta-data */
  4316. A_UINT32
  4317. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4318. reserved: 8,
  4319. op_code: 16;
  4320. } POSTPACK;
  4321. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4322. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4323. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4324. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4325. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4326. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4329. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4330. } while (0)
  4331. /*
  4332. * @brief host -> target HTT_SRING_SETUP message
  4333. *
  4334. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4335. *
  4336. * @details
  4337. * After target is booted up, Host can send SRING setup message for
  4338. * each host facing LMAC SRING. Target setups up HW registers based
  4339. * on setup message and confirms back to Host if response_required is set.
  4340. * Host should wait for confirmation message before sending new SRING
  4341. * setup message
  4342. *
  4343. * The message would appear as follows:
  4344. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4345. * |--------------- +-----------------+-----------------+-----------------|
  4346. * | ring_type | ring_id | pdev_id | msg_type |
  4347. * |----------------------------------------------------------------------|
  4348. * | ring_base_addr_lo |
  4349. * |----------------------------------------------------------------------|
  4350. * | ring_base_addr_hi |
  4351. * |----------------------------------------------------------------------|
  4352. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4353. * |----------------------------------------------------------------------|
  4354. * | ring_head_offset32_remote_addr_lo |
  4355. * |----------------------------------------------------------------------|
  4356. * | ring_head_offset32_remote_addr_hi |
  4357. * |----------------------------------------------------------------------|
  4358. * | ring_tail_offset32_remote_addr_lo |
  4359. * |----------------------------------------------------------------------|
  4360. * | ring_tail_offset32_remote_addr_hi |
  4361. * |----------------------------------------------------------------------|
  4362. * | ring_msi_addr_lo |
  4363. * |----------------------------------------------------------------------|
  4364. * | ring_msi_addr_hi |
  4365. * |----------------------------------------------------------------------|
  4366. * | ring_msi_data |
  4367. * |----------------------------------------------------------------------|
  4368. * | intr_timer_th |IM| intr_batch_counter_th |
  4369. * |----------------------------------------------------------------------|
  4370. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4371. * |----------------------------------------------------------------------|
  4372. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4373. * |----------------------------------------------------------------------|
  4374. * Where
  4375. * IM = sw_intr_mode
  4376. * RR = response_required
  4377. * PTCF = prefetch_timer_cfg
  4378. * IP = IPA drop flag
  4379. *
  4380. * The message is interpreted as follows:
  4381. * dword0 - b'0:7 - msg_type: This will be set to
  4382. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4383. * b'8:15 - pdev_id:
  4384. * 0 (for rings at SOC/UMAC level),
  4385. * 1/2/3 mac id (for rings at LMAC level)
  4386. * b'16:23 - ring_id: identify which ring is to setup,
  4387. * more details can be got from enum htt_srng_ring_id
  4388. * b'24:31 - ring_type: identify type of host rings,
  4389. * more details can be got from enum htt_srng_ring_type
  4390. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4391. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4392. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4393. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4394. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4395. * SW_TO_HW_RING.
  4396. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4397. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4398. * Lower 32 bits of memory address of the remote variable
  4399. * storing the 4-byte word offset that identifies the head
  4400. * element within the ring.
  4401. * (The head offset variable has type A_UINT32.)
  4402. * Valid for HW_TO_SW and SW_TO_SW rings.
  4403. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4404. * Upper 32 bits of memory address of the remote variable
  4405. * storing the 4-byte word offset that identifies the head
  4406. * element within the ring.
  4407. * (The head offset variable has type A_UINT32.)
  4408. * Valid for HW_TO_SW and SW_TO_SW rings.
  4409. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4410. * Lower 32 bits of memory address of the remote variable
  4411. * storing the 4-byte word offset that identifies the tail
  4412. * element within the ring.
  4413. * (The tail offset variable has type A_UINT32.)
  4414. * Valid for HW_TO_SW and SW_TO_SW rings.
  4415. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4416. * Upper 32 bits of memory address of the remote variable
  4417. * storing the 4-byte word offset that identifies the tail
  4418. * element within the ring.
  4419. * (The tail offset variable has type A_UINT32.)
  4420. * Valid for HW_TO_SW and SW_TO_SW rings.
  4421. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4422. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4423. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4424. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4425. * dword10 - b'0:31 - ring_msi_data: MSI data
  4426. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4427. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4428. * dword11 - b'0:14 - intr_batch_counter_th:
  4429. * batch counter threshold is in units of 4-byte words.
  4430. * HW internally maintains and increments batch count.
  4431. * (see SRING spec for detail description).
  4432. * When batch count reaches threshold value, an interrupt
  4433. * is generated by HW.
  4434. * b'15 - sw_intr_mode:
  4435. * This configuration shall be static.
  4436. * Only programmed at power up.
  4437. * 0: generate pulse style sw interrupts
  4438. * 1: generate level style sw interrupts
  4439. * b'16:31 - intr_timer_th:
  4440. * The timer init value when timer is idle or is
  4441. * initialized to start downcounting.
  4442. * In 8us units (to cover a range of 0 to 524 ms)
  4443. * dword12 - b'0:15 - intr_low_threshold:
  4444. * Used only by Consumer ring to generate ring_sw_int_p.
  4445. * Ring entries low threshold water mark, that is used
  4446. * in combination with the interrupt timer as well as
  4447. * the the clearing of the level interrupt.
  4448. * b'16:18 - prefetch_timer_cfg:
  4449. * Used only by Consumer ring to set timer mode to
  4450. * support Application prefetch handling.
  4451. * The external tail offset/pointer will be updated
  4452. * at following intervals:
  4453. * 3'b000: (Prefetch feature disabled; used only for debug)
  4454. * 3'b001: 1 usec
  4455. * 3'b010: 4 usec
  4456. * 3'b011: 8 usec (default)
  4457. * 3'b100: 16 usec
  4458. * Others: Reserverd
  4459. * b'19 - response_required:
  4460. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4461. * b'20 - ipa_drop_flag:
  4462. Indicates that host will config ipa drop threshold percentage
  4463. * b'21:31 - reserved: reserved for future use
  4464. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4465. * b'8:15 - ipa drop high threshold percentage:
  4466. * b'16:31 - Reserved
  4467. */
  4468. PREPACK struct htt_sring_setup_t {
  4469. A_UINT32 msg_type: 8,
  4470. pdev_id: 8,
  4471. ring_id: 8,
  4472. ring_type: 8;
  4473. A_UINT32 ring_base_addr_lo;
  4474. A_UINT32 ring_base_addr_hi;
  4475. A_UINT32 ring_size: 16,
  4476. ring_entry_size: 8,
  4477. ring_misc_cfg_flag: 8;
  4478. A_UINT32 ring_head_offset32_remote_addr_lo;
  4479. A_UINT32 ring_head_offset32_remote_addr_hi;
  4480. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4481. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4482. A_UINT32 ring_msi_addr_lo;
  4483. A_UINT32 ring_msi_addr_hi;
  4484. A_UINT32 ring_msi_data;
  4485. A_UINT32 intr_batch_counter_th: 15,
  4486. sw_intr_mode: 1,
  4487. intr_timer_th: 16;
  4488. A_UINT32 intr_low_threshold: 16,
  4489. prefetch_timer_cfg: 3,
  4490. response_required: 1,
  4491. ipa_drop_flag: 1,
  4492. reserved1: 11;
  4493. A_UINT32 ipa_drop_low_threshold: 8,
  4494. ipa_drop_high_threshold: 8,
  4495. reserved: 16;
  4496. } POSTPACK;
  4497. enum htt_srng_ring_type {
  4498. HTT_HW_TO_SW_RING = 0,
  4499. HTT_SW_TO_HW_RING,
  4500. HTT_SW_TO_SW_RING,
  4501. /* Insert new ring types above this line */
  4502. };
  4503. enum htt_srng_ring_id {
  4504. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4505. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4506. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4507. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4508. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4509. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4510. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4511. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4512. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4513. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4514. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4515. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4516. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4517. /* Add Other SRING which can't be directly configured by host software above this line */
  4518. };
  4519. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4520. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4521. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4522. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4523. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4524. HTT_SRING_SETUP_PDEV_ID_S)
  4525. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4528. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4529. } while (0)
  4530. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4531. #define HTT_SRING_SETUP_RING_ID_S 16
  4532. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4533. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4534. HTT_SRING_SETUP_RING_ID_S)
  4535. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4536. do { \
  4537. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4538. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4539. } while (0)
  4540. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4541. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4542. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4543. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4544. HTT_SRING_SETUP_RING_TYPE_S)
  4545. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4546. do { \
  4547. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4548. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4549. } while (0)
  4550. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4551. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4552. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4553. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4554. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4555. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4556. do { \
  4557. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4558. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4559. } while (0)
  4560. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4561. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4562. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4563. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4564. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4565. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4566. do { \
  4567. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4568. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4569. } while (0)
  4570. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4571. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4572. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4573. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4574. HTT_SRING_SETUP_RING_SIZE_S)
  4575. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4576. do { \
  4577. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4578. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4579. } while (0)
  4580. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4581. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4582. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4583. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4584. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4585. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4586. do { \
  4587. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4588. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4589. } while (0)
  4590. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4591. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4592. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4593. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4594. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4595. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4596. do { \
  4597. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4598. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4599. } while (0)
  4600. /* This control bit is applicable to only Producer, which updates Ring ID field
  4601. * of each descriptor before pushing into the ring.
  4602. * 0: updates ring_id(default)
  4603. * 1: ring_id updating disabled */
  4604. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4605. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4606. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4607. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4608. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4609. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4610. do { \
  4611. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4612. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4613. } while (0)
  4614. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4615. * of each descriptor before pushing into the ring.
  4616. * 0: updates Loopcnt(default)
  4617. * 1: Loopcnt updating disabled */
  4618. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4619. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4620. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4621. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4622. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4623. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4624. do { \
  4625. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4626. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4627. } while (0)
  4628. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4629. * into security_id port of GXI/AXI. */
  4630. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4631. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4632. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4633. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4634. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4635. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4636. do { \
  4637. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4638. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4639. } while (0)
  4640. /* During MSI write operation, SRNG drives value of this register bit into
  4641. * swap bit of GXI/AXI. */
  4642. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4643. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4644. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4645. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4646. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4647. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4648. do { \
  4649. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4650. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4651. } while (0)
  4652. /* During Pointer write operation, SRNG drives value of this register bit into
  4653. * swap bit of GXI/AXI. */
  4654. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4655. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4656. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4657. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4658. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4659. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4660. do { \
  4661. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4662. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4663. } while (0)
  4664. /* During any data or TLV write operation, SRNG drives value of this register
  4665. * bit into swap bit of GXI/AXI. */
  4666. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4667. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4668. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4669. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4670. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4671. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4672. do { \
  4673. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4674. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4675. } while (0)
  4676. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4677. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4678. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4679. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4680. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4681. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4682. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4683. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4684. do { \
  4685. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4686. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4687. } while (0)
  4688. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4689. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4690. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4691. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4692. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4693. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4694. do { \
  4695. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4696. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4697. } while (0)
  4698. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4699. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4700. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4701. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4702. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4703. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4704. do { \
  4705. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4706. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4707. } while (0)
  4708. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4709. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4710. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4711. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4712. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4713. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4714. do { \
  4715. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4716. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4717. } while (0)
  4718. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4719. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4720. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4721. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4722. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4723. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4724. do { \
  4725. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4726. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4727. } while (0)
  4728. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4729. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4730. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4731. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4732. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4733. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4734. do { \
  4735. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4736. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4737. } while (0)
  4738. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4739. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4740. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4741. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4742. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4743. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4744. do { \
  4745. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4746. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4747. } while (0)
  4748. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4749. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4750. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4751. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4752. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4753. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4754. do { \
  4755. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4756. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4757. } while (0)
  4758. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4759. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4760. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4761. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4762. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4763. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4764. do { \
  4765. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4766. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4767. } while (0)
  4768. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4769. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4770. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4771. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4772. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4773. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4774. do { \
  4775. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4776. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4777. } while (0)
  4778. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4779. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4780. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4781. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4782. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4783. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4784. do { \
  4785. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4786. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4787. } while (0)
  4788. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4789. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4790. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4791. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4792. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4793. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4794. do { \
  4795. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4796. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4797. } while (0)
  4798. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4799. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4800. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4801. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4802. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4803. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4804. do { \
  4805. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4806. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4807. } while (0)
  4808. /**
  4809. * @brief host -> target RX ring selection config message
  4810. *
  4811. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4812. *
  4813. * @details
  4814. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4815. * configure RXDMA rings.
  4816. * The configuration is per ring based and includes both packet subtypes
  4817. * and PPDU/MPDU TLVs.
  4818. *
  4819. * The message would appear as follows:
  4820. *
  4821. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4822. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4823. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4824. * |-------------------------------------------------------------------|
  4825. * | rsvd2 | ring_buffer_size |
  4826. * |-------------------------------------------------------------------|
  4827. * | packet_type_enable_flags_0 |
  4828. * |-------------------------------------------------------------------|
  4829. * | packet_type_enable_flags_1 |
  4830. * |-------------------------------------------------------------------|
  4831. * | packet_type_enable_flags_2 |
  4832. * |-------------------------------------------------------------------|
  4833. * | packet_type_enable_flags_3 |
  4834. * |-------------------------------------------------------------------|
  4835. * | tlv_filter_in_flags |
  4836. * |-------------------------------------------------------------------|
  4837. * | rx_header_offset | rx_packet_offset |
  4838. * |-------------------------------------------------------------------|
  4839. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4840. * |-------------------------------------------------------------------|
  4841. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4842. * |-------------------------------------------------------------------|
  4843. * | rsvd3 | rx_attention_offset |
  4844. * |-------------------------------------------------------------------|
  4845. * | rsvd4 | mo| fp| rx_drop_threshold |
  4846. * | |ndp|ndp| |
  4847. * |-------------------------------------------------------------------|
  4848. * Where:
  4849. * PS = pkt_swap
  4850. * SS = status_swap
  4851. * OV = rx_offsets_valid
  4852. * DT = drop_thresh_valid
  4853. * The message is interpreted as follows:
  4854. * dword0 - b'0:7 - msg_type: This will be set to
  4855. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4856. * b'8:15 - pdev_id:
  4857. * 0 (for rings at SOC/UMAC level),
  4858. * 1/2/3 mac id (for rings at LMAC level)
  4859. * b'16:23 - ring_id : Identify the ring to configure.
  4860. * More details can be got from enum htt_srng_ring_id
  4861. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4862. * BUF_RING_CFG_0 defs within HW .h files,
  4863. * e.g. wmac_top_reg_seq_hwioreg.h
  4864. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4865. * BUF_RING_CFG_0 defs within HW .h files,
  4866. * e.g. wmac_top_reg_seq_hwioreg.h
  4867. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4868. * configuration fields are valid
  4869. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4870. * rx_drop_threshold field is valid
  4871. * b'28:31 - rsvd1: reserved for future use
  4872. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4873. * in byte units.
  4874. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4875. * - b'16:31 - rsvd2: Reserved for future use
  4876. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4877. * Enable MGMT packet from 0b0000 to 0b1001
  4878. * bits from low to high: FP, MD, MO - 3 bits
  4879. * FP: Filter_Pass
  4880. * MD: Monitor_Direct
  4881. * MO: Monitor_Other
  4882. * 10 mgmt subtypes * 3 bits -> 30 bits
  4883. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4884. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4885. * Enable MGMT packet from 0b1010 to 0b1111
  4886. * bits from low to high: FP, MD, MO - 3 bits
  4887. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4888. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4889. * Enable CTRL packet from 0b0000 to 0b1001
  4890. * bits from low to high: FP, MD, MO - 3 bits
  4891. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4892. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4893. * Enable CTRL packet from 0b1010 to 0b1111,
  4894. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4895. * bits from low to high: FP, MD, MO - 3 bits
  4896. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4897. * dword6 - b'0:31 - tlv_filter_in_flags:
  4898. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4899. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4900. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4901. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4902. * A value of 0 will be considered as ignore this config.
  4903. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4904. * e.g. wmac_top_reg_seq_hwioreg.h
  4905. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4906. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4907. * A value of 0 will be considered as ignore this config.
  4908. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4909. * e.g. wmac_top_reg_seq_hwioreg.h
  4910. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4911. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4912. * A value of 0 will be considered as ignore this config.
  4913. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4914. * e.g. wmac_top_reg_seq_hwioreg.h
  4915. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4916. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4917. * A value of 0 will be considered as ignore this config.
  4918. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4919. * e.g. wmac_top_reg_seq_hwioreg.h
  4920. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4921. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4922. * A value of 0 will be considered as ignore this config.
  4923. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4924. * e.g. wmac_top_reg_seq_hwioreg.h
  4925. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4926. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4927. * A value of 0 will be considered as ignore this config.
  4928. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4929. * e.g. wmac_top_reg_seq_hwioreg.h
  4930. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4931. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4932. * A value of 0 will be considered as ignore this config.
  4933. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4934. * e.g. wmac_top_reg_seq_hwioreg.h
  4935. * - b'16:31 - rsvd3 for future use
  4936. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4937. * to source rings. Consumer drops packets if the available
  4938. * words in the ring falls below the configured threshold
  4939. * value.
  4940. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4941. * by host. 1 -> subscribed
  4942. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4943. * by host. 1 -> subscribed
  4944. */
  4945. PREPACK struct htt_rx_ring_selection_cfg_t {
  4946. A_UINT32 msg_type: 8,
  4947. pdev_id: 8,
  4948. ring_id: 8,
  4949. status_swap: 1,
  4950. pkt_swap: 1,
  4951. rx_offsets_valid: 1,
  4952. drop_thresh_valid: 1,
  4953. rsvd1: 4;
  4954. A_UINT32 ring_buffer_size: 16,
  4955. rsvd2: 16;
  4956. A_UINT32 packet_type_enable_flags_0;
  4957. A_UINT32 packet_type_enable_flags_1;
  4958. A_UINT32 packet_type_enable_flags_2;
  4959. A_UINT32 packet_type_enable_flags_3;
  4960. A_UINT32 tlv_filter_in_flags;
  4961. A_UINT32 rx_packet_offset: 16,
  4962. rx_header_offset: 16;
  4963. A_UINT32 rx_mpdu_end_offset: 16,
  4964. rx_mpdu_start_offset: 16;
  4965. A_UINT32 rx_msdu_end_offset: 16,
  4966. rx_msdu_start_offset: 16;
  4967. A_UINT32 rx_attn_offset: 16,
  4968. rsvd3: 16;
  4969. A_UINT32 rx_drop_threshold: 10,
  4970. fp_ndp: 1,
  4971. mo_ndp: 1,
  4972. rsvd4: 20;
  4973. } POSTPACK;
  4974. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4975. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4976. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4977. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4978. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4979. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4980. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4981. do { \
  4982. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4983. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4984. } while (0)
  4985. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4986. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4987. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4988. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4989. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4990. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4991. do { \
  4992. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4993. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4994. } while (0)
  4995. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4996. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4997. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4998. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4999. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5000. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5001. do { \
  5002. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5003. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5004. } while (0)
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5008. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5009. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5011. do { \
  5012. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5013. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5014. } while (0)
  5015. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5016. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5017. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5018. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5019. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5020. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5021. do { \
  5022. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5023. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5024. } while (0)
  5025. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5026. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5027. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5028. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5029. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5030. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5031. do { \
  5032. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5033. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5034. } while (0)
  5035. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5036. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5037. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5038. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5039. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5040. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5041. do { \
  5042. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5043. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5044. } while (0)
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5048. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5049. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5051. do { \
  5052. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5053. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5054. } while (0)
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5058. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5059. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5061. do { \
  5062. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5063. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5064. } while (0)
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5068. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5069. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5071. do { \
  5072. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5073. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5074. } while (0)
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5078. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5079. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5081. do { \
  5082. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5083. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5084. } while (0)
  5085. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5086. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5087. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5088. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5089. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5090. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5091. do { \
  5092. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5093. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5094. } while (0)
  5095. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5096. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5097. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5098. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5099. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5100. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5101. do { \
  5102. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5103. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5104. } while (0)
  5105. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5106. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5107. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5108. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5109. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5110. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5111. do { \
  5112. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5113. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5114. } while (0)
  5115. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5116. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5117. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5118. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5119. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5120. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5121. do { \
  5122. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5123. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5124. } while (0)
  5125. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5126. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5127. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5128. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5129. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5130. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5131. do { \
  5132. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5133. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5134. } while (0)
  5135. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5136. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5137. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5138. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5139. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5140. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5141. do { \
  5142. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5143. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5144. } while (0)
  5145. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5146. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5147. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5148. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5149. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5150. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5151. do { \
  5152. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5153. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5154. } while (0)
  5155. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5156. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5157. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5158. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5159. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5160. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5161. do { \
  5162. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5163. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5164. } while (0)
  5165. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5166. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5167. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5168. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5169. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5170. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5171. do { \
  5172. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5173. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5174. } while (0)
  5175. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5176. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5177. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5178. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5179. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5180. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5181. do { \
  5182. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5183. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5184. } while (0)
  5185. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5186. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5187. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5188. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5189. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5190. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5191. do { \
  5192. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5193. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5194. } while (0)
  5195. /*
  5196. * Subtype based MGMT frames enable bits.
  5197. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5198. */
  5199. /* association request */
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5206. /* association response */
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5213. /* Reassociation request */
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5220. /* Reassociation response */
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5227. /* Probe request */
  5228. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5233. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5234. /* Probe response */
  5235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5236. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5237. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5238. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5240. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5241. /* Timing Advertisement */
  5242. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5243. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5244. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5245. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5246. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5247. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5248. /* Reserved */
  5249. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5254. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5255. /* Beacon */
  5256. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5257. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5258. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5259. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5260. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5261. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5262. /* ATIM */
  5263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5265. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5266. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5268. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5269. /* Disassociation */
  5270. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5271. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5274. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5275. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5276. /* Authentication */
  5277. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5278. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5279. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5280. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5281. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5282. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5283. /* Deauthentication */
  5284. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5285. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5286. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5287. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5288. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5289. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5290. /* Action */
  5291. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5292. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5293. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5294. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5295. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5296. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5297. /* Action No Ack */
  5298. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5299. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5300. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5301. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5302. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5303. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5304. /* Reserved */
  5305. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5306. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5307. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5308. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5309. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5310. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5311. /*
  5312. * Subtype based CTRL frames enable bits.
  5313. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5314. */
  5315. /* Reserved */
  5316. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5317. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5318. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5319. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5320. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5321. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5322. /* Reserved */
  5323. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5324. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5325. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5326. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5327. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5328. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5329. /* Reserved */
  5330. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5331. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5332. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5334. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5335. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5336. /* Reserved */
  5337. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5338. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5340. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5342. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5343. /* Reserved */
  5344. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5345. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5346. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5347. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5350. /* Reserved */
  5351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5354. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5356. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5357. /* Reserved */
  5358. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5364. /* Control Wrapper */
  5365. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5366. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5370. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5371. /* Block Ack Request */
  5372. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5378. /* Block Ack*/
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5382. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5385. /* PS-POLL */
  5386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5392. /* RTS */
  5393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5398. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5399. /* CTS */
  5400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5406. /* ACK */
  5407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5413. /* CF-END */
  5414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5420. /* CF-END + CF-ACK */
  5421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5427. /* Multicast data */
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5434. /* Unicast data */
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5441. /* NULL data */
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL(httsym, value); \
  5451. (word) |= (value) << httsym##_S; \
  5452. } while (0)
  5453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5454. (((word) & httsym##_M) >> httsym##_S)
  5455. #define htt_rx_ring_pkt_enable_subtype_set( \
  5456. word, flag, mode, type, subtype, val) \
  5457. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5458. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5459. #define htt_rx_ring_pkt_enable_subtype_get( \
  5460. word, flag, mode, type, subtype) \
  5461. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5462. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5463. /* Definition to filter in TLVs */
  5464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5467. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5469. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5470. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5471. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5472. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5473. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5474. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5475. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5476. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5477. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5478. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5479. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5480. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5481. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5482. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5483. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5484. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5485. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5486. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5487. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5488. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5489. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5490. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5491. do { \
  5492. HTT_CHECK_SET_VAL(httsym, enable); \
  5493. (word) |= (enable) << httsym##_S; \
  5494. } while (0)
  5495. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5496. (((word) & httsym##_M) >> httsym##_S)
  5497. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5498. HTT_RX_RING_TLV_ENABLE_SET( \
  5499. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5500. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5501. HTT_RX_RING_TLV_ENABLE_GET( \
  5502. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5503. /**
  5504. * @brief host -> target TX monitor config message
  5505. *
  5506. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5507. *
  5508. * @details
  5509. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5510. * configure RXDMA rings.
  5511. * The configuration is per ring based and includes both packet types
  5512. * and PPDU/MPDU TLVs.
  5513. *
  5514. * The message would appear as follows:
  5515. *
  5516. * |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|
  5517. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5518. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5519. * |-----------+--------+--------+-----+------------------------------------|
  5520. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5521. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5522. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5523. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5524. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5525. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5526. * |------------------------------------------------------------------------|
  5527. * | tlv_filter_mask_in0 |
  5528. * |------------------------------------------------------------------------|
  5529. * | tlv_filter_mask_in1 |
  5530. * |------------------------------------------------------------------------|
  5531. * | tlv_filter_mask_in2 |
  5532. * |------------------------------------------------------------------------|
  5533. * | tlv_filter_mask_in3 |
  5534. * |-----------------+-----------------+---------------------+--------------|
  5535. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5536. * |------------------------------------------------------------------------|
  5537. * | pcu_ppdu_setup_word_mask |
  5538. * |--------------------+--+--+--+-----+---------------------+--------------|
  5539. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5540. * |------------------------------------------------------------------------|
  5541. *
  5542. * Where:
  5543. * PS = pkt_swap
  5544. * SS = status_swap
  5545. * The message is interpreted as follows:
  5546. * dword0 - b'0:7 - msg_type: This will be set to
  5547. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5548. * b'8:15 - pdev_id:
  5549. * 0 (for rings at SOC level),
  5550. * 1/2/3 mac id (for rings at LMAC level)
  5551. * b'16:23 - ring_id : Identify the ring to configure.
  5552. * More details can be got from enum htt_srng_ring_id
  5553. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5554. * BUF_RING_CFG_0 defs within HW .h files,
  5555. * e.g. wmac_top_reg_seq_hwioreg.h
  5556. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5557. * BUF_RING_CFG_0 defs within HW .h files,
  5558. * e.g. wmac_top_reg_seq_hwioreg.h
  5559. * b'26:31 - rsvd1: reserved for future use
  5560. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5561. * in byte units.
  5562. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5563. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5564. * 64, 128, 256.
  5565. * If all 3 bits are set config length is > 256.
  5566. * if val is '0', then ignore this field.
  5567. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5568. * 64, 128, 256.
  5569. * If all 3 bits are set config length is > 256.
  5570. * if val is '0', then ignore this field.
  5571. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5572. * 64, 128, 256.
  5573. * If all 3 bits are set config length is > 256.
  5574. * If val is '0', then ignore this field.
  5575. * - b'25:31 - rsvd2: Reserved for future use
  5576. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5577. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5578. * If packet_type_enable_flags is '1' for MGMT type,
  5579. * monitor will ignore this bit and allow this TLV.
  5580. * If packet_type_enable_flags is '0' for MGMT type,
  5581. * monitor will use this bit to enable/disable logging
  5582. * of this TLV.
  5583. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5584. * If packet_type_enable_flags is '1' for CTRL type,
  5585. * monitor will ignore this bit and allow this TLV.
  5586. * If packet_type_enable_flags is '0' for CTRL type,
  5587. * monitor will use this bit to enable/disable logging
  5588. * of this TLV.
  5589. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5590. * If packet_type_enable_flags is '1' for DATA type,
  5591. * monitor will ignore this bit and allow this TLV.
  5592. * If packet_type_enable_flags is '0' for DATA type,
  5593. * monitor will use this bit to enable/disable logging
  5594. * of this TLV.
  5595. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5596. * If packet_type_enable_flags is '1' for MGMT type,
  5597. * monitor will ignore this bit and allow this TLV.
  5598. * If packet_type_enable_flags is '0' for MGMT type,
  5599. * monitor will use this bit to enable/disable logging
  5600. * of this TLV.
  5601. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5602. * If packet_type_enable_flags is '1' for CTRL type,
  5603. * monitor will ignore this bit and allow this TLV.
  5604. * If packet_type_enable_flags is '0' for CTRL type,
  5605. * monitor will use this bit to enable/disable logging
  5606. * of this TLV.
  5607. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5608. * If packet_type_enable_flags is '1' for DATA type,
  5609. * monitor will ignore this bit and allow this TLV.
  5610. * If packet_type_enable_flags is '0' for DATA type,
  5611. * monitor will use this bit to enable/disable logging
  5612. * of this TLV.
  5613. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5614. * If packet_type_enable_flags is '1' for MGMT type,
  5615. * monitor will ignore this bit and allow this TLV.
  5616. * If packet_type_enable_flags is '0' for MGMT type,
  5617. * monitor will use this bit to enable/disable logging
  5618. * of this TLV.
  5619. * If filter_in_TX_MPDU_START = 1 it is recommended
  5620. * to set this bit.
  5621. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5622. * If packet_type_enable_flags is '1' for CTRL type,
  5623. * monitor will ignore this bit and allow this TLV.
  5624. * If packet_type_enable_flags is '0' for CTRL type,
  5625. * monitor will use this bit to enable/disable logging
  5626. * of this TLV.
  5627. * If filter_in_TX_MPDU_START = 1 it is recommended
  5628. * to set this bit.
  5629. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5630. * If packet_type_enable_flags is '1' for DATA type,
  5631. * monitor will ignore this bit and allow this TLV.
  5632. * If packet_type_enable_flags is '0' for DATA type,
  5633. * monitor will use this bit to enable/disable logging
  5634. * of this TLV.
  5635. * If filter_in_TX_MPDU_START = 1 it is recommended
  5636. * to set this bit.
  5637. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5638. * If packet_type_enable_flags is '1' for MGMT type,
  5639. * monitor will ignore this bit and allow this TLV.
  5640. * If packet_type_enable_flags is '0' for MGMT type,
  5641. * monitor will use this bit to enable/disable logging
  5642. * of this TLV.
  5643. * If filter_in_TX_MSDU_START = 1 it is recommended
  5644. * to set this bit.
  5645. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5646. * If packet_type_enable_flags is '1' for CTRL type,
  5647. * monitor will ignore this bit and allow this TLV.
  5648. * If packet_type_enable_flags is '0' for CTRL type,
  5649. * monitor will use this bit to enable/disable logging
  5650. * of this TLV.
  5651. * If filter_in_TX_MSDU_START = 1 it is recommended
  5652. * to set this bit.
  5653. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5654. * If packet_type_enable_flags is '1' for DATA type,
  5655. * monitor will ignore this bit and allow this TLV.
  5656. * If packet_type_enable_flags is '0' for DATA type,
  5657. * monitor will use this bit to enable/disable logging
  5658. * of this TLV.
  5659. * If filter_in_TX_MSDU_START = 1 it is recommended
  5660. * to set this bit.
  5661. * b'15:31 - rsvd3: Reserved for future use
  5662. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5663. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5664. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5665. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5666. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5667. * - b'8:15 - tx_peer_entry_word_mask:
  5668. * - b'16:23 - tx_queue_ext_word_mask:
  5669. * - b'24:31 - tx_msdu_start_word_mask:
  5670. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5671. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5672. * - b'8:15 - rxpcu_user_setup_word_mask:
  5673. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5674. * MGMT, CTRL, DATA
  5675. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5676. * 0 -> MSDU level logging is enabled
  5677. * (valid only if bit is set in
  5678. * pkt_type_enable_msdu_or_mpdu_logging)
  5679. * 1 -> MPDU level logging is enabled
  5680. * (valid only if bit is set in
  5681. * pkt_type_enable_msdu_or_mpdu_logging)
  5682. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5683. * 0 -> MSDU level logging is enabled
  5684. * (valid only if bit is set in
  5685. * pkt_type_enable_msdu_or_mpdu_logging)
  5686. * 1 -> MPDU level logging is enabled
  5687. * (valid only if bit is set in
  5688. * pkt_type_enable_msdu_or_mpdu_logging)
  5689. * - b'21 - dma_mpdu_data(D) : For DATA
  5690. * 0 -> MSDU level logging is enabled
  5691. * (valid only if bit is set in
  5692. * pkt_type_enable_msdu_or_mpdu_logging)
  5693. * 1 -> MPDU level logging is enabled
  5694. * (valid only if bit is set in
  5695. * pkt_type_enable_msdu_or_mpdu_logging)
  5696. * - b'22:31 - rsvd4 for future use
  5697. */
  5698. PREPACK struct htt_tx_monitor_cfg_t {
  5699. A_UINT32 msg_type: 8,
  5700. pdev_id: 8,
  5701. ring_id: 8,
  5702. status_swap: 1,
  5703. pkt_swap: 1,
  5704. rsvd1: 6;
  5705. A_UINT32 ring_buffer_size: 16,
  5706. config_length_mgmt: 3,
  5707. config_length_ctrl: 3,
  5708. config_length_data: 3,
  5709. rsvd2: 7;
  5710. A_UINT32 pkt_type_enable_flags: 3,
  5711. filter_in_tx_mpdu_start_mgmt: 1,
  5712. filter_in_tx_mpdu_start_ctrl: 1,
  5713. filter_in_tx_mpdu_start_data: 1,
  5714. filter_in_tx_msdu_start_mgmt: 1,
  5715. filter_in_tx_msdu_start_ctrl: 1,
  5716. filter_in_tx_msdu_start_data: 1,
  5717. filter_in_tx_mpdu_end_mgmt: 1,
  5718. filter_in_tx_mpdu_end_ctrl: 1,
  5719. filter_in_tx_mpdu_end_data: 1,
  5720. filter_in_tx_msdu_end_mgmt: 1,
  5721. filter_in_tx_msdu_end_ctrl: 1,
  5722. filter_in_tx_msdu_end_data: 1,
  5723. rsvd3: 17;
  5724. A_UINT32 tlv_filter_mask_in0;
  5725. A_UINT32 tlv_filter_mask_in1;
  5726. A_UINT32 tlv_filter_mask_in2;
  5727. A_UINT32 tlv_filter_mask_in3;
  5728. A_UINT32 tx_fes_setup_word_mask: 8,
  5729. tx_peer_entry_word_mask: 8,
  5730. tx_queue_ext_word_mask: 8,
  5731. tx_msdu_start_word_mask: 8;
  5732. A_UINT32 pcu_ppdu_setup_word_mask;
  5733. A_UINT32 tx_mpdu_start_word_mask: 8,
  5734. rxpcu_user_setup_word_mask: 8,
  5735. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5736. dma_mpdu_mgmt: 1,
  5737. dma_mpdu_ctrl: 1,
  5738. dma_mpdu_data: 1,
  5739. rsvd4: 10;
  5740. } POSTPACK;
  5741. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5742. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5743. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5744. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5745. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5746. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5747. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5748. do { \
  5749. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5750. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5751. } while (0)
  5752. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5753. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5754. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5755. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5756. HTT_TX_MONITOR_CFG_RING_ID_S)
  5757. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5758. do { \
  5759. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5760. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5761. } while (0)
  5762. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5763. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5764. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5765. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5766. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5767. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5768. do { \
  5769. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5770. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5771. } while (0)
  5772. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5773. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5774. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5775. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5776. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5777. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5778. do { \
  5779. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5780. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5781. } while (0)
  5782. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5783. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5784. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5785. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5786. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5787. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5788. do { \
  5789. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5790. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5791. } while (0)
  5792. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5793. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  5794. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5795. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5796. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5797. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5798. do { \
  5799. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5800. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5801. } while (0)
  5802. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5803. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  5804. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5805. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5806. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5807. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5808. do { \
  5809. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5810. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5811. } while (0)
  5812. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5813. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  5814. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5815. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5816. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5817. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5818. do { \
  5819. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5820. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5821. } while (0)
  5822. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5823. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5824. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5825. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5826. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5827. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5828. do { \
  5829. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5830. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5831. } while (0)
  5832. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  5833. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  5834. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  5835. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  5836. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  5837. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  5838. do { \
  5839. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  5840. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  5841. } while (0)
  5842. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  5843. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  5844. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  5845. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  5846. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  5847. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  5848. do { \
  5849. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  5850. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  5851. } while (0
  5852. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  5853. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  5854. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  5855. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  5856. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  5857. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  5858. do { \
  5859. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  5860. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  5861. } while (0)
  5862. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  5863. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  5864. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  5865. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  5866. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  5867. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  5868. do { \
  5869. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  5870. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  5871. } while (0)
  5872. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  5873. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  5874. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  5875. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  5876. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  5877. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  5878. do { \
  5879. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  5880. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  5881. } while (0
  5882. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  5883. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  5884. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  5885. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  5886. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  5887. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  5888. do { \
  5889. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  5890. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  5891. } while (0)
  5892. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  5893. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  5894. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  5895. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  5896. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  5897. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  5898. do { \
  5899. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  5900. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  5901. } while (0)
  5902. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  5903. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  5904. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  5905. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  5906. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  5907. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  5908. do { \
  5909. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  5910. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  5911. } while (0
  5912. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  5913. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  5914. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  5915. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  5916. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  5917. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  5918. do { \
  5919. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  5920. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  5921. } while (0)
  5922. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  5923. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  5924. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  5925. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  5926. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  5927. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  5928. do { \
  5929. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  5930. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  5931. } while (0)
  5932. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  5933. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  5934. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  5935. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  5936. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  5937. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  5938. do { \
  5939. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  5940. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  5941. } while (0
  5942. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  5943. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  5944. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  5945. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  5946. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  5947. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  5948. do { \
  5949. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  5950. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  5951. } while (0)
  5952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5955. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5956. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5958. do { \
  5959. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5960. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5961. } while (0)
  5962. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  5963. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5964. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5965. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5966. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5967. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5968. do { \
  5969. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5970. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5971. } while (0)
  5972. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  5973. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  5974. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5975. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5976. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5977. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5978. do { \
  5979. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5980. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5981. } while (0)
  5982. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  5983. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  5984. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5985. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5986. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5987. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5988. do { \
  5989. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5990. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5991. } while (0)
  5992. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  5993. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  5994. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5995. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5996. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5997. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5998. do { \
  5999. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6000. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6001. } while (0)
  6002. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6003. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6004. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6005. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6006. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6007. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6008. do { \
  6009. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6010. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6011. } while (0)
  6012. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6013. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6014. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6015. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6016. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6017. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6018. do { \
  6019. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6020. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6021. } while (0)
  6022. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6023. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6024. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6025. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6026. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6027. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6028. do { \
  6029. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6030. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6031. } while (0)
  6032. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6033. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6034. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6035. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6036. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6037. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6038. do { \
  6039. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6040. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6041. } while (0)
  6042. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6043. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6044. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6045. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6046. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6047. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6048. do { \
  6049. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6050. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6051. } while (0)
  6052. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6053. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6054. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6055. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6056. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6057. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6058. do { \
  6059. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6060. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6061. } while (0)
  6062. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6063. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6064. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6065. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6066. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6067. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6068. do { \
  6069. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6070. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6071. } while (0)
  6072. /*
  6073. * pkt_type_enable_flags
  6074. */
  6075. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6076. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6077. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6078. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6079. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6080. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6081. /*
  6082. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6083. */
  6084. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6085. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6086. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6087. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6088. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6089. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6090. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6091. do { \
  6092. HTT_CHECK_SET_VAL(httsym, value); \
  6093. (word) |= (value) << httsym##_S; \
  6094. } while (0)
  6095. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6096. (((word) & httsym##_M) >> httsym##_S)
  6097. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6098. * type -> MGMT, CTRL, DATA*/
  6099. #define htt_tx_ring_pkt_type_set( \
  6100. word, mode, type, val) \
  6101. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6102. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6103. #define htt_tx_ring_pkt_type_get( \
  6104. word, mode, type) \
  6105. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6106. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6107. /* Definition to filter in TLVs */
  6108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6171. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6172. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6173. do { \
  6174. HTT_CHECK_SET_VAL(httsym, enable); \
  6175. (word) |= (enable) << httsym##_S; \
  6176. } while (0)
  6177. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6178. (((word) & httsym##_M) >> httsym##_S)
  6179. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6180. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6181. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6182. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6183. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6184. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6211. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6212. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6213. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6214. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6215. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6216. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6217. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6218. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6219. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6220. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6221. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6222. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6223. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6224. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6225. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6226. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6227. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6228. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6229. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6230. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6231. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6232. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6233. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6234. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6235. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6236. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6237. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6238. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6239. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6240. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6241. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6242. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6243. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6244. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6245. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6246. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6247. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6248. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6249. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6250. do { \
  6251. HTT_CHECK_SET_VAL(httsym, enable); \
  6252. (word) |= (enable) << httsym##_S; \
  6253. } while (0)
  6254. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6255. (((word) & httsym##_M) >> httsym##_S)
  6256. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6257. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6258. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6259. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6260. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6261. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6262. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6263. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6264. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6265. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6266. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6267. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6268. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6269. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6270. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6271. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6272. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6273. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6274. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6275. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6276. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6277. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6278. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6279. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6280. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6281. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6282. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6283. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6284. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6285. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6286. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6287. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6288. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6289. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6290. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6291. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6292. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6293. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6294. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6295. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6296. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6297. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6298. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6299. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6300. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6301. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6302. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6303. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6304. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6305. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6306. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6307. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6308. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6309. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6310. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6311. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6312. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6313. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6314. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6315. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6316. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6317. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6318. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6319. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6320. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6321. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6322. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6323. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6324. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6325. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6326. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6327. do { \
  6328. HTT_CHECK_SET_VAL(httsym, enable); \
  6329. (word) |= (enable) << httsym##_S; \
  6330. } while (0)
  6331. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6332. (((word) & httsym##_M) >> httsym##_S)
  6333. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6334. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6335. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6336. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6337. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6338. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6339. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6340. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6341. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6342. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6343. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6344. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6345. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6346. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6347. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6348. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6349. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6350. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6351. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6352. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6353. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6354. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6355. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6356. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6357. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6358. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6359. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6360. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6361. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6362. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6363. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6364. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6365. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6366. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6367. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6368. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6369. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6370. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6371. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6372. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6373. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6374. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6375. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6376. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6377. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6378. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6379. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6380. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6381. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6382. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6383. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6384. do { \
  6385. HTT_CHECK_SET_VAL(httsym, enable); \
  6386. (word) |= (enable) << httsym##_S; \
  6387. } while (0)
  6388. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6389. (((word) & httsym##_M) >> httsym##_S)
  6390. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6391. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6392. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6393. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6394. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6395. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6396. /**
  6397. * @brief host --> target Receive Flow Steering configuration message definition
  6398. *
  6399. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6400. *
  6401. * host --> target Receive Flow Steering configuration message definition.
  6402. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6403. * The reason for this is we want RFS to be configured and ready before MAC
  6404. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6405. *
  6406. * |31 24|23 16|15 9|8|7 0|
  6407. * |----------------+----------------+----------------+----------------|
  6408. * | reserved |E| msg type |
  6409. * |-------------------------------------------------------------------|
  6410. * Where E = RFS enable flag
  6411. *
  6412. * The RFS_CONFIG message consists of a single 4-byte word.
  6413. *
  6414. * Header fields:
  6415. * - MSG_TYPE
  6416. * Bits 7:0
  6417. * Purpose: identifies this as a RFS config msg
  6418. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6419. * - RFS_CONFIG
  6420. * Bit 8
  6421. * Purpose: Tells target whether to enable (1) or disable (0)
  6422. * flow steering feature when sending rx indication messages to host
  6423. */
  6424. #define HTT_H2T_RFS_CONFIG_M 0x100
  6425. #define HTT_H2T_RFS_CONFIG_S 8
  6426. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6427. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6428. HTT_H2T_RFS_CONFIG_S)
  6429. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6430. do { \
  6431. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6432. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6433. } while (0)
  6434. #define HTT_RFS_CFG_REQ_BYTES 4
  6435. /**
  6436. * @brief host -> target FW extended statistics retrieve
  6437. *
  6438. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6439. *
  6440. * @details
  6441. * The following field definitions describe the format of the HTT host
  6442. * to target FW extended stats retrieve message.
  6443. * The message specifies the type of stats the host wants to retrieve.
  6444. *
  6445. * |31 24|23 16|15 8|7 0|
  6446. * |-----------------------------------------------------------|
  6447. * | reserved | stats type | pdev_mask | msg type |
  6448. * |-----------------------------------------------------------|
  6449. * | config param [0] |
  6450. * |-----------------------------------------------------------|
  6451. * | config param [1] |
  6452. * |-----------------------------------------------------------|
  6453. * | config param [2] |
  6454. * |-----------------------------------------------------------|
  6455. * | config param [3] |
  6456. * |-----------------------------------------------------------|
  6457. * | reserved |
  6458. * |-----------------------------------------------------------|
  6459. * | cookie LSBs |
  6460. * |-----------------------------------------------------------|
  6461. * | cookie MSBs |
  6462. * |-----------------------------------------------------------|
  6463. * Header fields:
  6464. * - MSG_TYPE
  6465. * Bits 7:0
  6466. * Purpose: identifies this is a extended stats upload request message
  6467. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6468. * - PDEV_MASK
  6469. * Bits 8:15
  6470. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6471. * Value: This is a overloaded field, refer to usage and interpretation of
  6472. * PDEV in interface document.
  6473. * Bit 8 : Reserved for SOC stats
  6474. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6475. * Indicates MACID_MASK in DBS
  6476. * - STATS_TYPE
  6477. * Bits 23:16
  6478. * Purpose: identifies which FW statistics to upload
  6479. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6480. * - Reserved
  6481. * Bits 31:24
  6482. * - CONFIG_PARAM [0]
  6483. * Bits 31:0
  6484. * Purpose: give an opaque configuration value to the specified stats type
  6485. * Value: stats-type specific configuration value
  6486. * Refer to htt_stats.h for interpretation for each stats sub_type
  6487. * - CONFIG_PARAM [1]
  6488. * Bits 31:0
  6489. * Purpose: give an opaque configuration value to the specified stats type
  6490. * Value: stats-type specific configuration value
  6491. * Refer to htt_stats.h for interpretation for each stats sub_type
  6492. * - CONFIG_PARAM [2]
  6493. * Bits 31:0
  6494. * Purpose: give an opaque configuration value to the specified stats type
  6495. * Value: stats-type specific configuration value
  6496. * Refer to htt_stats.h for interpretation for each stats sub_type
  6497. * - CONFIG_PARAM [3]
  6498. * Bits 31:0
  6499. * Purpose: give an opaque configuration value to the specified stats type
  6500. * Value: stats-type specific configuration value
  6501. * Refer to htt_stats.h for interpretation for each stats sub_type
  6502. * - Reserved [31:0] for future use.
  6503. * - COOKIE_LSBS
  6504. * Bits 31:0
  6505. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6506. * message with its preceding host->target stats request message.
  6507. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6508. * - COOKIE_MSBS
  6509. * Bits 31:0
  6510. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6511. * message with its preceding host->target stats request message.
  6512. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6513. */
  6514. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6515. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6516. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6517. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6518. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6519. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6520. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6521. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6522. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6523. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6524. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6525. do { \
  6526. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6527. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6528. } while (0)
  6529. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6530. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6531. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6532. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6533. do { \
  6534. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6535. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6536. } while (0)
  6537. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6538. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6539. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6540. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6543. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6544. } while (0)
  6545. /**
  6546. * @brief host -> target FW PPDU_STATS request message
  6547. *
  6548. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6549. *
  6550. * @details
  6551. * The following field definitions describe the format of the HTT host
  6552. * to target FW for PPDU_STATS_CFG msg.
  6553. * The message allows the host to configure the PPDU_STATS_IND messages
  6554. * produced by the target.
  6555. *
  6556. * |31 24|23 16|15 8|7 0|
  6557. * |-----------------------------------------------------------|
  6558. * | REQ bit mask | pdev_mask | msg type |
  6559. * |-----------------------------------------------------------|
  6560. * Header fields:
  6561. * - MSG_TYPE
  6562. * Bits 7:0
  6563. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6564. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6565. * - PDEV_MASK
  6566. * Bits 8:15
  6567. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6568. * Value: This is a overloaded field, refer to usage and interpretation of
  6569. * PDEV in interface document.
  6570. * Bit 8 : Reserved for SOC stats
  6571. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6572. * Indicates MACID_MASK in DBS
  6573. * - REQ_TLV_BIT_MASK
  6574. * Bits 16:31
  6575. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6576. * needs to be included in the target's PPDU_STATS_IND messages.
  6577. * Value: refer htt_ppdu_stats_tlv_tag_t
  6578. *
  6579. */
  6580. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6581. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6582. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6583. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6584. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6585. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6586. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6587. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6588. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6589. do { \
  6590. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6591. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6592. } while (0)
  6593. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6594. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6595. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6596. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6597. do { \
  6598. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6599. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6600. } while (0)
  6601. /**
  6602. * @brief Host-->target HTT RX FSE setup message
  6603. *
  6604. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6605. *
  6606. * @details
  6607. * Through this message, the host will provide details of the flow tables
  6608. * in host DDR along with hash keys.
  6609. * This message can be sent per SOC or per PDEV, which is differentiated
  6610. * by pdev id values.
  6611. * The host will allocate flow search table and sends table size,
  6612. * physical DMA address of flow table, and hash keys to firmware to
  6613. * program into the RXOLE FSE HW block.
  6614. *
  6615. * The following field definitions describe the format of the RX FSE setup
  6616. * message sent from the host to target
  6617. *
  6618. * Header fields:
  6619. * dword0 - b'7:0 - msg_type: This will be set to
  6620. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6621. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6622. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6623. * pdev's LMAC ring.
  6624. * b'31:16 - reserved : Reserved for future use
  6625. * dword1 - b'19:0 - number of records: This field indicates the number of
  6626. * entries in the flow table. For example: 8k number of
  6627. * records is equivalent to
  6628. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6629. * b'27:20 - max search: This field specifies the skid length to FSE
  6630. * parser HW module whenever match is not found at the
  6631. * exact index pointed by hash.
  6632. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6633. * Refer htt_ip_da_sa_prefix below for more details.
  6634. * b'31:30 - reserved: Reserved for future use
  6635. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6636. * table allocated by host in DDR
  6637. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6638. * table allocated by host in DDR
  6639. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6640. * entry hashing
  6641. *
  6642. *
  6643. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6644. * |---------------------------------------------------------------|
  6645. * | reserved | pdev_id | MSG_TYPE |
  6646. * |---------------------------------------------------------------|
  6647. * |resvd|IPDSA| max_search | Number of records |
  6648. * |---------------------------------------------------------------|
  6649. * | base address lo |
  6650. * |---------------------------------------------------------------|
  6651. * | base address high |
  6652. * |---------------------------------------------------------------|
  6653. * | toeplitz key 31_0 |
  6654. * |---------------------------------------------------------------|
  6655. * | toeplitz key 63_32 |
  6656. * |---------------------------------------------------------------|
  6657. * | toeplitz key 95_64 |
  6658. * |---------------------------------------------------------------|
  6659. * | toeplitz key 127_96 |
  6660. * |---------------------------------------------------------------|
  6661. * | toeplitz key 159_128 |
  6662. * |---------------------------------------------------------------|
  6663. * | toeplitz key 191_160 |
  6664. * |---------------------------------------------------------------|
  6665. * | toeplitz key 223_192 |
  6666. * |---------------------------------------------------------------|
  6667. * | toeplitz key 255_224 |
  6668. * |---------------------------------------------------------------|
  6669. * | toeplitz key 287_256 |
  6670. * |---------------------------------------------------------------|
  6671. * | reserved | toeplitz key 314_288(26:0 bits) |
  6672. * |---------------------------------------------------------------|
  6673. * where:
  6674. * IPDSA = ip_da_sa
  6675. */
  6676. /**
  6677. * @brief: htt_ip_da_sa_prefix
  6678. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6679. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6680. * documentation per RFC3849
  6681. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6682. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6683. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6684. */
  6685. enum htt_ip_da_sa_prefix {
  6686. HTT_RX_IPV6_20010db8,
  6687. HTT_RX_IPV4_MAPPED_IPV6,
  6688. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6689. HTT_RX_IPV6_64FF9B,
  6690. };
  6691. /**
  6692. * @brief Host-->target HTT RX FISA configure and enable
  6693. *
  6694. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6695. *
  6696. * @details
  6697. * The host will send this command down to configure and enable the FISA
  6698. * operational params.
  6699. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6700. * register.
  6701. * Should configure both the MACs.
  6702. *
  6703. * dword0 - b'7:0 - msg_type:
  6704. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6705. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6706. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6707. * pdev's LMAC ring.
  6708. * b'31:16 - reserved : Reserved for future use
  6709. *
  6710. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6711. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6712. * packets. 1 flow search will be skipped
  6713. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6714. * tcp,udp packets
  6715. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6716. * calculation
  6717. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6718. * calculation
  6719. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6720. * calculation
  6721. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6722. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6723. * length
  6724. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6725. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6726. * length
  6727. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6728. * num jump
  6729. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6730. * num jump
  6731. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6732. * data type switch has happend for MPDU Sequence num jump
  6733. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6734. * for MPDU Sequence num jump
  6735. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6736. * for decrypt errors
  6737. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6738. * while aggregating a msdu
  6739. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6740. * The aggregation is done until (number of MSDUs aggregated
  6741. * < LIMIT + 1)
  6742. * b'31:18 - Reserved
  6743. *
  6744. * fisa_control_value - 32bit value FW can write to register
  6745. *
  6746. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6747. * Threshold value for FISA timeout (units are microseconds).
  6748. * When the global timestamp exceeds this threshold, FISA
  6749. * aggregation will be restarted.
  6750. * A value of 0 means timeout is disabled.
  6751. * Compare the threshold register with timestamp field in
  6752. * flow entry to generate timeout for the flow.
  6753. *
  6754. * |31 18 |17 16|15 8|7 0|
  6755. * |-------------------------------------------------------------|
  6756. * | reserved | pdev_mask | msg type |
  6757. * |-------------------------------------------------------------|
  6758. * | reserved | FISA_CTRL |
  6759. * |-------------------------------------------------------------|
  6760. * | FISA_TIMEOUT_THRESH |
  6761. * |-------------------------------------------------------------|
  6762. */
  6763. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6764. A_UINT32 msg_type:8,
  6765. pdev_id:8,
  6766. reserved0:16;
  6767. /**
  6768. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6769. * [17:0]
  6770. */
  6771. union {
  6772. /*
  6773. * fisa_control_bits structure is deprecated.
  6774. * Please use fisa_control_bits_v2 going forward.
  6775. */
  6776. struct {
  6777. A_UINT32 fisa_enable: 1,
  6778. ipsec_skip_search: 1,
  6779. nontcp_skip_search: 1,
  6780. add_ipv4_fixed_hdr_len: 1,
  6781. add_ipv6_fixed_hdr_len: 1,
  6782. add_tcp_fixed_hdr_len: 1,
  6783. add_udp_hdr_len: 1,
  6784. chksum_cum_ip_len_en: 1,
  6785. disable_tid_check: 1,
  6786. disable_ta_check: 1,
  6787. disable_qos_check: 1,
  6788. disable_raw_check: 1,
  6789. disable_decrypt_err_check: 1,
  6790. disable_msdu_drop_check: 1,
  6791. fisa_aggr_limit: 4,
  6792. reserved: 14;
  6793. } fisa_control_bits;
  6794. struct {
  6795. A_UINT32 fisa_enable: 1,
  6796. fisa_aggr_limit: 4,
  6797. reserved: 27;
  6798. } fisa_control_bits_v2;
  6799. A_UINT32 fisa_control_value;
  6800. } u_fisa_control;
  6801. /**
  6802. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6803. * timeout threshold for aggregation. Unit in usec.
  6804. * [31:0]
  6805. */
  6806. A_UINT32 fisa_timeout_threshold;
  6807. } POSTPACK;
  6808. /* DWord 0: pdev-ID */
  6809. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6810. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6811. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6812. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6813. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6814. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6815. do { \
  6816. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6817. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6818. } while (0)
  6819. /* Dword 1: fisa_control_value fisa config */
  6820. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6821. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6822. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6823. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6824. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6825. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6828. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6829. } while (0)
  6830. /* Dword 1: fisa_control_value ipsec_skip_search */
  6831. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6832. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6833. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6834. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6835. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6836. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6837. do { \
  6838. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6839. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6840. } while (0)
  6841. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6842. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6843. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6844. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6845. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6846. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6847. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6848. do { \
  6849. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6850. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6851. } while (0)
  6852. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6853. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6854. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6855. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6856. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6857. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6858. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6859. do { \
  6860. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6861. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6862. } while (0)
  6863. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6864. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6865. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6866. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6867. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6868. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6869. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6870. do { \
  6871. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6872. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6873. } while (0)
  6874. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6875. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6876. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6877. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6878. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6879. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6880. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6881. do { \
  6882. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6883. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6884. } while (0)
  6885. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6886. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6887. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6888. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6889. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6890. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6891. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6892. do { \
  6893. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6894. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6895. } while (0)
  6896. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6897. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6898. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6899. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6900. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6901. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6902. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6903. do { \
  6904. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6905. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6906. } while (0)
  6907. /* Dword 1: fisa_control_value disable_tid_check */
  6908. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6909. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6910. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6911. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6912. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6913. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6914. do { \
  6915. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6916. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6917. } while (0)
  6918. /* Dword 1: fisa_control_value disable_ta_check */
  6919. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6920. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6921. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6922. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6923. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6924. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6925. do { \
  6926. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6927. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6928. } while (0)
  6929. /* Dword 1: fisa_control_value disable_qos_check */
  6930. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6931. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6932. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6933. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6934. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6935. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6936. do { \
  6937. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6938. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6939. } while (0)
  6940. /* Dword 1: fisa_control_value disable_raw_check */
  6941. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6942. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6943. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6944. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6945. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6946. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6947. do { \
  6948. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6949. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6950. } while (0)
  6951. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6952. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6953. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6954. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6955. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6956. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6957. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6958. do { \
  6959. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6960. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6961. } while (0)
  6962. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6963. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6964. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6965. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6966. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6967. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6968. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6969. do { \
  6970. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6971. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6972. } while (0)
  6973. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6974. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6975. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6976. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6977. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6978. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6979. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6980. do { \
  6981. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6982. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6983. } while (0)
  6984. /* Dword 1: fisa_control_value fisa config */
  6985. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6986. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6987. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6988. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6989. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6990. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6991. do { \
  6992. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6993. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6994. } while (0)
  6995. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6996. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6997. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6998. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6999. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7000. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7001. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7002. do { \
  7003. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7004. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7005. } while (0)
  7006. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7007. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7008. pdev_id:8,
  7009. reserved0:16;
  7010. A_UINT32 num_records:20,
  7011. max_search:8,
  7012. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7013. reserved1:2;
  7014. A_UINT32 base_addr_lo;
  7015. A_UINT32 base_addr_hi;
  7016. A_UINT32 toeplitz31_0;
  7017. A_UINT32 toeplitz63_32;
  7018. A_UINT32 toeplitz95_64;
  7019. A_UINT32 toeplitz127_96;
  7020. A_UINT32 toeplitz159_128;
  7021. A_UINT32 toeplitz191_160;
  7022. A_UINT32 toeplitz223_192;
  7023. A_UINT32 toeplitz255_224;
  7024. A_UINT32 toeplitz287_256;
  7025. A_UINT32 toeplitz314_288:27,
  7026. reserved2:5;
  7027. } POSTPACK;
  7028. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7029. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7030. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7031. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7032. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7033. /* DWORD 0: Pdev ID */
  7034. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7035. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7036. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7037. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7038. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7039. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7040. do { \
  7041. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7042. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7043. } while (0)
  7044. /* DWORD 1:num of records */
  7045. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7046. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7047. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7048. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7049. HTT_RX_FSE_SETUP_NUM_REC_S)
  7050. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7051. do { \
  7052. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7053. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7054. } while (0)
  7055. /* DWORD 1:max_search */
  7056. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7057. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7058. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7059. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7060. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7061. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7062. do { \
  7063. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7064. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7065. } while (0)
  7066. /* DWORD 1:ip_da_sa prefix */
  7067. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7068. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7069. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7070. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7071. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7072. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7073. do { \
  7074. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7075. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7076. } while (0)
  7077. /* DWORD 2: Base Address LO */
  7078. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7079. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7080. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7081. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7082. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7083. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7084. do { \
  7085. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7086. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7087. } while (0)
  7088. /* DWORD 3: Base Address High */
  7089. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7090. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7091. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7092. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7093. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7094. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7095. do { \
  7096. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7097. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7098. } while (0)
  7099. /* DWORD 4-12: Hash Value */
  7100. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7101. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7102. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7103. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7104. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7105. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7106. do { \
  7107. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7108. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7109. } while (0)
  7110. /* DWORD 13: Hash Value 314:288 bits */
  7111. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7112. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7113. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7114. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7115. do { \
  7116. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7117. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7118. } while (0)
  7119. /**
  7120. * @brief Host-->target HTT RX FSE operation message
  7121. *
  7122. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7123. *
  7124. * @details
  7125. * The host will send this Flow Search Engine (FSE) operation message for
  7126. * every flow add/delete operation.
  7127. * The FSE operation includes FSE full cache invalidation or individual entry
  7128. * invalidation.
  7129. * This message can be sent per SOC or per PDEV which is differentiated
  7130. * by pdev id values.
  7131. *
  7132. * |31 16|15 8|7 1|0|
  7133. * |-------------------------------------------------------------|
  7134. * | reserved | pdev_id | MSG_TYPE |
  7135. * |-------------------------------------------------------------|
  7136. * | reserved | operation |I|
  7137. * |-------------------------------------------------------------|
  7138. * | ip_src_addr_31_0 |
  7139. * |-------------------------------------------------------------|
  7140. * | ip_src_addr_63_32 |
  7141. * |-------------------------------------------------------------|
  7142. * | ip_src_addr_95_64 |
  7143. * |-------------------------------------------------------------|
  7144. * | ip_src_addr_127_96 |
  7145. * |-------------------------------------------------------------|
  7146. * | ip_dst_addr_31_0 |
  7147. * |-------------------------------------------------------------|
  7148. * | ip_dst_addr_63_32 |
  7149. * |-------------------------------------------------------------|
  7150. * | ip_dst_addr_95_64 |
  7151. * |-------------------------------------------------------------|
  7152. * | ip_dst_addr_127_96 |
  7153. * |-------------------------------------------------------------|
  7154. * | l4_dst_port | l4_src_port |
  7155. * | (32-bit SPI incase of IPsec) |
  7156. * |-------------------------------------------------------------|
  7157. * | reserved | l4_proto |
  7158. * |-------------------------------------------------------------|
  7159. *
  7160. * where I is 1-bit ipsec_valid.
  7161. *
  7162. * The following field definitions describe the format of the RX FSE operation
  7163. * message sent from the host to target for every add/delete flow entry to flow
  7164. * table.
  7165. *
  7166. * Header fields:
  7167. * dword0 - b'7:0 - msg_type: This will be set to
  7168. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7169. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7170. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7171. * specified pdev's LMAC ring.
  7172. * b'31:16 - reserved : Reserved for future use
  7173. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7174. * (Internet Protocol Security).
  7175. * IPsec describes the framework for providing security at
  7176. * IP layer. IPsec is defined for both versions of IP:
  7177. * IPV4 and IPV6.
  7178. * Please refer to htt_rx_flow_proto enumeration below for
  7179. * more info.
  7180. * ipsec_valid = 1 for IPSEC packets
  7181. * ipsec_valid = 0 for IP Packets
  7182. * b'7:1 - operation: This indicates types of FSE operation.
  7183. * Refer to htt_rx_fse_operation enumeration:
  7184. * 0 - No Cache Invalidation required
  7185. * 1 - Cache invalidate only one entry given by IP
  7186. * src/dest address at DWORD[2:9]
  7187. * 2 - Complete FSE Cache Invalidation
  7188. * 3 - FSE Disable
  7189. * 4 - FSE Enable
  7190. * b'31:8 - reserved: Reserved for future use
  7191. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7192. * for per flow addition/deletion
  7193. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7194. * and the subsequent 3 A_UINT32 will be padding bytes.
  7195. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7196. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7197. * from 0 to 65535 but only 0 to 1023 are designated as
  7198. * well-known ports. Refer to [RFC1700] for more details.
  7199. * This field is valid only if
  7200. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7201. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7202. * range from 0 to 65535 but only 0 to 1023 are designated
  7203. * as well-known ports. Refer to [RFC1700] for more details.
  7204. * This field is valid only if
  7205. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7206. * - SPI (31:0): Security Parameters Index is an
  7207. * identification tag added to the header while using IPsec
  7208. * for tunneling the IP traffici.
  7209. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7210. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7211. * Assigned Internet Protocol Numbers.
  7212. * l4_proto numbers for standard protocol like UDP/TCP
  7213. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7214. * l4_proto = 17 for UDP etc.
  7215. * b'31:8 - reserved: Reserved for future use.
  7216. *
  7217. */
  7218. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7219. A_UINT32 msg_type:8,
  7220. pdev_id:8,
  7221. reserved0:16;
  7222. A_UINT32 ipsec_valid:1,
  7223. operation:7,
  7224. reserved1:24;
  7225. A_UINT32 ip_src_addr_31_0;
  7226. A_UINT32 ip_src_addr_63_32;
  7227. A_UINT32 ip_src_addr_95_64;
  7228. A_UINT32 ip_src_addr_127_96;
  7229. A_UINT32 ip_dest_addr_31_0;
  7230. A_UINT32 ip_dest_addr_63_32;
  7231. A_UINT32 ip_dest_addr_95_64;
  7232. A_UINT32 ip_dest_addr_127_96;
  7233. union {
  7234. A_UINT32 spi;
  7235. struct {
  7236. A_UINT32 l4_src_port:16,
  7237. l4_dest_port:16;
  7238. } ip;
  7239. } u;
  7240. A_UINT32 l4_proto:8,
  7241. reserved:24;
  7242. } POSTPACK;
  7243. /**
  7244. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7245. *
  7246. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7247. *
  7248. * @details
  7249. * The host will send this Full monitor mode register configuration message.
  7250. * This message can be sent per SOC or per PDEV which is differentiated
  7251. * by pdev id values.
  7252. *
  7253. * |31 16|15 11|10 8|7 3|2|1|0|
  7254. * |-------------------------------------------------------------|
  7255. * | reserved | pdev_id | MSG_TYPE |
  7256. * |-------------------------------------------------------------|
  7257. * | reserved |Release Ring |N|Z|E|
  7258. * |-------------------------------------------------------------|
  7259. *
  7260. * where E is 1-bit full monitor mode enable/disable.
  7261. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7262. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7263. *
  7264. * The following field definitions describe the format of the full monitor
  7265. * mode configuration message sent from the host to target for each pdev.
  7266. *
  7267. * Header fields:
  7268. * dword0 - b'7:0 - msg_type: This will be set to
  7269. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7270. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7271. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7272. * specified pdev's LMAC ring.
  7273. * b'31:16 - reserved : Reserved for future use.
  7274. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7275. * monitor mode rxdma register is to be enabled or disabled.
  7276. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7277. * additional descriptors at ppdu end for zero mpdus
  7278. * enabled or disabled.
  7279. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7280. * additional descriptors at ppdu end for non zero mpdus
  7281. * enabled or disabled.
  7282. * b'10:3 - release_ring: This indicates the destination ring
  7283. * selection for the descriptor at the end of PPDU
  7284. * 0 - REO ring select
  7285. * 1 - FW ring select
  7286. * 2 - SW ring select
  7287. * 3 - Release ring select
  7288. * Refer to htt_rx_full_mon_release_ring.
  7289. * b'31:11 - reserved for future use
  7290. */
  7291. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7292. A_UINT32 msg_type:8,
  7293. pdev_id:8,
  7294. reserved0:16;
  7295. A_UINT32 full_monitor_mode_enable:1,
  7296. addnl_descs_zero_mpdus_end:1,
  7297. addnl_descs_non_zero_mpdus_end:1,
  7298. release_ring:8,
  7299. reserved1:21;
  7300. } POSTPACK;
  7301. /**
  7302. * Enumeration for full monitor mode destination ring select
  7303. * 0 - REO destination ring select
  7304. * 1 - FW destination ring select
  7305. * 2 - SW destination ring select
  7306. * 3 - Release destination ring select
  7307. */
  7308. enum htt_rx_full_mon_release_ring {
  7309. HTT_RX_MON_RING_REO,
  7310. HTT_RX_MON_RING_FW,
  7311. HTT_RX_MON_RING_SW,
  7312. HTT_RX_MON_RING_RELEASE,
  7313. };
  7314. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7315. /* DWORD 0: Pdev ID */
  7316. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7317. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7318. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7319. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7320. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7321. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7322. do { \
  7323. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7324. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7325. } while (0)
  7326. /* DWORD 1:ENABLE */
  7327. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7328. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7329. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7330. do { \
  7331. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7332. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7333. } while (0)
  7334. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7335. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7336. /* DWORD 1:ZERO_MPDU */
  7337. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7338. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7339. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7340. do { \
  7341. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7342. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7343. } while (0)
  7344. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7345. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7346. /* DWORD 1:NON_ZERO_MPDU */
  7347. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7348. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7349. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7350. do { \
  7351. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7352. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7353. } while (0)
  7354. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7355. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7356. /* DWORD 1:RELEASE_RINGS */
  7357. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7358. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7359. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7360. do { \
  7361. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7362. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7363. } while (0)
  7364. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7365. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7366. /**
  7367. * Enumeration for IP Protocol or IPSEC Protocol
  7368. * IPsec describes the framework for providing security at IP layer.
  7369. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7370. */
  7371. enum htt_rx_flow_proto {
  7372. HTT_RX_FLOW_IP_PROTO,
  7373. HTT_RX_FLOW_IPSEC_PROTO,
  7374. };
  7375. /**
  7376. * Enumeration for FSE Cache Invalidation
  7377. * 0 - No Cache Invalidation required
  7378. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7379. * 2 - Complete FSE Cache Invalidation
  7380. * 3 - FSE Disable
  7381. * 4 - FSE Enable
  7382. */
  7383. enum htt_rx_fse_operation {
  7384. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7385. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7386. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7387. HTT_RX_FSE_DISABLE,
  7388. HTT_RX_FSE_ENABLE,
  7389. };
  7390. /* DWORD 0: Pdev ID */
  7391. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7392. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7393. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7394. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7395. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7396. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7397. do { \
  7398. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7399. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7400. } while (0)
  7401. /* DWORD 1:IP PROTO or IPSEC */
  7402. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7403. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7404. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7405. do { \
  7406. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7407. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7408. } while (0)
  7409. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7410. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7411. /* DWORD 1:FSE Operation */
  7412. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7413. #define HTT_RX_FSE_OPERATION_S 1
  7414. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7415. do { \
  7416. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7417. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7418. } while (0)
  7419. #define HTT_RX_FSE_OPERATION_GET(word) \
  7420. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7421. /* DWORD 2-9:IP Address */
  7422. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7423. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7424. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7425. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7426. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7427. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7428. do { \
  7429. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7430. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7431. } while (0)
  7432. /* DWORD 10:Source Port Number */
  7433. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7434. #define HTT_RX_FSE_SOURCEPORT_S 0
  7435. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7436. do { \
  7437. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7438. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7439. } while (0)
  7440. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7441. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7442. /* DWORD 11:Destination Port Number */
  7443. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7444. #define HTT_RX_FSE_DESTPORT_S 16
  7445. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7446. do { \
  7447. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7448. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7449. } while (0)
  7450. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7451. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7452. /* DWORD 10-11:SPI (In case of IPSEC) */
  7453. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7454. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7455. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7456. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7457. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7458. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7459. do { \
  7460. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7461. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7462. } while (0)
  7463. /* DWORD 12:L4 PROTO */
  7464. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7465. #define HTT_RX_FSE_L4_PROTO_S 0
  7466. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7467. do { \
  7468. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7469. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7470. } while (0)
  7471. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7472. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7473. /**
  7474. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7475. *
  7476. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7477. *
  7478. * |31 24|23 |15 8|7 2|1|0|
  7479. * |----------------+----------------+----------------+----------------|
  7480. * | reserved | pdev_id | msg_type |
  7481. * |---------------------------------+----------------+----------------|
  7482. * | reserved |E|F|
  7483. * |---------------------------------+----------------+----------------|
  7484. * Where E = Configure the target to provide the 3-tuple hash value in
  7485. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7486. * F = Configure the target to provide the 3-tuple hash value in
  7487. * flow_id_toeplitz field of rx_msdu_start tlv
  7488. *
  7489. * The following field definitions describe the format of the 3 tuple hash value
  7490. * message sent from the host to target as part of initialization sequence.
  7491. *
  7492. * Header fields:
  7493. * dword0 - b'7:0 - msg_type: This will be set to
  7494. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7495. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7496. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7497. * specified pdev's LMAC ring.
  7498. * b'31:16 - reserved : Reserved for future use
  7499. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7500. * b'1 - toeplitz_hash_2_or_4_field_enable
  7501. * b'31:2 - reserved : Reserved for future use
  7502. * ---------+------+----------------------------------------------------------
  7503. * bit1 | bit0 | Functionality
  7504. * ---------+------+----------------------------------------------------------
  7505. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7506. * | | in flow_id_toeplitz field
  7507. * ---------+------+----------------------------------------------------------
  7508. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7509. * | | in toeplitz_hash_2_or_4 field
  7510. * ---------+------+----------------------------------------------------------
  7511. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7512. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7513. * ---------+------+----------------------------------------------------------
  7514. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7515. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7516. * | | toeplitz_hash_2_or_4 field
  7517. *----------------------------------------------------------------------------
  7518. */
  7519. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7520. A_UINT32 msg_type :8,
  7521. pdev_id :8,
  7522. reserved0 :16;
  7523. A_UINT32 flow_id_toeplitz_field_enable :1,
  7524. toeplitz_hash_2_or_4_field_enable :1,
  7525. reserved1 :30;
  7526. } POSTPACK;
  7527. /* DWORD0 : pdev_id configuration Macros */
  7528. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7529. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7530. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7531. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7532. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7533. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7534. do { \
  7535. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7536. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7537. } while (0)
  7538. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7539. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7540. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7541. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7542. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7543. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7544. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7545. do { \
  7546. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7547. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7548. } while (0)
  7549. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7550. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7551. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7552. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7553. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7554. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7555. do { \
  7556. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7557. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7558. } while (0)
  7559. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7560. /**
  7561. * @brief host --> target Host PA Address Size
  7562. *
  7563. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7564. *
  7565. * @details
  7566. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7567. * provide the physical start address and size of each of the memory
  7568. * areas within host DDR that the target FW may need to access.
  7569. *
  7570. * For example, the host can use this message to allow the target FW
  7571. * to set up access to the host's pools of TQM link descriptors.
  7572. * The message would appear as follows:
  7573. *
  7574. * |31 24|23 16|15 8|7 0|
  7575. * |----------------+----------------+----------------+----------------|
  7576. * | reserved | num_entries | msg_type |
  7577. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7578. * | mem area 0 size |
  7579. * |----------------+----------------+----------------+----------------|
  7580. * | mem area 0 physical_address_lo |
  7581. * |----------------+----------------+----------------+----------------|
  7582. * | mem area 0 physical_address_hi |
  7583. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7584. * | mem area 1 size |
  7585. * |----------------+----------------+----------------+----------------|
  7586. * | mem area 1 physical_address_lo |
  7587. * |----------------+----------------+----------------+----------------|
  7588. * | mem area 1 physical_address_hi |
  7589. * |----------------+----------------+----------------+----------------|
  7590. * ...
  7591. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7592. * | mem area N size |
  7593. * |----------------+----------------+----------------+----------------|
  7594. * | mem area N physical_address_lo |
  7595. * |----------------+----------------+----------------+----------------|
  7596. * | mem area N physical_address_hi |
  7597. * |----------------+----------------+----------------+----------------|
  7598. *
  7599. * The message is interpreted as follows:
  7600. * dword0 - b'0:7 - msg_type: This will be set to
  7601. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7602. * b'8:15 - number_entries: Indicated the number of host memory
  7603. * areas specified within the remainder of the message
  7604. * b'16:31 - reserved.
  7605. * dword1 - b'0:31 - memory area 0 size in bytes
  7606. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7607. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7608. * and similar for memory area 1 through memory area N.
  7609. */
  7610. PREPACK struct htt_h2t_host_paddr_size {
  7611. A_UINT32 msg_type: 8,
  7612. num_entries: 8,
  7613. reserved: 16;
  7614. } POSTPACK;
  7615. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7616. A_UINT32 size;
  7617. A_UINT32 physical_address_lo;
  7618. A_UINT32 physical_address_hi;
  7619. } POSTPACK;
  7620. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7621. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7622. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7623. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7624. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7625. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7626. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7627. do { \
  7628. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7629. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7630. } while (0)
  7631. /**
  7632. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7633. *
  7634. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7635. *
  7636. * @details
  7637. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7638. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7639. *
  7640. * The message would appear as follows:
  7641. *
  7642. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7643. * |---------------------------------+---+---+----------+-+-----------|
  7644. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7645. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7646. *
  7647. *
  7648. * The message is interpreted as follows:
  7649. * dword0 - b'0:7 - msg_type: This will be set to
  7650. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7651. * b'8 - override bit to drive MSDUs to PPE ring
  7652. * b'9:13 - REO destination ring indication
  7653. * b'14 - Multi buffer msdu override enable bit
  7654. * b'15 - Intra BSS override
  7655. * b'16 - Decap raw override
  7656. * b'17 - Decap Native wifi override
  7657. * b'18 - IP frag override
  7658. * b'19:31 - reserved
  7659. */
  7660. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7661. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7662. override: 1,
  7663. reo_destination_indication: 5,
  7664. multi_buffer_msdu_override_en: 1,
  7665. intra_bss_override: 1,
  7666. decap_raw_override: 1,
  7667. decap_nwifi_override: 1,
  7668. ip_frag_override: 1,
  7669. reserved: 13;
  7670. } POSTPACK;
  7671. /* DWORD 0: Override */
  7672. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7673. #define HTT_PPE_CFG_OVERRIDE_S 8
  7674. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7675. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7676. HTT_PPE_CFG_OVERRIDE_S)
  7677. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7680. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7681. } while (0)
  7682. /* DWORD 0: REO Destination Indication*/
  7683. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7684. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7685. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7686. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7687. HTT_PPE_CFG_REO_DEST_IND_S)
  7688. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7689. do { \
  7690. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7691. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7692. } while (0)
  7693. /* DWORD 0: Multi buffer MSDU override */
  7694. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7695. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7696. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7697. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7698. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7699. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7700. do { \
  7701. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7702. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7703. } while (0)
  7704. /* DWORD 0: Intra BSS override */
  7705. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7706. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7707. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7708. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7709. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7710. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7711. do { \
  7712. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7713. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7714. } while (0)
  7715. /* DWORD 0: Decap RAW override */
  7716. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7717. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7718. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7719. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7720. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7721. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7722. do { \
  7723. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7724. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7725. } while (0)
  7726. /* DWORD 0: Decap NWIFI override */
  7727. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7728. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7729. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7730. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7731. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7732. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7733. do { \
  7734. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7735. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7736. } while (0)
  7737. /* DWORD 0: IP frag override */
  7738. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7739. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7740. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7741. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7742. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7743. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7746. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7747. } while (0)
  7748. /*
  7749. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7750. *
  7751. * @details
  7752. * The following field definitions describe the format of the HTT host
  7753. * to target FW VDEV TX RX stats retrieve message.
  7754. * The message specifies the type of stats the host wants to retrieve.
  7755. *
  7756. * |31 27|26 25|24 17|16|15 8|7 0|
  7757. * |-----------------------------------------------------------|
  7758. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7759. * |-----------------------------------------------------------|
  7760. * | vdev_id lower bitmask |
  7761. * |-----------------------------------------------------------|
  7762. * | vdev_id upper bitmask |
  7763. * |-----------------------------------------------------------|
  7764. * Header fields:
  7765. * Where:
  7766. * dword0 - b'7:0 - msg_type: This will be set to
  7767. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7768. * b'15:8 - pdev id
  7769. * b'16(E) - Enable/Disable the vdev HW stats
  7770. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7771. * b'25:26(R) - Reset stats bits
  7772. * 0: don't reset stats
  7773. * 1: reset stats once
  7774. * 2: reset stats at the start of each periodic interval
  7775. * b'27:31 - reserved for future use
  7776. * dword1 - b'0:31 - vdev_id lower bitmask
  7777. * dword2 - b'0:31 - vdev_id upper bitmask
  7778. */
  7779. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7780. A_UINT32 msg_type :8,
  7781. pdev_id :8,
  7782. enable :1,
  7783. periodic_interval :8,
  7784. reset_stats_bits :2,
  7785. reserved0 :5;
  7786. A_UINT32 vdev_id_lower_bitmask;
  7787. A_UINT32 vdev_id_upper_bitmask;
  7788. } POSTPACK;
  7789. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7790. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7791. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7792. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7793. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7794. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7795. do { \
  7796. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7797. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7798. } while (0)
  7799. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7800. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7801. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7802. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7803. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7804. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7805. do { \
  7806. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7807. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7808. } while (0)
  7809. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7810. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7811. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7812. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7813. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7814. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7815. do { \
  7816. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7817. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7818. } while (0)
  7819. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7820. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7821. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7822. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7823. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7824. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7825. do { \
  7826. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7827. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7828. } while (0)
  7829. /*
  7830. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  7831. *
  7832. * @details
  7833. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  7834. * the default MSDU queues for one of the TIDs within the specified peer
  7835. * to the specified service class.
  7836. * The TID is indirectly specified - each service class is associated
  7837. * with a TID. All default MSDU queues for this peer-TID will be
  7838. * linked to the service class in question.
  7839. *
  7840. * |31 16|15 8|7 0|
  7841. * |------------------------------+--------------+--------------|
  7842. * | peer ID | svc class ID | msg type |
  7843. * |------------------------------------------------------------|
  7844. * Header fields:
  7845. * dword0 - b'7:0 - msg_type: This will be set to
  7846. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  7847. * b'15:8 - service class ID
  7848. * b'31:16 - peer ID
  7849. */
  7850. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  7851. A_UINT32 msg_type :8,
  7852. svc_class_id :8,
  7853. peer_id :16;
  7854. } POSTPACK;
  7855. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  7856. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  7857. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  7858. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  7859. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  7860. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  7861. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  7862. do { \
  7863. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  7864. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  7865. } while (0)
  7866. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  7867. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  7868. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  7869. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  7870. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  7871. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  7872. do { \
  7873. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  7874. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  7875. } while (0)
  7876. /*
  7877. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  7878. *
  7879. * @details
  7880. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  7881. * remove the linkage of the specified peer-TID's MSDU queues to
  7882. * service classes.
  7883. *
  7884. * |31 16|15 12|11 8|7 0|
  7885. * |------------------------------+------+-------+--------------|
  7886. * | peer ID | rsvd | TID | msg type |
  7887. * |------------------------------------------------------------|
  7888. * Header fields:
  7889. * dword0 - b'7:0 - msg_type: This will be set to
  7890. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  7891. * b'11:8 - TID
  7892. * dword1 - b'31:16 - peer ID
  7893. */
  7894. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  7895. A_UINT32 msg_type :8,
  7896. tid :4,
  7897. reserved :4,
  7898. peer_id :16;
  7899. } POSTPACK;
  7900. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  7901. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M 0x00000F00
  7902. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S 8
  7903. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_GET(_var) \
  7904. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M) >> \
  7905. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S)
  7906. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_TID_SET(_var, _val) \
  7907. do { \
  7908. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID, _val); \
  7909. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S));\
  7910. } while (0)
  7911. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  7912. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  7913. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  7914. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  7915. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  7916. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  7917. do { \
  7918. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  7919. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  7920. } while (0)
  7921. /*
  7922. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  7923. *
  7924. * @details
  7925. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  7926. * request the target to report what service class the default MSDU queues
  7927. * of the specified peer-TID are linked to.
  7928. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  7929. * to report what service class (if any) the peer-TID's default MSDU queues
  7930. * are linked to.
  7931. *
  7932. * |31 16|15 12|11 8|7 0|
  7933. * |------------------------------+------+-------+--------------|
  7934. * | peer ID | rsvd | TID | msg type |
  7935. * |------------------------------------------------------------|
  7936. * Header fields:
  7937. * dword0 - b'7:0 - msg_type: This will be set to
  7938. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  7939. * b'11:8 - TID
  7940. * dword1 - b'31:16 - peer ID
  7941. */
  7942. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  7943. A_UINT32 msg_type :8,
  7944. tid :4,
  7945. reserved :4,
  7946. peer_id :16;
  7947. } POSTPACK;
  7948. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  7949. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M 0x00000F00
  7950. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S 8
  7951. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_GET(_var) \
  7952. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M) >> \
  7953. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S)
  7954. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_SET(_var, _val) \
  7955. do { \
  7956. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID, _val); \
  7957. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S));\
  7958. } while (0)
  7959. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  7960. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  7961. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  7962. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  7963. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  7964. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  7965. do { \
  7966. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  7967. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  7968. } while (0)
  7969. /*=== target -> host messages ===============================================*/
  7970. enum htt_t2h_msg_type {
  7971. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7972. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7973. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7974. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7975. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7976. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7977. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7978. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7979. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7980. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7981. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7982. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7983. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7984. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7985. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7986. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7987. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7988. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7989. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7990. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7991. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7992. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7993. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7994. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7995. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7996. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7997. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7998. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7999. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8000. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8001. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8002. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8003. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8004. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8005. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8006. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8007. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8008. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8009. /* TX_OFFLOAD_DELIVER_IND:
  8010. * Forward the target's locally-generated packets to the host,
  8011. * to provide to the monitor mode interface.
  8012. */
  8013. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8014. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8015. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8016. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8017. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8018. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8019. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8020. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8021. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8022. HTT_T2H_MSG_TYPE_TEST,
  8023. /* keep this last */
  8024. HTT_T2H_NUM_MSGS
  8025. };
  8026. /*
  8027. * HTT target to host message type -
  8028. * stored in bits 7:0 of the first word of the message
  8029. */
  8030. #define HTT_T2H_MSG_TYPE_M 0xff
  8031. #define HTT_T2H_MSG_TYPE_S 0
  8032. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8033. do { \
  8034. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8035. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8036. } while (0)
  8037. #define HTT_T2H_MSG_TYPE_GET(word) \
  8038. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8039. /**
  8040. * @brief target -> host version number confirmation message definition
  8041. *
  8042. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8043. *
  8044. * |31 24|23 16|15 8|7 0|
  8045. * |----------------+----------------+----------------+----------------|
  8046. * | reserved | major number | minor number | msg type |
  8047. * |-------------------------------------------------------------------|
  8048. * : option request TLV (optional) |
  8049. * :...................................................................:
  8050. *
  8051. * The VER_CONF message may consist of a single 4-byte word, or may be
  8052. * extended with TLVs that specify HTT options selected by the target.
  8053. * The following option TLVs may be appended to the VER_CONF message:
  8054. * - LL_BUS_ADDR_SIZE
  8055. * - HL_SUPPRESS_TX_COMPL_IND
  8056. * - MAX_TX_QUEUE_GROUPS
  8057. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8058. * may be appended to the VER_CONF message (but only one TLV of each type).
  8059. *
  8060. * Header fields:
  8061. * - MSG_TYPE
  8062. * Bits 7:0
  8063. * Purpose: identifies this as a version number confirmation message
  8064. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8065. * - VER_MINOR
  8066. * Bits 15:8
  8067. * Purpose: Specify the minor number of the HTT message library version
  8068. * in use by the target firmware.
  8069. * The minor number specifies the specific revision within a range
  8070. * of fundamentally compatible HTT message definition revisions.
  8071. * Compatible revisions involve adding new messages or perhaps
  8072. * adding new fields to existing messages, in a backwards-compatible
  8073. * manner.
  8074. * Incompatible revisions involve changing the message type values,
  8075. * or redefining existing messages.
  8076. * Value: minor number
  8077. * - VER_MAJOR
  8078. * Bits 15:8
  8079. * Purpose: Specify the major number of the HTT message library version
  8080. * in use by the target firmware.
  8081. * The major number specifies the family of minor revisions that are
  8082. * fundamentally compatible with each other, but not with prior or
  8083. * later families.
  8084. * Value: major number
  8085. */
  8086. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8087. #define HTT_VER_CONF_MINOR_S 8
  8088. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8089. #define HTT_VER_CONF_MAJOR_S 16
  8090. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8091. do { \
  8092. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8093. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8094. } while (0)
  8095. #define HTT_VER_CONF_MINOR_GET(word) \
  8096. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8097. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8098. do { \
  8099. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8100. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8101. } while (0)
  8102. #define HTT_VER_CONF_MAJOR_GET(word) \
  8103. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8104. #define HTT_VER_CONF_BYTES 4
  8105. /**
  8106. * @brief - target -> host HTT Rx In order indication message
  8107. *
  8108. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8109. *
  8110. * @details
  8111. *
  8112. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8113. * |----------------+-------------------+---------------------+---------------|
  8114. * | peer ID | P| F| O| ext TID | msg type |
  8115. * |--------------------------------------------------------------------------|
  8116. * | MSDU count | Reserved | vdev id |
  8117. * |--------------------------------------------------------------------------|
  8118. * | MSDU 0 bus address (bits 31:0) |
  8119. #if HTT_PADDR64
  8120. * | MSDU 0 bus address (bits 63:32) |
  8121. #endif
  8122. * |--------------------------------------------------------------------------|
  8123. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8124. * |--------------------------------------------------------------------------|
  8125. * | MSDU 1 bus address (bits 31:0) |
  8126. #if HTT_PADDR64
  8127. * | MSDU 1 bus address (bits 63:32) |
  8128. #endif
  8129. * |--------------------------------------------------------------------------|
  8130. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8131. * |--------------------------------------------------------------------------|
  8132. */
  8133. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8134. *
  8135. * @details
  8136. * bits
  8137. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8138. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8139. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8140. * | | frag | | | | fail |chksum fail|
  8141. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8142. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8143. */
  8144. struct htt_rx_in_ord_paddr_ind_hdr_t
  8145. {
  8146. A_UINT32 /* word 0 */
  8147. msg_type: 8,
  8148. ext_tid: 5,
  8149. offload: 1,
  8150. frag: 1,
  8151. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8152. peer_id: 16;
  8153. A_UINT32 /* word 1 */
  8154. vap_id: 8,
  8155. /* NOTE:
  8156. * This reserved_1 field is not truly reserved - certain targets use
  8157. * this field internally to store debug information, and do not zero
  8158. * out the contents of the field before uploading the message to the
  8159. * host. Thus, any host-target communication supported by this field
  8160. * is limited to using values that are never used by the debug
  8161. * information stored by certain targets in the reserved_1 field.
  8162. * In particular, the targets in question don't use the value 0x3
  8163. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8164. * so this previously-unused value within these bits is available to
  8165. * use as the host / target PKT_CAPTURE_MODE flag.
  8166. */
  8167. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8168. /* if pkt_capture_mode == 0x3, host should
  8169. * send rx frames to monitor mode interface
  8170. */
  8171. msdu_cnt: 16;
  8172. };
  8173. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8174. {
  8175. A_UINT32 dma_addr;
  8176. A_UINT32
  8177. length: 16,
  8178. fw_desc: 8,
  8179. msdu_info:8;
  8180. };
  8181. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8182. {
  8183. A_UINT32 dma_addr_lo;
  8184. A_UINT32 dma_addr_hi;
  8185. A_UINT32
  8186. length: 16,
  8187. fw_desc: 8,
  8188. msdu_info:8;
  8189. };
  8190. #if HTT_PADDR64
  8191. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8192. #else
  8193. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8194. #endif
  8195. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8196. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8198. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8202. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8203. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8204. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8205. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8206. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8207. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8208. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8209. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8210. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8211. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8212. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8213. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8214. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8215. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8216. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8217. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8218. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8219. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8220. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8221. /* for systems using 64-bit format for bus addresses */
  8222. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8223. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8224. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8225. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8226. /* for systems using 32-bit format for bus addresses */
  8227. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8228. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8229. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8230. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8231. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8232. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8233. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8234. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8235. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8236. do { \
  8237. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8238. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8239. } while (0)
  8240. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8241. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8242. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8243. do { \
  8244. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8245. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8246. } while (0)
  8247. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8248. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8249. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8250. do { \
  8251. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8252. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8253. } while (0)
  8254. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8255. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8256. /*
  8257. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8258. * deliver the rx frames to the monitor mode interface.
  8259. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8260. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8261. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8262. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8263. */
  8264. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8265. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8268. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8269. } while (0)
  8270. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8271. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8272. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8273. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8274. do { \
  8275. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8276. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8277. } while (0)
  8278. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8279. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8280. /* for systems using 64-bit format for bus addresses */
  8281. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8282. do { \
  8283. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8284. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8285. } while (0)
  8286. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8287. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8288. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8289. do { \
  8290. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8291. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8292. } while (0)
  8293. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8294. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8295. /* for systems using 32-bit format for bus addresses */
  8296. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8297. do { \
  8298. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8299. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8300. } while (0)
  8301. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8302. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8303. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8304. do { \
  8305. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8306. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8307. } while (0)
  8308. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8309. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8310. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8311. do { \
  8312. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8313. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8314. } while (0)
  8315. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8316. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8317. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8318. do { \
  8319. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8320. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8321. } while (0)
  8322. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8323. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8324. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8325. do { \
  8326. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8327. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8328. } while (0)
  8329. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8330. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8331. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8332. do { \
  8333. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8334. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8335. } while (0)
  8336. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8337. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8338. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8339. do { \
  8340. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8341. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8342. } while (0)
  8343. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8344. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8345. /* definitions used within target -> host rx indication message */
  8346. PREPACK struct htt_rx_ind_hdr_prefix_t
  8347. {
  8348. A_UINT32 /* word 0 */
  8349. msg_type: 8,
  8350. ext_tid: 5,
  8351. release_valid: 1,
  8352. flush_valid: 1,
  8353. reserved0: 1,
  8354. peer_id: 16;
  8355. A_UINT32 /* word 1 */
  8356. flush_start_seq_num: 6,
  8357. flush_end_seq_num: 6,
  8358. release_start_seq_num: 6,
  8359. release_end_seq_num: 6,
  8360. num_mpdu_ranges: 8;
  8361. } POSTPACK;
  8362. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8363. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8364. #define HTT_TGT_RSSI_INVALID 0x80
  8365. PREPACK struct htt_rx_ppdu_desc_t
  8366. {
  8367. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8368. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8369. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8370. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8371. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8372. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8373. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8374. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8375. A_UINT32 /* word 0 */
  8376. rssi_cmb: 8,
  8377. timestamp_submicrosec: 8,
  8378. phy_err_code: 8,
  8379. phy_err: 1,
  8380. legacy_rate: 4,
  8381. legacy_rate_sel: 1,
  8382. end_valid: 1,
  8383. start_valid: 1;
  8384. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8385. union {
  8386. A_UINT32 /* word 1 */
  8387. rssi0_pri20: 8,
  8388. rssi0_ext20: 8,
  8389. rssi0_ext40: 8,
  8390. rssi0_ext80: 8;
  8391. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8392. } u0;
  8393. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8394. union {
  8395. A_UINT32 /* word 2 */
  8396. rssi1_pri20: 8,
  8397. rssi1_ext20: 8,
  8398. rssi1_ext40: 8,
  8399. rssi1_ext80: 8;
  8400. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8401. } u1;
  8402. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8403. union {
  8404. A_UINT32 /* word 3 */
  8405. rssi2_pri20: 8,
  8406. rssi2_ext20: 8,
  8407. rssi2_ext40: 8,
  8408. rssi2_ext80: 8;
  8409. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8410. } u2;
  8411. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8412. union {
  8413. A_UINT32 /* word 4 */
  8414. rssi3_pri20: 8,
  8415. rssi3_ext20: 8,
  8416. rssi3_ext40: 8,
  8417. rssi3_ext80: 8;
  8418. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8419. } u3;
  8420. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8421. A_UINT32 tsf32; /* word 5 */
  8422. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8423. A_UINT32 timestamp_microsec; /* word 6 */
  8424. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8425. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8426. A_UINT32 /* word 7 */
  8427. vht_sig_a1: 24,
  8428. preamble_type: 8;
  8429. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8430. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8431. A_UINT32 /* word 8 */
  8432. vht_sig_a2: 24,
  8433. /* sa_ant_matrix
  8434. * For cases where a single rx chain has options to be connected to
  8435. * different rx antennas, show which rx antennas were in use during
  8436. * receipt of a given PPDU.
  8437. * This sa_ant_matrix provides a bitmask of the antennas used while
  8438. * receiving this frame.
  8439. */
  8440. sa_ant_matrix: 8;
  8441. } POSTPACK;
  8442. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8443. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8444. PREPACK struct htt_rx_ind_hdr_suffix_t
  8445. {
  8446. A_UINT32 /* word 0 */
  8447. fw_rx_desc_bytes: 16,
  8448. reserved0: 16;
  8449. } POSTPACK;
  8450. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8451. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8452. PREPACK struct htt_rx_ind_hdr_t
  8453. {
  8454. struct htt_rx_ind_hdr_prefix_t prefix;
  8455. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8456. struct htt_rx_ind_hdr_suffix_t suffix;
  8457. } POSTPACK;
  8458. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8459. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8460. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8461. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8462. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8463. /*
  8464. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8465. * the offset into the HTT rx indication message at which the
  8466. * FW rx PPDU descriptor resides
  8467. */
  8468. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8469. /*
  8470. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8471. * the offset into the HTT rx indication message at which the
  8472. * header suffix (FW rx MSDU byte count) resides
  8473. */
  8474. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8475. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8476. /*
  8477. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8478. * the offset into the HTT rx indication message at which the per-MSDU
  8479. * information starts
  8480. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8481. * per-MSDU information portion of the message. The per-MSDU info itself
  8482. * starts at byte 12.
  8483. */
  8484. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8485. /**
  8486. * @brief target -> host rx indication message definition
  8487. *
  8488. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8489. *
  8490. * @details
  8491. * The following field definitions describe the format of the rx indication
  8492. * message sent from the target to the host.
  8493. * The message consists of three major sections:
  8494. * 1. a fixed-length header
  8495. * 2. a variable-length list of firmware rx MSDU descriptors
  8496. * 3. one or more 4-octet MPDU range information elements
  8497. * The fixed length header itself has two sub-sections
  8498. * 1. the message meta-information, including identification of the
  8499. * sender and type of the received data, and a 4-octet flush/release IE
  8500. * 2. the firmware rx PPDU descriptor
  8501. *
  8502. * The format of the message is depicted below.
  8503. * in this depiction, the following abbreviations are used for information
  8504. * elements within the message:
  8505. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8506. * elements associated with the PPDU start are valid.
  8507. * Specifically, the following fields are valid only if SV is set:
  8508. * RSSI (all variants), L, legacy rate, preamble type, service,
  8509. * VHT-SIG-A
  8510. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8511. * elements associated with the PPDU end are valid.
  8512. * Specifically, the following fields are valid only if EV is set:
  8513. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8514. * - L - Legacy rate selector - if legacy rates are used, this flag
  8515. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8516. * (L == 0) PHY.
  8517. * - P - PHY error flag - boolean indication of whether the rx frame had
  8518. * a PHY error
  8519. *
  8520. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8521. * |----------------+-------------------+---------------------+---------------|
  8522. * | peer ID | |RV|FV| ext TID | msg type |
  8523. * |--------------------------------------------------------------------------|
  8524. * | num | release | release | flush | flush |
  8525. * | MPDU | end | start | end | start |
  8526. * | ranges | seq num | seq num | seq num | seq num |
  8527. * |==========================================================================|
  8528. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8529. * |V|V| | rate | | | timestamp | RSSI |
  8530. * |--------------------------------------------------------------------------|
  8531. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8532. * |--------------------------------------------------------------------------|
  8533. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8534. * |--------------------------------------------------------------------------|
  8535. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8536. * |--------------------------------------------------------------------------|
  8537. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8538. * |--------------------------------------------------------------------------|
  8539. * | TSF LSBs |
  8540. * |--------------------------------------------------------------------------|
  8541. * | microsec timestamp |
  8542. * |--------------------------------------------------------------------------|
  8543. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8544. * |--------------------------------------------------------------------------|
  8545. * | service | HT-SIG / VHT-SIG-A2 |
  8546. * |==========================================================================|
  8547. * | reserved | FW rx desc bytes |
  8548. * |--------------------------------------------------------------------------|
  8549. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8550. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8551. * |--------------------------------------------------------------------------|
  8552. * : : :
  8553. * |--------------------------------------------------------------------------|
  8554. * | alignment | MSDU Rx |
  8555. * | padding | desc Bn |
  8556. * |--------------------------------------------------------------------------|
  8557. * | reserved | MPDU range status | MPDU count |
  8558. * |--------------------------------------------------------------------------|
  8559. * : reserved : MPDU range status : MPDU count :
  8560. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8561. *
  8562. * Header fields:
  8563. * - MSG_TYPE
  8564. * Bits 7:0
  8565. * Purpose: identifies this as an rx indication message
  8566. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8567. * - EXT_TID
  8568. * Bits 12:8
  8569. * Purpose: identify the traffic ID of the rx data, including
  8570. * special "extended" TID values for multicast, broadcast, and
  8571. * non-QoS data frames
  8572. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8573. * - FLUSH_VALID (FV)
  8574. * Bit 13
  8575. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8576. * is valid
  8577. * Value:
  8578. * 1 -> flush IE is valid and needs to be processed
  8579. * 0 -> flush IE is not valid and should be ignored
  8580. * - REL_VALID (RV)
  8581. * Bit 13
  8582. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8583. * is valid
  8584. * Value:
  8585. * 1 -> release IE is valid and needs to be processed
  8586. * 0 -> release IE is not valid and should be ignored
  8587. * - PEER_ID
  8588. * Bits 31:16
  8589. * Purpose: Identify, by ID, which peer sent the rx data
  8590. * Value: ID of the peer who sent the rx data
  8591. * - FLUSH_SEQ_NUM_START
  8592. * Bits 5:0
  8593. * Purpose: Indicate the start of a series of MPDUs to flush
  8594. * Not all MPDUs within this series are necessarily valid - the host
  8595. * must check each sequence number within this range to see if the
  8596. * corresponding MPDU is actually present.
  8597. * This field is only valid if the FV bit is set.
  8598. * Value:
  8599. * The sequence number for the first MPDUs to check to flush.
  8600. * The sequence number is masked by 0x3f.
  8601. * - FLUSH_SEQ_NUM_END
  8602. * Bits 11:6
  8603. * Purpose: Indicate the end of a series of MPDUs to flush
  8604. * Value:
  8605. * The sequence number one larger than the sequence number of the
  8606. * last MPDU to check to flush.
  8607. * The sequence number is masked by 0x3f.
  8608. * Not all MPDUs within this series are necessarily valid - the host
  8609. * must check each sequence number within this range to see if the
  8610. * corresponding MPDU is actually present.
  8611. * This field is only valid if the FV bit is set.
  8612. * - REL_SEQ_NUM_START
  8613. * Bits 17:12
  8614. * Purpose: Indicate the start of a series of MPDUs to release.
  8615. * All MPDUs within this series are present and valid - the host
  8616. * need not check each sequence number within this range to see if
  8617. * the corresponding MPDU is actually present.
  8618. * This field is only valid if the RV bit is set.
  8619. * Value:
  8620. * The sequence number for the first MPDUs to check to release.
  8621. * The sequence number is masked by 0x3f.
  8622. * - REL_SEQ_NUM_END
  8623. * Bits 23:18
  8624. * Purpose: Indicate the end of a series of MPDUs to release.
  8625. * Value:
  8626. * The sequence number one larger than the sequence number of the
  8627. * last MPDU to check to release.
  8628. * The sequence number is masked by 0x3f.
  8629. * All MPDUs within this series are present and valid - the host
  8630. * need not check each sequence number within this range to see if
  8631. * the corresponding MPDU is actually present.
  8632. * This field is only valid if the RV bit is set.
  8633. * - NUM_MPDU_RANGES
  8634. * Bits 31:24
  8635. * Purpose: Indicate how many ranges of MPDUs are present.
  8636. * Each MPDU range consists of a series of contiguous MPDUs within the
  8637. * rx frame sequence which all have the same MPDU status.
  8638. * Value: 1-63 (typically a small number, like 1-3)
  8639. *
  8640. * Rx PPDU descriptor fields:
  8641. * - RSSI_CMB
  8642. * Bits 7:0
  8643. * Purpose: Combined RSSI from all active rx chains, across the active
  8644. * bandwidth.
  8645. * Value: RSSI dB units w.r.t. noise floor
  8646. * - TIMESTAMP_SUBMICROSEC
  8647. * Bits 15:8
  8648. * Purpose: high-resolution timestamp
  8649. * Value:
  8650. * Sub-microsecond time of PPDU reception.
  8651. * This timestamp ranges from [0,MAC clock MHz).
  8652. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8653. * to form a high-resolution, large range rx timestamp.
  8654. * - PHY_ERR_CODE
  8655. * Bits 23:16
  8656. * Purpose:
  8657. * If the rx frame processing resulted in a PHY error, indicate what
  8658. * type of rx PHY error occurred.
  8659. * Value:
  8660. * This field is valid if the "P" (PHY_ERR) flag is set.
  8661. * TBD: document/specify the values for this field
  8662. * - PHY_ERR
  8663. * Bit 24
  8664. * Purpose: indicate whether the rx PPDU had a PHY error
  8665. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8666. * - LEGACY_RATE
  8667. * Bits 28:25
  8668. * Purpose:
  8669. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8670. * specify which rate was used.
  8671. * Value:
  8672. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8673. * flag.
  8674. * If LEGACY_RATE_SEL is 0:
  8675. * 0x8: OFDM 48 Mbps
  8676. * 0x9: OFDM 24 Mbps
  8677. * 0xA: OFDM 12 Mbps
  8678. * 0xB: OFDM 6 Mbps
  8679. * 0xC: OFDM 54 Mbps
  8680. * 0xD: OFDM 36 Mbps
  8681. * 0xE: OFDM 18 Mbps
  8682. * 0xF: OFDM 9 Mbps
  8683. * If LEGACY_RATE_SEL is 1:
  8684. * 0x8: CCK 11 Mbps long preamble
  8685. * 0x9: CCK 5.5 Mbps long preamble
  8686. * 0xA: CCK 2 Mbps long preamble
  8687. * 0xB: CCK 1 Mbps long preamble
  8688. * 0xC: CCK 11 Mbps short preamble
  8689. * 0xD: CCK 5.5 Mbps short preamble
  8690. * 0xE: CCK 2 Mbps short preamble
  8691. * - LEGACY_RATE_SEL
  8692. * Bit 29
  8693. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8694. * Value:
  8695. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8696. * used a legacy rate.
  8697. * 0 -> OFDM, 1 -> CCK
  8698. * - END_VALID
  8699. * Bit 30
  8700. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8701. * the start of the PPDU are valid. Specifically, the following
  8702. * fields are only valid if END_VALID is set:
  8703. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8704. * TIMESTAMP_SUBMICROSEC
  8705. * Value:
  8706. * 0 -> rx PPDU desc end fields are not valid
  8707. * 1 -> rx PPDU desc end fields are valid
  8708. * - START_VALID
  8709. * Bit 31
  8710. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8711. * the end of the PPDU are valid. Specifically, the following
  8712. * fields are only valid if START_VALID is set:
  8713. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8714. * VHT-SIG-A
  8715. * Value:
  8716. * 0 -> rx PPDU desc start fields are not valid
  8717. * 1 -> rx PPDU desc start fields are valid
  8718. * - RSSI0_PRI20
  8719. * Bits 7:0
  8720. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8721. * Value: RSSI dB units w.r.t. noise floor
  8722. *
  8723. * - RSSI0_EXT20
  8724. * Bits 7:0
  8725. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8726. * (if the rx bandwidth was >= 40 MHz)
  8727. * Value: RSSI dB units w.r.t. noise floor
  8728. * - RSSI0_EXT40
  8729. * Bits 7:0
  8730. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8731. * (if the rx bandwidth was >= 80 MHz)
  8732. * Value: RSSI dB units w.r.t. noise floor
  8733. * - RSSI0_EXT80
  8734. * Bits 7:0
  8735. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8736. * (if the rx bandwidth was >= 160 MHz)
  8737. * Value: RSSI dB units w.r.t. noise floor
  8738. *
  8739. * - RSSI1_PRI20
  8740. * Bits 7:0
  8741. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8742. * Value: RSSI dB units w.r.t. noise floor
  8743. * - RSSI1_EXT20
  8744. * Bits 7:0
  8745. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8746. * (if the rx bandwidth was >= 40 MHz)
  8747. * Value: RSSI dB units w.r.t. noise floor
  8748. * - RSSI1_EXT40
  8749. * Bits 7:0
  8750. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8751. * (if the rx bandwidth was >= 80 MHz)
  8752. * Value: RSSI dB units w.r.t. noise floor
  8753. * - RSSI1_EXT80
  8754. * Bits 7:0
  8755. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8756. * (if the rx bandwidth was >= 160 MHz)
  8757. * Value: RSSI dB units w.r.t. noise floor
  8758. *
  8759. * - RSSI2_PRI20
  8760. * Bits 7:0
  8761. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8762. * Value: RSSI dB units w.r.t. noise floor
  8763. * - RSSI2_EXT20
  8764. * Bits 7:0
  8765. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8766. * (if the rx bandwidth was >= 40 MHz)
  8767. * Value: RSSI dB units w.r.t. noise floor
  8768. * - RSSI2_EXT40
  8769. * Bits 7:0
  8770. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8771. * (if the rx bandwidth was >= 80 MHz)
  8772. * Value: RSSI dB units w.r.t. noise floor
  8773. * - RSSI2_EXT80
  8774. * Bits 7:0
  8775. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8776. * (if the rx bandwidth was >= 160 MHz)
  8777. * Value: RSSI dB units w.r.t. noise floor
  8778. *
  8779. * - RSSI3_PRI20
  8780. * Bits 7:0
  8781. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8782. * Value: RSSI dB units w.r.t. noise floor
  8783. * - RSSI3_EXT20
  8784. * Bits 7:0
  8785. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8786. * (if the rx bandwidth was >= 40 MHz)
  8787. * Value: RSSI dB units w.r.t. noise floor
  8788. * - RSSI3_EXT40
  8789. * Bits 7:0
  8790. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8791. * (if the rx bandwidth was >= 80 MHz)
  8792. * Value: RSSI dB units w.r.t. noise floor
  8793. * - RSSI3_EXT80
  8794. * Bits 7:0
  8795. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8796. * (if the rx bandwidth was >= 160 MHz)
  8797. * Value: RSSI dB units w.r.t. noise floor
  8798. *
  8799. * - TSF32
  8800. * Bits 31:0
  8801. * Purpose: specify the time the rx PPDU was received, in TSF units
  8802. * Value: 32 LSBs of the TSF
  8803. * - TIMESTAMP_MICROSEC
  8804. * Bits 31:0
  8805. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8806. * Value: PPDU rx time, in microseconds
  8807. * - VHT_SIG_A1
  8808. * Bits 23:0
  8809. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8810. * from the rx PPDU
  8811. * Value:
  8812. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8813. * VHT-SIG-A1 data.
  8814. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8815. * first 24 bits of the HT-SIG data.
  8816. * Otherwise, this field is invalid.
  8817. * Refer to the the 802.11 protocol for the definition of the
  8818. * HT-SIG and VHT-SIG-A1 fields
  8819. * - VHT_SIG_A2
  8820. * Bits 23:0
  8821. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8822. * from the rx PPDU
  8823. * Value:
  8824. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8825. * VHT-SIG-A2 data.
  8826. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8827. * last 24 bits of the HT-SIG data.
  8828. * Otherwise, this field is invalid.
  8829. * Refer to the the 802.11 protocol for the definition of the
  8830. * HT-SIG and VHT-SIG-A2 fields
  8831. * - PREAMBLE_TYPE
  8832. * Bits 31:24
  8833. * Purpose: indicate the PHY format of the received burst
  8834. * Value:
  8835. * 0x4: Legacy (OFDM/CCK)
  8836. * 0x8: HT
  8837. * 0x9: HT with TxBF
  8838. * 0xC: VHT
  8839. * 0xD: VHT with TxBF
  8840. * - SERVICE
  8841. * Bits 31:24
  8842. * Purpose: TBD
  8843. * Value: TBD
  8844. *
  8845. * Rx MSDU descriptor fields:
  8846. * - FW_RX_DESC_BYTES
  8847. * Bits 15:0
  8848. * Purpose: Indicate how many bytes in the Rx indication are used for
  8849. * FW Rx descriptors
  8850. *
  8851. * Payload fields:
  8852. * - MPDU_COUNT
  8853. * Bits 7:0
  8854. * Purpose: Indicate how many sequential MPDUs share the same status.
  8855. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8856. * - MPDU_STATUS
  8857. * Bits 15:8
  8858. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8859. * received successfully.
  8860. * Value:
  8861. * 0x1: success
  8862. * 0x2: FCS error
  8863. * 0x3: duplicate error
  8864. * 0x4: replay error
  8865. * 0x5: invalid peer
  8866. */
  8867. /* header fields */
  8868. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8869. #define HTT_RX_IND_EXT_TID_S 8
  8870. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8871. #define HTT_RX_IND_FLUSH_VALID_S 13
  8872. #define HTT_RX_IND_REL_VALID_M 0x4000
  8873. #define HTT_RX_IND_REL_VALID_S 14
  8874. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8875. #define HTT_RX_IND_PEER_ID_S 16
  8876. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8877. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8878. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8879. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8880. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8881. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8882. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8883. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8884. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8885. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8886. /* rx PPDU descriptor fields */
  8887. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8888. #define HTT_RX_IND_RSSI_CMB_S 0
  8889. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8890. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8891. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8892. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8893. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8894. #define HTT_RX_IND_PHY_ERR_S 24
  8895. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8896. #define HTT_RX_IND_LEGACY_RATE_S 25
  8897. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8898. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8899. #define HTT_RX_IND_END_VALID_M 0x40000000
  8900. #define HTT_RX_IND_END_VALID_S 30
  8901. #define HTT_RX_IND_START_VALID_M 0x80000000
  8902. #define HTT_RX_IND_START_VALID_S 31
  8903. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8904. #define HTT_RX_IND_RSSI_PRI20_S 0
  8905. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8906. #define HTT_RX_IND_RSSI_EXT20_S 8
  8907. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8908. #define HTT_RX_IND_RSSI_EXT40_S 16
  8909. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8910. #define HTT_RX_IND_RSSI_EXT80_S 24
  8911. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8912. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8913. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8914. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8915. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8916. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8917. #define HTT_RX_IND_SERVICE_M 0xff000000
  8918. #define HTT_RX_IND_SERVICE_S 24
  8919. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8920. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8921. /* rx MSDU descriptor fields */
  8922. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8923. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8924. /* payload fields */
  8925. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8926. #define HTT_RX_IND_MPDU_COUNT_S 0
  8927. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8928. #define HTT_RX_IND_MPDU_STATUS_S 8
  8929. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8930. do { \
  8931. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8932. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8933. } while (0)
  8934. #define HTT_RX_IND_EXT_TID_GET(word) \
  8935. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8936. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8937. do { \
  8938. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8939. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8940. } while (0)
  8941. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8942. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8943. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8944. do { \
  8945. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8946. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8947. } while (0)
  8948. #define HTT_RX_IND_REL_VALID_GET(word) \
  8949. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8950. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8953. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8954. } while (0)
  8955. #define HTT_RX_IND_PEER_ID_GET(word) \
  8956. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8957. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8958. do { \
  8959. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8960. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8961. } while (0)
  8962. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8963. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8964. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8965. do { \
  8966. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8967. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8968. } while (0)
  8969. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8970. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8971. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8972. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8975. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8976. } while (0)
  8977. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8978. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8979. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8980. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8981. do { \
  8982. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8983. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8984. } while (0)
  8985. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8986. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8987. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8988. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8991. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8992. } while (0)
  8993. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8994. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8995. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8996. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8997. do { \
  8998. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8999. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9000. } while (0)
  9001. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9002. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9003. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9004. /* FW rx PPDU descriptor fields */
  9005. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9006. do { \
  9007. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9008. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9009. } while (0)
  9010. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9011. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9012. HTT_RX_IND_RSSI_CMB_S)
  9013. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9014. do { \
  9015. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9016. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9017. } while (0)
  9018. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9019. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9020. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9021. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9022. do { \
  9023. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9024. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9025. } while (0)
  9026. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9027. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9028. HTT_RX_IND_PHY_ERR_CODE_S)
  9029. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9030. do { \
  9031. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9032. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9033. } while (0)
  9034. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9035. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9036. HTT_RX_IND_PHY_ERR_S)
  9037. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9038. do { \
  9039. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9040. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9041. } while (0)
  9042. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9043. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9044. HTT_RX_IND_LEGACY_RATE_S)
  9045. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9046. do { \
  9047. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9048. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9049. } while (0)
  9050. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9051. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9052. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9053. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9054. do { \
  9055. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9056. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9057. } while (0)
  9058. #define HTT_RX_IND_END_VALID_GET(word) \
  9059. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9060. HTT_RX_IND_END_VALID_S)
  9061. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9062. do { \
  9063. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9064. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9065. } while (0)
  9066. #define HTT_RX_IND_START_VALID_GET(word) \
  9067. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9068. HTT_RX_IND_START_VALID_S)
  9069. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9070. do { \
  9071. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9072. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9073. } while (0)
  9074. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9075. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9076. HTT_RX_IND_RSSI_PRI20_S)
  9077. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9078. do { \
  9079. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9080. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9081. } while (0)
  9082. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9083. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9084. HTT_RX_IND_RSSI_EXT20_S)
  9085. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9086. do { \
  9087. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9088. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9089. } while (0)
  9090. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9091. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9092. HTT_RX_IND_RSSI_EXT40_S)
  9093. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9094. do { \
  9095. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9096. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9097. } while (0)
  9098. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9099. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9100. HTT_RX_IND_RSSI_EXT80_S)
  9101. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9102. do { \
  9103. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9104. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9105. } while (0)
  9106. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9107. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9108. HTT_RX_IND_VHT_SIG_A1_S)
  9109. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9110. do { \
  9111. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9112. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9113. } while (0)
  9114. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9115. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9116. HTT_RX_IND_VHT_SIG_A2_S)
  9117. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9118. do { \
  9119. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9120. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9121. } while (0)
  9122. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9123. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9124. HTT_RX_IND_PREAMBLE_TYPE_S)
  9125. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9126. do { \
  9127. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9128. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9129. } while (0)
  9130. #define HTT_RX_IND_SERVICE_GET(word) \
  9131. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9132. HTT_RX_IND_SERVICE_S)
  9133. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9134. do { \
  9135. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9136. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9137. } while (0)
  9138. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9139. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9140. HTT_RX_IND_SA_ANT_MATRIX_S)
  9141. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9142. do { \
  9143. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9144. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9145. } while (0)
  9146. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9147. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9148. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9149. do { \
  9150. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9151. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9152. } while (0)
  9153. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9154. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9155. #define HTT_RX_IND_HL_BYTES \
  9156. (HTT_RX_IND_HDR_BYTES + \
  9157. 4 /* single FW rx MSDU descriptor */ + \
  9158. 4 /* single MPDU range information element */)
  9159. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9160. /* Could we use one macro entry? */
  9161. #define HTT_WORD_SET(word, field, value) \
  9162. do { \
  9163. HTT_CHECK_SET_VAL(field, value); \
  9164. (word) |= ((value) << field ## _S); \
  9165. } while (0)
  9166. #define HTT_WORD_GET(word, field) \
  9167. (((word) & field ## _M) >> field ## _S)
  9168. PREPACK struct hl_htt_rx_ind_base {
  9169. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9170. } POSTPACK;
  9171. /*
  9172. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9173. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9174. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9175. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9176. * htt_rx_ind_hl_rx_desc_t.
  9177. */
  9178. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9179. struct htt_rx_ind_hl_rx_desc_t {
  9180. A_UINT8 ver;
  9181. A_UINT8 len;
  9182. struct {
  9183. A_UINT8
  9184. first_msdu: 1,
  9185. last_msdu: 1,
  9186. c3_failed: 1,
  9187. c4_failed: 1,
  9188. ipv6: 1,
  9189. tcp: 1,
  9190. udp: 1,
  9191. reserved: 1;
  9192. } flags;
  9193. /* NOTE: no reserved space - don't append any new fields here */
  9194. };
  9195. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9196. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9197. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9198. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9199. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9200. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9201. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9202. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9203. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9204. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9205. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9206. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9207. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9208. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9209. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9210. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9211. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9212. /* This structure is used in HL, the basic descriptor information
  9213. * used by host. the structure is translated by FW from HW desc
  9214. * or generated by FW. But in HL monitor mode, the host would use
  9215. * the same structure with LL.
  9216. */
  9217. PREPACK struct hl_htt_rx_desc_base {
  9218. A_UINT32
  9219. seq_num:12,
  9220. encrypted:1,
  9221. chan_info_present:1,
  9222. resv0:2,
  9223. mcast_bcast:1,
  9224. fragment:1,
  9225. key_id_oct:8,
  9226. resv1:6;
  9227. A_UINT32
  9228. pn_31_0;
  9229. union {
  9230. struct {
  9231. A_UINT16 pn_47_32;
  9232. A_UINT16 pn_63_48;
  9233. } pn16;
  9234. A_UINT32 pn_63_32;
  9235. } u0;
  9236. A_UINT32
  9237. pn_95_64;
  9238. A_UINT32
  9239. pn_127_96;
  9240. } POSTPACK;
  9241. /*
  9242. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9243. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9244. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9245. * Please see htt_chan_change_t for description of the fields.
  9246. */
  9247. PREPACK struct htt_chan_info_t
  9248. {
  9249. A_UINT32 primary_chan_center_freq_mhz: 16,
  9250. contig_chan1_center_freq_mhz: 16;
  9251. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9252. phy_mode: 8,
  9253. reserved: 8;
  9254. } POSTPACK;
  9255. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9256. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9257. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9258. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9259. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9260. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9261. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9262. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9263. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9264. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9265. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9266. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9267. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9268. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9269. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9270. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9271. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9272. /* Channel information */
  9273. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9274. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9275. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9276. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9277. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9278. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9279. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9280. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9281. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9282. do { \
  9283. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9284. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9285. } while (0)
  9286. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9287. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9288. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9289. do { \
  9290. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9291. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9292. } while (0)
  9293. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9294. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9295. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9296. do { \
  9297. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9298. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9299. } while (0)
  9300. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9301. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9302. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9303. do { \
  9304. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9305. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9306. } while (0)
  9307. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9308. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9309. /*
  9310. * @brief target -> host message definition for FW offloaded pkts
  9311. *
  9312. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9313. *
  9314. * @details
  9315. * The following field definitions describe the format of the firmware
  9316. * offload deliver message sent from the target to the host.
  9317. *
  9318. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9319. *
  9320. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9321. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9322. * | reserved_1 | msg type |
  9323. * |--------------------------------------------------------------------------|
  9324. * | phy_timestamp_l32 |
  9325. * |--------------------------------------------------------------------------|
  9326. * | WORD2 (see below) |
  9327. * |--------------------------------------------------------------------------|
  9328. * | seqno | framectrl |
  9329. * |--------------------------------------------------------------------------|
  9330. * | reserved_3 | vdev_id | tid_num|
  9331. * |--------------------------------------------------------------------------|
  9332. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9333. * |--------------------------------------------------------------------------|
  9334. *
  9335. * where:
  9336. * STAT = status
  9337. * F = format (802.3 vs. 802.11)
  9338. *
  9339. * definition for word 2
  9340. *
  9341. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9342. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9343. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9344. * |--------------------------------------------------------------------------|
  9345. *
  9346. * where:
  9347. * PR = preamble
  9348. * BF = beamformed
  9349. */
  9350. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9351. {
  9352. A_UINT32 /* word 0 */
  9353. msg_type:8, /* [ 7: 0] */
  9354. reserved_1:24; /* [31: 8] */
  9355. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9356. A_UINT32 /* word 2 */
  9357. /* preamble:
  9358. * 0-OFDM,
  9359. * 1-CCk,
  9360. * 2-HT,
  9361. * 3-VHT
  9362. */
  9363. preamble: 2, /* [1:0] */
  9364. /* mcs:
  9365. * In case of HT preamble interpret
  9366. * MCS along with NSS.
  9367. * Valid values for HT are 0 to 7.
  9368. * HT mcs 0 with NSS 2 is mcs 8.
  9369. * Valid values for VHT are 0 to 9.
  9370. */
  9371. mcs: 4, /* [5:2] */
  9372. /* rate:
  9373. * This is applicable only for
  9374. * CCK and OFDM preamble type
  9375. * rate 0: OFDM 48 Mbps,
  9376. * 1: OFDM 24 Mbps,
  9377. * 2: OFDM 12 Mbps
  9378. * 3: OFDM 6 Mbps
  9379. * 4: OFDM 54 Mbps
  9380. * 5: OFDM 36 Mbps
  9381. * 6: OFDM 18 Mbps
  9382. * 7: OFDM 9 Mbps
  9383. * rate 0: CCK 11 Mbps Long
  9384. * 1: CCK 5.5 Mbps Long
  9385. * 2: CCK 2 Mbps Long
  9386. * 3: CCK 1 Mbps Long
  9387. * 4: CCK 11 Mbps Short
  9388. * 5: CCK 5.5 Mbps Short
  9389. * 6: CCK 2 Mbps Short
  9390. */
  9391. rate : 3, /* [ 8: 6] */
  9392. rssi : 8, /* [16: 9] units=dBm */
  9393. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9394. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9395. stbc : 1, /* [22] */
  9396. sgi : 1, /* [23] */
  9397. ldpc : 1, /* [24] */
  9398. beamformed: 1, /* [25] */
  9399. reserved_2: 6; /* [31:26] */
  9400. A_UINT32 /* word 3 */
  9401. framectrl:16, /* [15: 0] */
  9402. seqno:16; /* [31:16] */
  9403. A_UINT32 /* word 4 */
  9404. tid_num:5, /* [ 4: 0] actual TID number */
  9405. vdev_id:8, /* [12: 5] */
  9406. reserved_3:19; /* [31:13] */
  9407. A_UINT32 /* word 5 */
  9408. /* status:
  9409. * 0: tx_ok
  9410. * 1: retry
  9411. * 2: drop
  9412. * 3: filtered
  9413. * 4: abort
  9414. * 5: tid delete
  9415. * 6: sw abort
  9416. * 7: dropped by peer migration
  9417. */
  9418. status:3, /* [2:0] */
  9419. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9420. tx_mpdu_bytes:16, /* [19:4] */
  9421. /* Indicates retry count of offloaded/local generated Data tx frames */
  9422. tx_retry_cnt:6, /* [25:20] */
  9423. reserved_4:6; /* [31:26] */
  9424. } POSTPACK;
  9425. /* FW offload deliver ind message header fields */
  9426. /* DWORD one */
  9427. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9428. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9429. /* DWORD two */
  9430. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9431. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9432. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9433. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9434. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9435. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9436. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9437. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9438. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9439. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9440. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9441. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9442. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9443. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9444. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9445. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9446. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9447. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9448. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9449. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9450. /* DWORD three*/
  9451. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9452. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9453. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9454. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9455. /* DWORD four */
  9456. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9457. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9458. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9459. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9460. /* DWORD five */
  9461. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9462. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9463. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9464. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9465. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9466. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9467. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9468. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9469. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9470. do { \
  9471. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9472. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9473. } while (0)
  9474. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9475. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9476. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9477. do { \
  9478. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9479. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9480. } while (0)
  9481. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9482. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9483. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9484. do { \
  9485. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9486. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9487. } while (0)
  9488. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9489. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9490. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9491. do { \
  9492. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9493. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9494. } while (0)
  9495. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9496. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9497. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9498. do { \
  9499. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9500. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9501. } while (0)
  9502. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9503. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9504. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9505. do { \
  9506. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9507. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9508. } while (0)
  9509. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9510. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9511. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9512. do { \
  9513. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9514. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9515. } while (0)
  9516. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9517. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9518. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9519. do { \
  9520. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9521. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9522. } while (0)
  9523. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9524. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9525. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9526. do { \
  9527. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9528. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9529. } while (0)
  9530. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9531. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9532. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9533. do { \
  9534. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9535. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9536. } while (0)
  9537. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9538. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9539. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9540. do { \
  9541. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9542. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9543. } while (0)
  9544. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9545. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9546. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9547. do { \
  9548. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9549. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9550. } while (0)
  9551. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9552. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9553. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9554. do { \
  9555. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9556. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9557. } while (0)
  9558. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9559. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9560. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9561. do { \
  9562. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9563. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9564. } while (0)
  9565. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9566. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9567. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9568. do { \
  9569. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9570. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9571. } while (0)
  9572. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9573. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9574. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9575. do { \
  9576. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9577. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9578. } while (0)
  9579. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9580. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9581. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9582. do { \
  9583. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9584. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9585. } while (0)
  9586. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9587. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9588. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9589. do { \
  9590. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9591. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9592. } while (0)
  9593. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9594. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9595. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9596. do { \
  9597. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9598. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9599. } while (0)
  9600. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9601. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9602. /*
  9603. * @brief target -> host rx reorder flush message definition
  9604. *
  9605. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9606. *
  9607. * @details
  9608. * The following field definitions describe the format of the rx flush
  9609. * message sent from the target to the host.
  9610. * The message consists of a 4-octet header, followed by one or more
  9611. * 4-octet payload information elements.
  9612. *
  9613. * |31 24|23 8|7 0|
  9614. * |--------------------------------------------------------------|
  9615. * | TID | peer ID | msg type |
  9616. * |--------------------------------------------------------------|
  9617. * | seq num end | seq num start | MPDU status | reserved |
  9618. * |--------------------------------------------------------------|
  9619. * First DWORD:
  9620. * - MSG_TYPE
  9621. * Bits 7:0
  9622. * Purpose: identifies this as an rx flush message
  9623. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9624. * - PEER_ID
  9625. * Bits 23:8 (only bits 18:8 actually used)
  9626. * Purpose: identify which peer's rx data is being flushed
  9627. * Value: (rx) peer ID
  9628. * - TID
  9629. * Bits 31:24 (only bits 27:24 actually used)
  9630. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9631. * Value: traffic identifier
  9632. * Second DWORD:
  9633. * - MPDU_STATUS
  9634. * Bits 15:8
  9635. * Purpose:
  9636. * Indicate whether the flushed MPDUs should be discarded or processed.
  9637. * Value:
  9638. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9639. * stages of rx processing
  9640. * other: discard the MPDUs
  9641. * It is anticipated that flush messages will always have
  9642. * MPDU status == 1, but the status flag is included for
  9643. * flexibility.
  9644. * - SEQ_NUM_START
  9645. * Bits 23:16
  9646. * Purpose:
  9647. * Indicate the start of a series of consecutive MPDUs being flushed.
  9648. * Not all MPDUs within this range are necessarily valid - the host
  9649. * must check each sequence number within this range to see if the
  9650. * corresponding MPDU is actually present.
  9651. * Value:
  9652. * The sequence number for the first MPDU in the sequence.
  9653. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9654. * - SEQ_NUM_END
  9655. * Bits 30:24
  9656. * Purpose:
  9657. * Indicate the end of a series of consecutive MPDUs being flushed.
  9658. * Value:
  9659. * The sequence number one larger than the sequence number of the
  9660. * last MPDU being flushed.
  9661. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9662. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9663. * are to be released for further rx processing.
  9664. * Not all MPDUs within this range are necessarily valid - the host
  9665. * must check each sequence number within this range to see if the
  9666. * corresponding MPDU is actually present.
  9667. */
  9668. /* first DWORD */
  9669. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9670. #define HTT_RX_FLUSH_PEER_ID_S 8
  9671. #define HTT_RX_FLUSH_TID_M 0xff000000
  9672. #define HTT_RX_FLUSH_TID_S 24
  9673. /* second DWORD */
  9674. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9675. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9676. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9677. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9678. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9679. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9680. #define HTT_RX_FLUSH_BYTES 8
  9681. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9682. do { \
  9683. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9684. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9685. } while (0)
  9686. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9687. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9688. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9689. do { \
  9690. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9691. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9692. } while (0)
  9693. #define HTT_RX_FLUSH_TID_GET(word) \
  9694. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9695. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9696. do { \
  9697. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9698. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9699. } while (0)
  9700. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9701. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9702. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9703. do { \
  9704. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9705. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9706. } while (0)
  9707. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9708. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9709. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9710. do { \
  9711. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9712. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9713. } while (0)
  9714. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9715. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9716. /*
  9717. * @brief target -> host rx pn check indication message
  9718. *
  9719. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9720. *
  9721. * @details
  9722. * The following field definitions describe the format of the Rx PN check
  9723. * indication message sent from the target to the host.
  9724. * The message consists of a 4-octet header, followed by the start and
  9725. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9726. * IE is one octet containing the sequence number that failed the PN
  9727. * check.
  9728. *
  9729. * |31 24|23 8|7 0|
  9730. * |--------------------------------------------------------------|
  9731. * | TID | peer ID | msg type |
  9732. * |--------------------------------------------------------------|
  9733. * | Reserved | PN IE count | seq num end | seq num start|
  9734. * |--------------------------------------------------------------|
  9735. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9736. * |--------------------------------------------------------------|
  9737. * First DWORD:
  9738. * - MSG_TYPE
  9739. * Bits 7:0
  9740. * Purpose: Identifies this as an rx pn check indication message
  9741. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9742. * - PEER_ID
  9743. * Bits 23:8 (only bits 18:8 actually used)
  9744. * Purpose: identify which peer
  9745. * Value: (rx) peer ID
  9746. * - TID
  9747. * Bits 31:24 (only bits 27:24 actually used)
  9748. * Purpose: identify traffic identifier
  9749. * Value: traffic identifier
  9750. * Second DWORD:
  9751. * - SEQ_NUM_START
  9752. * Bits 7:0
  9753. * Purpose:
  9754. * Indicates the starting sequence number of the MPDU in this
  9755. * series of MPDUs that went though PN check.
  9756. * Value:
  9757. * The sequence number for the first MPDU in the sequence.
  9758. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9759. * - SEQ_NUM_END
  9760. * Bits 15:8
  9761. * Purpose:
  9762. * Indicates the ending sequence number of the MPDU in this
  9763. * series of MPDUs that went though PN check.
  9764. * Value:
  9765. * The sequence number one larger then the sequence number of the last
  9766. * MPDU being flushed.
  9767. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9768. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9769. * for invalid PN numbers and are ready to be released for further processing.
  9770. * Not all MPDUs within this range are necessarily valid - the host
  9771. * must check each sequence number within this range to see if the
  9772. * corresponding MPDU is actually present.
  9773. * - PN_IE_COUNT
  9774. * Bits 23:16
  9775. * Purpose:
  9776. * Used to determine the variable number of PN information elements in this
  9777. * message
  9778. *
  9779. * PN information elements:
  9780. * - PN_IE_x-
  9781. * Purpose:
  9782. * Each PN information element contains the sequence number of the MPDU that
  9783. * has failed the target PN check.
  9784. * Value:
  9785. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9786. * that failed the PN check.
  9787. */
  9788. /* first DWORD */
  9789. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9790. #define HTT_RX_PN_IND_PEER_ID_S 8
  9791. #define HTT_RX_PN_IND_TID_M 0xff000000
  9792. #define HTT_RX_PN_IND_TID_S 24
  9793. /* second DWORD */
  9794. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9795. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9796. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9797. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9798. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9799. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9800. #define HTT_RX_PN_IND_BYTES 8
  9801. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9802. do { \
  9803. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9804. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9805. } while (0)
  9806. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9807. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9808. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9809. do { \
  9810. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9811. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9812. } while (0)
  9813. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9814. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9815. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9816. do { \
  9817. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9818. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9819. } while (0)
  9820. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9821. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9822. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9823. do { \
  9824. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9825. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9826. } while (0)
  9827. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9828. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9829. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9830. do { \
  9831. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9832. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9833. } while (0)
  9834. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9835. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9836. /*
  9837. * @brief target -> host rx offload deliver message for LL system
  9838. *
  9839. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9840. *
  9841. * @details
  9842. * In a low latency system this message is sent whenever the offload
  9843. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9844. * The DMA of the actual packets into host memory is done before sending out
  9845. * this message. This message indicates only how many MSDUs to reap. The
  9846. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9847. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9848. * DMA'd by the MAC directly into host memory these packets do not contain
  9849. * the MAC descriptors in the header portion of the packet. Instead they contain
  9850. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9851. * message, the packets are delivered directly to the NW stack without going
  9852. * through the regular reorder buffering and PN checking path since it has
  9853. * already been done in target.
  9854. *
  9855. * |31 24|23 16|15 8|7 0|
  9856. * |-----------------------------------------------------------------------|
  9857. * | Total MSDU count | reserved | msg type |
  9858. * |-----------------------------------------------------------------------|
  9859. *
  9860. * @brief target -> host rx offload deliver message for HL system
  9861. *
  9862. * @details
  9863. * In a high latency system this message is sent whenever the offload manager
  9864. * flushes out the packets it has coalesced in its coalescing buffer. The
  9865. * actual packets are also carried along with this message. When the host
  9866. * receives this message, it is expected to deliver these packets to the NW
  9867. * stack directly instead of routing them through the reorder buffering and
  9868. * PN checking path since it has already been done in target.
  9869. *
  9870. * |31 24|23 16|15 8|7 0|
  9871. * |-----------------------------------------------------------------------|
  9872. * | Total MSDU count | reserved | msg type |
  9873. * |-----------------------------------------------------------------------|
  9874. * | peer ID | MSDU length |
  9875. * |-----------------------------------------------------------------------|
  9876. * | MSDU payload | FW Desc | tid | vdev ID |
  9877. * |-----------------------------------------------------------------------|
  9878. * | MSDU payload contd. |
  9879. * |-----------------------------------------------------------------------|
  9880. * | peer ID | MSDU length |
  9881. * |-----------------------------------------------------------------------|
  9882. * | MSDU payload | FW Desc | tid | vdev ID |
  9883. * |-----------------------------------------------------------------------|
  9884. * | MSDU payload contd. |
  9885. * |-----------------------------------------------------------------------|
  9886. *
  9887. */
  9888. /* first DWORD */
  9889. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9890. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9891. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9892. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9893. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9894. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9896. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9897. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9898. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9899. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9900. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9901. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9902. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9903. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9904. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9905. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9906. do { \
  9907. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9908. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9909. } while (0)
  9910. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9911. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9912. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9913. do { \
  9914. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9915. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9916. } while (0)
  9917. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9918. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9919. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9920. do { \
  9921. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9922. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9923. } while (0)
  9924. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9925. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9926. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9927. do { \
  9928. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9929. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9930. } while (0)
  9931. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9932. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9933. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9934. do { \
  9935. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9936. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9937. } while (0)
  9938. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9939. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9940. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9941. do { \
  9942. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9943. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9944. } while (0)
  9945. /**
  9946. * @brief target -> host rx peer map/unmap message definition
  9947. *
  9948. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9949. *
  9950. * @details
  9951. * The following diagram shows the format of the rx peer map message sent
  9952. * from the target to the host. This layout assumes the target operates
  9953. * as little-endian.
  9954. *
  9955. * This message always contains a SW peer ID. The main purpose of the
  9956. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9957. * with, so that the host can use that peer ID to determine which peer
  9958. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9959. * other purposes, such as identifying during tx completions which peer
  9960. * the tx frames in question were transmitted to.
  9961. *
  9962. * In certain generations of chips, the peer map message also contains
  9963. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9964. * to identify which peer the frame needs to be forwarded to (i.e. the
  9965. * peer assocated with the Destination MAC Address within the packet),
  9966. * and particularly which vdev needs to transmit the frame (for cases
  9967. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9968. * meaning as AST_INDEX_0.
  9969. * This DA-based peer ID that is provided for certain rx frames
  9970. * (the rx frames that need to be re-transmitted as tx frames)
  9971. * is the ID that the HW uses for referring to the peer in question,
  9972. * rather than the peer ID that the SW+FW use to refer to the peer.
  9973. *
  9974. *
  9975. * |31 24|23 16|15 8|7 0|
  9976. * |-----------------------------------------------------------------------|
  9977. * | SW peer ID | VDEV ID | msg type |
  9978. * |-----------------------------------------------------------------------|
  9979. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9980. * |-----------------------------------------------------------------------|
  9981. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9982. * |-----------------------------------------------------------------------|
  9983. *
  9984. *
  9985. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9986. *
  9987. * The following diagram shows the format of the rx peer unmap message sent
  9988. * from the target to the host.
  9989. *
  9990. * |31 24|23 16|15 8|7 0|
  9991. * |-----------------------------------------------------------------------|
  9992. * | SW peer ID | VDEV ID | msg type |
  9993. * |-----------------------------------------------------------------------|
  9994. *
  9995. * The following field definitions describe the format of the rx peer map
  9996. * and peer unmap messages sent from the target to the host.
  9997. * - MSG_TYPE
  9998. * Bits 7:0
  9999. * Purpose: identifies this as an rx peer map or peer unmap message
  10000. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10001. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10002. * - VDEV_ID
  10003. * Bits 15:8
  10004. * Purpose: Indicates which virtual device the peer is associated
  10005. * with.
  10006. * Value: vdev ID (used in the host to look up the vdev object)
  10007. * - PEER_ID (a.k.a. SW_PEER_ID)
  10008. * Bits 31:16
  10009. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10010. * freeing (unmap)
  10011. * Value: (rx) peer ID
  10012. * - MAC_ADDR_L32 (peer map only)
  10013. * Bits 31:0
  10014. * Purpose: Identifies which peer node the peer ID is for.
  10015. * Value: lower 4 bytes of peer node's MAC address
  10016. * - MAC_ADDR_U16 (peer map only)
  10017. * Bits 15:0
  10018. * Purpose: Identifies which peer node the peer ID is for.
  10019. * Value: upper 2 bytes of peer node's MAC address
  10020. * - HW_PEER_ID
  10021. * Bits 31:16
  10022. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10023. * address, so for rx frames marked for rx --> tx forwarding, the
  10024. * host can determine from the HW peer ID provided as meta-data with
  10025. * the rx frame which peer the frame is supposed to be forwarded to.
  10026. * Value: ID used by the MAC HW to identify the peer
  10027. */
  10028. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10029. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10030. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10031. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10032. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10033. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10034. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10035. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10036. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10037. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10038. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10039. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10040. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10041. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10042. do { \
  10043. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10044. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10045. } while (0)
  10046. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10047. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10048. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10049. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10052. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10053. } while (0)
  10054. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10055. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10056. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10057. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10058. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10059. do { \
  10060. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10061. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10062. } while (0)
  10063. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10064. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10065. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10066. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10067. #define HTT_RX_PEER_MAP_BYTES 12
  10068. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10069. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10070. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10071. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10072. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10073. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10074. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10075. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10076. #define HTT_RX_PEER_UNMAP_BYTES 4
  10077. /**
  10078. * @brief target -> host rx peer map V2 message definition
  10079. *
  10080. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10081. *
  10082. * @details
  10083. * The following diagram shows the format of the rx peer map v2 message sent
  10084. * from the target to the host. This layout assumes the target operates
  10085. * as little-endian.
  10086. *
  10087. * This message always contains a SW peer ID. The main purpose of the
  10088. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10089. * with, so that the host can use that peer ID to determine which peer
  10090. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10091. * other purposes, such as identifying during tx completions which peer
  10092. * the tx frames in question were transmitted to.
  10093. *
  10094. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10095. * is used during rx --> tx frame forwarding to identify which peer the
  10096. * frame needs to be forwarded to (i.e. the peer assocated with the
  10097. * Destination MAC Address within the packet), and particularly which vdev
  10098. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10099. * This DA-based peer ID that is provided for certain rx frames
  10100. * (the rx frames that need to be re-transmitted as tx frames)
  10101. * is the ID that the HW uses for referring to the peer in question,
  10102. * rather than the peer ID that the SW+FW use to refer to the peer.
  10103. *
  10104. * The HW peer id here is the same meaning as AST_INDEX_0.
  10105. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10106. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10107. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10108. * AST is valid.
  10109. *
  10110. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10111. * |-------------------------------------------------------------------------|
  10112. * | SW peer ID | VDEV ID | msg type |
  10113. * |-------------------------------------------------------------------------|
  10114. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10115. * |-------------------------------------------------------------------------|
  10116. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10117. * |-------------------------------------------------------------------------|
  10118. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10119. * |-------------------------------------------------------------------------|
  10120. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10121. * |-------------------------------------------------------------------------|
  10122. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10123. * |-------------------------------------------------------------------------|
  10124. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10125. * |-------------------------------------------------------------------------|
  10126. * | Reserved_2 |
  10127. * |-------------------------------------------------------------------------|
  10128. * Where:
  10129. * NH = Next Hop
  10130. * ASTVM = AST valid mask
  10131. * OA = on-chip AST valid bit
  10132. * ASTFM = AST flow mask
  10133. *
  10134. * The following field definitions describe the format of the rx peer map v2
  10135. * messages sent from the target to the host.
  10136. * - MSG_TYPE
  10137. * Bits 7:0
  10138. * Purpose: identifies this as an rx peer map v2 message
  10139. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10140. * - VDEV_ID
  10141. * Bits 15:8
  10142. * Purpose: Indicates which virtual device the peer is associated with.
  10143. * Value: vdev ID (used in the host to look up the vdev object)
  10144. * - SW_PEER_ID
  10145. * Bits 31:16
  10146. * Purpose: The peer ID (index) that WAL is allocating
  10147. * Value: (rx) peer ID
  10148. * - MAC_ADDR_L32
  10149. * Bits 31:0
  10150. * Purpose: Identifies which peer node the peer ID is for.
  10151. * Value: lower 4 bytes of peer node's MAC address
  10152. * - MAC_ADDR_U16
  10153. * Bits 15:0
  10154. * Purpose: Identifies which peer node the peer ID is for.
  10155. * Value: upper 2 bytes of peer node's MAC address
  10156. * - HW_PEER_ID / AST_INDEX_0
  10157. * Bits 31:16
  10158. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10159. * address, so for rx frames marked for rx --> tx forwarding, the
  10160. * host can determine from the HW peer ID provided as meta-data with
  10161. * the rx frame which peer the frame is supposed to be forwarded to.
  10162. * Value: ID used by the MAC HW to identify the peer
  10163. * - AST_HASH_VALUE
  10164. * Bits 15:0
  10165. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10166. * override feature.
  10167. * - NEXT_HOP
  10168. * Bit 16
  10169. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10170. * (Wireless Distribution System).
  10171. * - AST_VALID_MASK
  10172. * Bits 19:17
  10173. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10174. * - ONCHIP_AST_VALID_FLAG
  10175. * Bit 20
  10176. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10177. * is valid.
  10178. * - AST_INDEX_1
  10179. * Bits 15:0
  10180. * Purpose: indicate the second AST index for this peer
  10181. * - AST_0_FLOW_MASK
  10182. * Bits 19:16
  10183. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10184. * - AST_1_FLOW_MASK
  10185. * Bits 23:20
  10186. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10187. * - AST_2_FLOW_MASK
  10188. * Bits 27:24
  10189. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10190. * - AST_3_FLOW_MASK
  10191. * Bits 31:28
  10192. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10193. * - AST_INDEX_2
  10194. * Bits 15:0
  10195. * Purpose: indicate the third AST index for this peer
  10196. * - TID_VALID_HI_PRI
  10197. * Bits 23:16
  10198. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10199. * - TID_VALID_LOW_PRI
  10200. * Bits 31:24
  10201. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10202. * - AST_INDEX_3
  10203. * Bits 15:0
  10204. * Purpose: indicate the fourth AST index for this peer
  10205. * - ONCHIP_AST_IDX / RESERVED
  10206. * Bits 31:16
  10207. * Purpose: This field is valid only when split AST feature is enabled.
  10208. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10209. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10210. * address, this ast_idx is used for LMAC modules for RXPCU.
  10211. * Value: ID used by the LMAC HW to identify the peer
  10212. */
  10213. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10214. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10215. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10216. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10217. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10218. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10219. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10220. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10221. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10222. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10223. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10224. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10225. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10226. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10227. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10228. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10229. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10230. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10231. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10232. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10233. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10234. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10235. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10236. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10237. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10238. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10239. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10240. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10241. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10242. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10243. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10244. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10245. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10246. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10247. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10248. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10249. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10250. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10251. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10252. do { \
  10253. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10254. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10255. } while (0)
  10256. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10257. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10258. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10259. do { \
  10260. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10261. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10262. } while (0)
  10263. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10264. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10265. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10266. do { \
  10267. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10268. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10269. } while (0)
  10270. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10271. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10272. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10273. do { \
  10274. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10275. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10276. } while (0)
  10277. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10278. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10279. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10280. do { \
  10281. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10282. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10283. } while (0)
  10284. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10285. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10286. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10287. do { \
  10288. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10289. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10290. } while (0)
  10291. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10292. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10293. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10294. do { \
  10295. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10296. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10297. } while (0)
  10298. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10299. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10300. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10301. do { \
  10302. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10303. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10304. } while (0)
  10305. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10306. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10307. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10308. do { \
  10309. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10310. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10311. } while (0)
  10312. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10313. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10314. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10315. do { \
  10316. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10317. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10318. } while (0)
  10319. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10320. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10321. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10322. do { \
  10323. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10324. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10325. } while (0)
  10326. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10327. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10328. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10329. do { \
  10330. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10331. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10332. } while (0)
  10333. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10334. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10335. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10336. do { \
  10337. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10338. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10339. } while (0)
  10340. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10341. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10342. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10343. do { \
  10344. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10345. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10346. } while (0)
  10347. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10348. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10349. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10350. do { \
  10351. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10352. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10353. } while (0)
  10354. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10355. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10356. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10357. do { \
  10358. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10359. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10360. } while (0)
  10361. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10362. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10363. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10366. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10367. } while (0)
  10368. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10369. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10370. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10371. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10372. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10373. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10374. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10375. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10376. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10377. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10378. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10379. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10380. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10381. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10382. /**
  10383. * @brief target -> host rx peer map V3 message definition
  10384. *
  10385. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10386. *
  10387. * @details
  10388. * The following diagram shows the format of the rx peer map v3 message sent
  10389. * from the target to the host.
  10390. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10391. * This layout assumes the target operates as little-endian.
  10392. *
  10393. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10394. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10395. * | SW peer ID | VDEV ID | msg type |
  10396. * |-----------------+--------------------+-----------------+-----------------|
  10397. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10398. * |-----------------+--------------------+-----------------+-----------------|
  10399. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10400. * |-----------------+--------+-----------+-----------------+-----------------|
  10401. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10402. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10403. * | (8bits) | | (4bits) | |
  10404. * |-----------------+--------+--+--+--+--------------------------------------|
  10405. * | RESERVED |E |O | | |
  10406. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10407. * | |V |V | | |
  10408. * |-----------------+--------------------+-----------------------------------|
  10409. * | HTT_MSDU_IDX_ | RESERVED | |
  10410. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10411. * | (8bits) | | |
  10412. * |-----------------+--------------------+-----------------------------------|
  10413. * | Reserved_2 |
  10414. * |--------------------------------------------------------------------------|
  10415. * | Reserved_3 |
  10416. * |--------------------------------------------------------------------------|
  10417. *
  10418. * Where:
  10419. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10420. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10421. * NH = Next Hop
  10422. * The following field definitions describe the format of the rx peer map v3
  10423. * messages sent from the target to the host.
  10424. * - MSG_TYPE
  10425. * Bits 7:0
  10426. * Purpose: identifies this as a peer map v3 message
  10427. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10428. * - VDEV_ID
  10429. * Bits 15:8
  10430. * Purpose: Indicates which virtual device the peer is associated with.
  10431. * - SW_PEER_ID
  10432. * Bits 31:16
  10433. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10434. * - MAC_ADDR_L32
  10435. * Bits 31:0
  10436. * Purpose: Identifies which peer node the peer ID is for.
  10437. * Value: lower 4 bytes of peer node's MAC address
  10438. * - MAC_ADDR_U16
  10439. * Bits 15:0
  10440. * Purpose: Identifies which peer node the peer ID is for.
  10441. * Value: upper 2 bytes of peer node's MAC address
  10442. * - MULTICAST_SW_PEER_ID
  10443. * Bits 31:16
  10444. * Purpose: The multicast peer ID (index)
  10445. * Value: set to HTT_INVALID_PEER if not valid
  10446. * - HW_PEER_ID / AST_INDEX
  10447. * Bits 15:0
  10448. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10449. * address, so for rx frames marked for rx --> tx forwarding, the
  10450. * host can determine from the HW peer ID provided as meta-data with
  10451. * the rx frame which peer the frame is supposed to be forwarded to.
  10452. * - CACHE_SET_NUM
  10453. * Bits 19:16
  10454. * Purpose: Cache Set Number for AST_INDEX
  10455. * Cache set number that should be used to cache the index based
  10456. * search results, for address and flow search.
  10457. * This value should be equal to LSB 4 bits of the hash value
  10458. * of match data, in case of search index points to an entry which
  10459. * may be used in content based search also. The value can be
  10460. * anything when the entry pointed by search index will not be
  10461. * used for content based search.
  10462. * - HTT_MSDU_IDX_VALID_MASK
  10463. * Bits 31:24
  10464. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10465. * - ONCHIP_AST_IDX / RESERVED
  10466. * Bits 15:0
  10467. * Purpose: This field is valid only when split AST feature is enabled.
  10468. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10469. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10470. * address, this ast_idx is used for LMAC modules for RXPCU.
  10471. * - NEXT_HOP
  10472. * Bits 16
  10473. * Purpose: Flag indicates next_hop AST entry used for WDS
  10474. * (Wireless Distribution System).
  10475. * - ONCHIP_AST_VALID
  10476. * Bits 17
  10477. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10478. * - EXT_AST_VALID
  10479. * Bits 18
  10480. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10481. * - EXT_AST_INDEX
  10482. * Bits 15:0
  10483. * Purpose: This field describes Extended AST index
  10484. * Valid if EXT_AST_VALID flag set
  10485. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10486. * Bits 31:24
  10487. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10488. */
  10489. /* dword 0 */
  10490. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10491. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10492. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10493. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10494. /* dword 1 */
  10495. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10496. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10497. /* dword 2 */
  10498. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10499. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10500. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10501. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10502. /* dword 3 */
  10503. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10504. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10505. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10506. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10507. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10508. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10509. /* dword 4 */
  10510. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10511. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10512. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10513. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10514. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10515. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10516. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10517. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10518. /* dword 5 */
  10519. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10520. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10521. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10522. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10523. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10524. do { \
  10525. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10526. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10527. } while (0)
  10528. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10529. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10530. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10533. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10534. } while (0)
  10535. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10536. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10537. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10538. do { \
  10539. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10540. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10541. } while (0)
  10542. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10543. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10544. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10545. do { \
  10546. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10547. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10548. } while (0)
  10549. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10550. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10551. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10552. do { \
  10553. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10554. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10555. } while (0)
  10556. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10557. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10558. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10559. do { \
  10560. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10561. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10562. } while (0)
  10563. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10564. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10565. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10566. do { \
  10567. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10568. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10569. } while (0)
  10570. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10571. (((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)
  10572. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10573. do { \
  10574. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10575. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10576. } while (0)
  10577. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10578. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10579. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10580. do { \
  10581. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10582. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10583. } while (0)
  10584. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10585. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10586. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10589. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10590. } while (0)
  10591. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10592. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10593. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10596. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10597. } while (0)
  10598. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10599. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10600. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10601. do { \
  10602. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10603. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10604. } while (0)
  10605. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10606. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10607. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10608. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10609. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10610. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10611. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10612. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10613. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10614. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10615. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10616. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10617. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10618. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10619. /**
  10620. * @brief target -> host rx peer unmap V2 message definition
  10621. *
  10622. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10623. *
  10624. * The following diagram shows the format of the rx peer unmap message sent
  10625. * from the target to the host.
  10626. *
  10627. * |31 24|23 16|15 8|7 0|
  10628. * |-----------------------------------------------------------------------|
  10629. * | SW peer ID | VDEV ID | msg type |
  10630. * |-----------------------------------------------------------------------|
  10631. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10632. * |-----------------------------------------------------------------------|
  10633. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10634. * |-----------------------------------------------------------------------|
  10635. * | Peer Delete Duration |
  10636. * |-----------------------------------------------------------------------|
  10637. * | Reserved_0 | WDS Free Count |
  10638. * |-----------------------------------------------------------------------|
  10639. * | Reserved_1 |
  10640. * |-----------------------------------------------------------------------|
  10641. * | Reserved_2 |
  10642. * |-----------------------------------------------------------------------|
  10643. *
  10644. *
  10645. * The following field definitions describe the format of the rx peer unmap
  10646. * messages sent from the target to the host.
  10647. * - MSG_TYPE
  10648. * Bits 7:0
  10649. * Purpose: identifies this as an rx peer unmap v2 message
  10650. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10651. * - VDEV_ID
  10652. * Bits 15:8
  10653. * Purpose: Indicates which virtual device the peer is associated
  10654. * with.
  10655. * Value: vdev ID (used in the host to look up the vdev object)
  10656. * - SW_PEER_ID
  10657. * Bits 31:16
  10658. * Purpose: The peer ID (index) that WAL is freeing
  10659. * Value: (rx) peer ID
  10660. * - MAC_ADDR_L32
  10661. * Bits 31:0
  10662. * Purpose: Identifies which peer node the peer ID is for.
  10663. * Value: lower 4 bytes of peer node's MAC address
  10664. * - MAC_ADDR_U16
  10665. * Bits 15:0
  10666. * Purpose: Identifies which peer node the peer ID is for.
  10667. * Value: upper 2 bytes of peer node's MAC address
  10668. * - NEXT_HOP
  10669. * Bits 16
  10670. * Purpose: Bit indicates next_hop AST entry used for WDS
  10671. * (Wireless Distribution System).
  10672. * - PEER_DELETE_DURATION
  10673. * Bits 31:0
  10674. * Purpose: Time taken to delete peer, in msec,
  10675. * Used for monitoring / debugging PEER delete response delay
  10676. * - PEER_WDS_FREE_COUNT
  10677. * Bits 15:0
  10678. * Purpose: Count of WDS entries deleted associated to peer deleted
  10679. */
  10680. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10681. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10682. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10683. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10684. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10685. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10686. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10687. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10688. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10689. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10690. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10691. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10692. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10693. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10694. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10695. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10696. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10697. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10698. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10699. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10700. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10701. do { \
  10702. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10703. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10704. } while (0)
  10705. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10706. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10707. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10708. do { \
  10709. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10710. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10711. } while (0)
  10712. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10713. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10714. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10715. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10716. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10717. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10718. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10719. /**
  10720. * @brief target -> host rx peer mlo map message definition
  10721. *
  10722. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10723. *
  10724. * @details
  10725. * The following diagram shows the format of the rx mlo peer map message sent
  10726. * from the target to the host. This layout assumes the target operates
  10727. * as little-endian.
  10728. *
  10729. * MCC:
  10730. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10731. *
  10732. * WIN:
  10733. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10734. * It will be sent on the Assoc Link.
  10735. *
  10736. * This message always contains a MLO peer ID. The main purpose of the
  10737. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10738. * with, so that the host can use that MLO peer ID to determine which peer
  10739. * transmitted the rx frame.
  10740. *
  10741. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10742. * |-------------------------------------------------------------------------|
  10743. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10744. * |-------------------------------------------------------------------------|
  10745. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10746. * |-------------------------------------------------------------------------|
  10747. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10748. * |-------------------------------------------------------------------------|
  10749. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10750. * |-------------------------------------------------------------------------|
  10751. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10752. * |-------------------------------------------------------------------------|
  10753. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10754. * |-------------------------------------------------------------------------|
  10755. * |RSVD |
  10756. * |-------------------------------------------------------------------------|
  10757. * |RSVD |
  10758. * |-------------------------------------------------------------------------|
  10759. * | htt_tlv_hdr_t |
  10760. * |-------------------------------------------------------------------------|
  10761. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10762. * |-------------------------------------------------------------------------|
  10763. * | htt_tlv_hdr_t |
  10764. * |-------------------------------------------------------------------------|
  10765. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10766. * |-------------------------------------------------------------------------|
  10767. * | htt_tlv_hdr_t |
  10768. * |-------------------------------------------------------------------------|
  10769. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10770. * |-------------------------------------------------------------------------|
  10771. *
  10772. * Where:
  10773. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10774. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10775. * V (valid) - 1 Bit Bit17
  10776. * CHIPID - 3 Bits
  10777. * TIDMASK - 8 Bits
  10778. * CACHE_SET_NUM - 8 Bits
  10779. *
  10780. * The following field definitions describe the format of the rx MLO peer map
  10781. * messages sent from the target to the host.
  10782. * - MSG_TYPE
  10783. * Bits 7:0
  10784. * Purpose: identifies this as an rx mlo peer map message
  10785. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10786. *
  10787. * - MLO_PEER_ID
  10788. * Bits 23:8
  10789. * Purpose: The MLO peer ID (index).
  10790. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10791. * Value: MLO peer ID
  10792. *
  10793. * - NUMLINK
  10794. * Bits: 26:24 (3Bits)
  10795. * Purpose: Indicate the max number of logical links supported per client.
  10796. * Value: number of logical links
  10797. *
  10798. * - PRC
  10799. * Bits: 29:27 (3Bits)
  10800. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10801. * if there is migration of the primary chip.
  10802. * Value: Primary REO CHIPID
  10803. *
  10804. * - MAC_ADDR_L32
  10805. * Bits 31:0
  10806. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10807. * Value: lower 4 bytes of peer node's MAC address
  10808. *
  10809. * - MAC_ADDR_U16
  10810. * Bits 15:0
  10811. * Purpose: Identifies which peer node the peer ID is for.
  10812. * Value: upper 2 bytes of peer node's MAC address
  10813. *
  10814. * - PRIMARY_TCL_AST_IDX
  10815. * Bits 15:0
  10816. * Purpose: Primary TCL AST index for this peer.
  10817. *
  10818. * - V
  10819. * 1 Bit Position 16
  10820. * Purpose: If the ast idx is valid.
  10821. *
  10822. * - CHIPID
  10823. * Bits 19:17
  10824. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10825. *
  10826. * - TIDMASK
  10827. * Bits 27:20
  10828. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10829. *
  10830. * - CACHE_SET_NUM
  10831. * Bits 31:28
  10832. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10833. * Cache set number that should be used to cache the index based
  10834. * search results, for address and flow search.
  10835. * This value should be equal to LSB four bits of the hash value
  10836. * of match data, in case of search index points to an entry which
  10837. * may be used in content based search also. The value can be
  10838. * anything when the entry pointed by search index will not be
  10839. * used for content based search.
  10840. *
  10841. * - htt_tlv_hdr_t
  10842. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10843. *
  10844. * Bits 11:0
  10845. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10846. *
  10847. * Bits 23:12
  10848. * Purpose: Length, Length of the value that follows the header
  10849. *
  10850. * Bits 31:28
  10851. * Purpose: Reserved.
  10852. *
  10853. *
  10854. * - SW_PEER_ID
  10855. * Bits 15:0
  10856. * Purpose: The peer ID (index) that WAL is allocating
  10857. * Value: (rx) peer ID
  10858. *
  10859. * - VDEV_ID
  10860. * Bits 23:16
  10861. * Purpose: Indicates which virtual device the peer is associated with.
  10862. * Value: vdev ID (used in the host to look up the vdev object)
  10863. *
  10864. * - CHIPID
  10865. * Bits 26:24
  10866. * Purpose: Indicates which Chip id the peer is associated with.
  10867. * Value: chip ID (Provided by Host as part of QMI exchange)
  10868. */
  10869. typedef enum {
  10870. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10871. } MLO_PEER_MAP_TLV_TAG_ID;
  10872. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10873. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10874. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10875. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10876. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10877. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10878. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10879. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10880. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10881. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10882. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10883. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10884. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10885. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10886. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10887. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10888. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10889. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10890. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10891. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10892. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10893. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10894. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10895. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10896. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10897. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10898. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10899. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10900. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10901. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10902. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10903. do { \
  10904. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10905. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10906. } while (0)
  10907. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10908. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10909. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10910. do { \
  10911. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10912. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10913. } while (0)
  10914. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10915. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10916. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10917. do { \
  10918. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10919. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10920. } while (0)
  10921. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10922. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10923. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10924. do { \
  10925. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10926. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10927. } while (0)
  10928. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10929. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10930. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10931. do { \
  10932. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10933. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10934. } while (0)
  10935. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10936. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10937. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10938. do { \
  10939. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10940. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10941. } while (0)
  10942. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10943. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10944. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10945. do { \
  10946. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10947. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10948. } while (0)
  10949. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10950. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10951. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10952. do { \
  10953. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10954. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10955. } while (0)
  10956. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10957. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10958. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10959. do { \
  10960. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10961. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10962. } while (0)
  10963. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10964. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10965. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10966. do { \
  10967. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10968. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10969. } while (0)
  10970. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10971. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10972. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10973. do { \
  10974. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10975. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10976. } while (0)
  10977. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10978. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10979. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10980. do { \
  10981. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10982. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10983. } while (0)
  10984. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10985. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10986. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10987. do { \
  10988. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10989. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10990. } while (0)
  10991. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10992. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10993. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10994. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10995. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10996. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10997. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10998. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10999. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11000. *
  11001. * The following diagram shows the format of the rx mlo peer unmap message sent
  11002. * from the target to the host.
  11003. *
  11004. * |31 24|23 16|15 8|7 0|
  11005. * |-----------------------------------------------------------------------|
  11006. * | RSVD_24_31 | MLO peer ID | msg type |
  11007. * |-----------------------------------------------------------------------|
  11008. */
  11009. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11010. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11011. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11012. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11013. /**
  11014. * @brief target -> host message specifying security parameters
  11015. *
  11016. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11017. *
  11018. * @details
  11019. * The following diagram shows the format of the security specification
  11020. * message sent from the target to the host.
  11021. * This security specification message tells the host whether a PN check is
  11022. * necessary on rx data frames, and if so, how large the PN counter is.
  11023. * This message also tells the host about the security processing to apply
  11024. * to defragmented rx frames - specifically, whether a Message Integrity
  11025. * Check is required, and the Michael key to use.
  11026. *
  11027. * |31 24|23 16|15|14 8|7 0|
  11028. * |-----------------------------------------------------------------------|
  11029. * | peer ID | U| security type | msg type |
  11030. * |-----------------------------------------------------------------------|
  11031. * | Michael Key K0 |
  11032. * |-----------------------------------------------------------------------|
  11033. * | Michael Key K1 |
  11034. * |-----------------------------------------------------------------------|
  11035. * | WAPI RSC Low0 |
  11036. * |-----------------------------------------------------------------------|
  11037. * | WAPI RSC Low1 |
  11038. * |-----------------------------------------------------------------------|
  11039. * | WAPI RSC Hi0 |
  11040. * |-----------------------------------------------------------------------|
  11041. * | WAPI RSC Hi1 |
  11042. * |-----------------------------------------------------------------------|
  11043. *
  11044. * The following field definitions describe the format of the security
  11045. * indication message sent from the target to the host.
  11046. * - MSG_TYPE
  11047. * Bits 7:0
  11048. * Purpose: identifies this as a security specification message
  11049. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11050. * - SEC_TYPE
  11051. * Bits 14:8
  11052. * Purpose: specifies which type of security applies to the peer
  11053. * Value: htt_sec_type enum value
  11054. * - UNICAST
  11055. * Bit 15
  11056. * Purpose: whether this security is applied to unicast or multicast data
  11057. * Value: 1 -> unicast, 0 -> multicast
  11058. * - PEER_ID
  11059. * Bits 31:16
  11060. * Purpose: The ID number for the peer the security specification is for
  11061. * Value: peer ID
  11062. * - MICHAEL_KEY_K0
  11063. * Bits 31:0
  11064. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11065. * Value: Michael Key K0 (if security type is TKIP)
  11066. * - MICHAEL_KEY_K1
  11067. * Bits 31:0
  11068. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11069. * Value: Michael Key K1 (if security type is TKIP)
  11070. * - WAPI_RSC_LOW0
  11071. * Bits 31:0
  11072. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11073. * Value: WAPI RSC Low0 (if security type is WAPI)
  11074. * - WAPI_RSC_LOW1
  11075. * Bits 31:0
  11076. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11077. * Value: WAPI RSC Low1 (if security type is WAPI)
  11078. * - WAPI_RSC_HI0
  11079. * Bits 31:0
  11080. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11081. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11082. * - WAPI_RSC_HI1
  11083. * Bits 31:0
  11084. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11085. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11086. */
  11087. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11088. #define HTT_SEC_IND_SEC_TYPE_S 8
  11089. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11090. #define HTT_SEC_IND_UNICAST_S 15
  11091. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11092. #define HTT_SEC_IND_PEER_ID_S 16
  11093. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11094. do { \
  11095. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11096. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11097. } while (0)
  11098. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11099. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11100. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11101. do { \
  11102. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11103. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11104. } while (0)
  11105. #define HTT_SEC_IND_UNICAST_GET(word) \
  11106. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11107. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11108. do { \
  11109. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11110. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11111. } while (0)
  11112. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11113. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11114. #define HTT_SEC_IND_BYTES 28
  11115. /**
  11116. * @brief target -> host rx ADDBA / DELBA message definitions
  11117. *
  11118. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11119. *
  11120. * @details
  11121. * The following diagram shows the format of the rx ADDBA message sent
  11122. * from the target to the host:
  11123. *
  11124. * |31 20|19 16|15 8|7 0|
  11125. * |---------------------------------------------------------------------|
  11126. * | peer ID | TID | window size | msg type |
  11127. * |---------------------------------------------------------------------|
  11128. *
  11129. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11130. *
  11131. * The following diagram shows the format of the rx DELBA message sent
  11132. * from the target to the host:
  11133. *
  11134. * |31 20|19 16|15 10|9 8|7 0|
  11135. * |---------------------------------------------------------------------|
  11136. * | peer ID | TID | window size | IR| msg type |
  11137. * |---------------------------------------------------------------------|
  11138. *
  11139. * The following field definitions describe the format of the rx ADDBA
  11140. * and DELBA messages sent from the target to the host.
  11141. * - MSG_TYPE
  11142. * Bits 7:0
  11143. * Purpose: identifies this as an rx ADDBA or DELBA message
  11144. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11145. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11146. * - IR (initiator / recipient)
  11147. * Bits 9:8 (DELBA only)
  11148. * Purpose: specify whether the DELBA handshake was initiated by the
  11149. * local STA/AP, or by the peer STA/AP
  11150. * Value:
  11151. * 0 - unspecified
  11152. * 1 - initiator (a.k.a. originator)
  11153. * 2 - recipient (a.k.a. responder)
  11154. * 3 - unused / reserved
  11155. * - WIN_SIZE
  11156. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11157. * Purpose: Specifies the length of the block ack window (max = 64).
  11158. * Value:
  11159. * block ack window length specified by the received ADDBA/DELBA
  11160. * management message.
  11161. * - TID
  11162. * Bits 19:16
  11163. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11164. * Value:
  11165. * TID specified by the received ADDBA or DELBA management message.
  11166. * - PEER_ID
  11167. * Bits 31:20
  11168. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11169. * Value:
  11170. * ID (hash value) used by the host for fast, direct lookup of
  11171. * host SW peer info, including rx reorder states.
  11172. */
  11173. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11174. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11175. #define HTT_RX_ADDBA_TID_M 0xf0000
  11176. #define HTT_RX_ADDBA_TID_S 16
  11177. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11178. #define HTT_RX_ADDBA_PEER_ID_S 20
  11179. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11180. do { \
  11181. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11182. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11183. } while (0)
  11184. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11185. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11186. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11187. do { \
  11188. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11189. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11190. } while (0)
  11191. #define HTT_RX_ADDBA_TID_GET(word) \
  11192. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11193. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11194. do { \
  11195. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11196. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11197. } while (0)
  11198. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11199. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11200. #define HTT_RX_ADDBA_BYTES 4
  11201. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11202. #define HTT_RX_DELBA_INITIATOR_S 8
  11203. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11204. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11205. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11206. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11207. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11208. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11209. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11210. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11211. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11212. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11213. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11214. do { \
  11215. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11216. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11217. } while (0)
  11218. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11219. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11220. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11221. do { \
  11222. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11223. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11224. } while (0)
  11225. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11226. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11227. #define HTT_RX_DELBA_BYTES 4
  11228. /**
  11229. * @brief tx queue group information element definition
  11230. *
  11231. * @details
  11232. * The following diagram shows the format of the tx queue group
  11233. * information element, which can be included in target --> host
  11234. * messages to specify the number of tx "credits" (tx descriptors
  11235. * for LL, or tx buffers for HL) available to a particular group
  11236. * of host-side tx queues, and which host-side tx queues belong to
  11237. * the group.
  11238. *
  11239. * |31|30 24|23 16|15|14|13 0|
  11240. * |------------------------------------------------------------------------|
  11241. * | X| reserved | tx queue grp ID | A| S| credit count |
  11242. * |------------------------------------------------------------------------|
  11243. * | vdev ID mask | AC mask |
  11244. * |------------------------------------------------------------------------|
  11245. *
  11246. * The following definitions describe the fields within the tx queue group
  11247. * information element:
  11248. * - credit_count
  11249. * Bits 13:1
  11250. * Purpose: specify how many tx credits are available to the tx queue group
  11251. * Value: An absolute or relative, positive or negative credit value
  11252. * The 'A' bit specifies whether the value is absolute or relative.
  11253. * The 'S' bit specifies whether the value is positive or negative.
  11254. * A negative value can only be relative, not absolute.
  11255. * An absolute value replaces any prior credit value the host has for
  11256. * the tx queue group in question.
  11257. * A relative value is added to the prior credit value the host has for
  11258. * the tx queue group in question.
  11259. * - sign
  11260. * Bit 14
  11261. * Purpose: specify whether the credit count is positive or negative
  11262. * Value: 0 -> positive, 1 -> negative
  11263. * - absolute
  11264. * Bit 15
  11265. * Purpose: specify whether the credit count is absolute or relative
  11266. * Value: 0 -> relative, 1 -> absolute
  11267. * - txq_group_id
  11268. * Bits 23:16
  11269. * Purpose: indicate which tx queue group's credit and/or membership are
  11270. * being specified
  11271. * Value: 0 to max_tx_queue_groups-1
  11272. * - reserved
  11273. * Bits 30:16
  11274. * Value: 0x0
  11275. * - eXtension
  11276. * Bit 31
  11277. * Purpose: specify whether another tx queue group info element follows
  11278. * Value: 0 -> no more tx queue group information elements
  11279. * 1 -> another tx queue group information element immediately follows
  11280. * - ac_mask
  11281. * Bits 15:0
  11282. * Purpose: specify which Access Categories belong to the tx queue group
  11283. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11284. * the tx queue group.
  11285. * The AC bit-mask values are obtained by left-shifting by the
  11286. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11287. * - vdev_id_mask
  11288. * Bits 31:16
  11289. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11290. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11291. * belong to the tx queue group.
  11292. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11293. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11294. */
  11295. PREPACK struct htt_txq_group {
  11296. A_UINT32
  11297. credit_count: 14,
  11298. sign: 1,
  11299. absolute: 1,
  11300. tx_queue_group_id: 8,
  11301. reserved0: 7,
  11302. extension: 1;
  11303. A_UINT32
  11304. ac_mask: 16,
  11305. vdev_id_mask: 16;
  11306. } POSTPACK;
  11307. /* first word */
  11308. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11309. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11310. #define HTT_TXQ_GROUP_SIGN_S 14
  11311. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11312. #define HTT_TXQ_GROUP_ABS_S 15
  11313. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11314. #define HTT_TXQ_GROUP_ID_S 16
  11315. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11316. #define HTT_TXQ_GROUP_EXT_S 31
  11317. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11318. /* second word */
  11319. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11320. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11321. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11322. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11323. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11324. do { \
  11325. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11326. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11327. } while (0)
  11328. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11329. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11330. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11331. do { \
  11332. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11333. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11334. } while (0)
  11335. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11336. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11337. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11338. do { \
  11339. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11340. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11341. } while (0)
  11342. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11343. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11344. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11345. do { \
  11346. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11347. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11348. } while (0)
  11349. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11350. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11351. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11352. do { \
  11353. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11354. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11355. } while (0)
  11356. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11357. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11358. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11359. do { \
  11360. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11361. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11362. } while (0)
  11363. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11364. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11365. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11366. do { \
  11367. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11368. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11369. } while (0)
  11370. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11371. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11372. /**
  11373. * @brief target -> host TX completion indication message definition
  11374. *
  11375. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11376. *
  11377. * @details
  11378. * The following diagram shows the format of the TX completion indication sent
  11379. * from the target to the host
  11380. *
  11381. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11382. * |-------------------------------------------------------------------|
  11383. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11384. * |-------------------------------------------------------------------|
  11385. * payload:| MSDU1 ID | MSDU0 ID |
  11386. * |-------------------------------------------------------------------|
  11387. * : MSDU3 ID | MSDU2 ID :
  11388. * |-------------------------------------------------------------------|
  11389. * | struct htt_tx_compl_ind_append_retries |
  11390. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11391. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11392. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11393. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11394. * |-------------------------------------------------------------------|
  11395. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11396. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11397. * | MSDU0 tx_tsf64_low |
  11398. * |-------------------------------------------------------------------|
  11399. * | MSDU0 tx_tsf64_high |
  11400. * |-------------------------------------------------------------------|
  11401. * | MSDU1 tx_tsf64_low |
  11402. * |-------------------------------------------------------------------|
  11403. * | MSDU1 tx_tsf64_high |
  11404. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11405. * | phy_timestamp |
  11406. * |-------------------------------------------------------------------|
  11407. * | rate specs (see below) |
  11408. * |-------------------------------------------------------------------|
  11409. * | seqctrl | framectrl |
  11410. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11411. * Where:
  11412. * A0 = append (a.k.a. append0)
  11413. * A1 = append1
  11414. * TP = MSDU tx power presence
  11415. * A2 = append2
  11416. * A3 = append3
  11417. * A4 = append4
  11418. *
  11419. * The following field definitions describe the format of the TX completion
  11420. * indication sent from the target to the host
  11421. * Header fields:
  11422. * - msg_type
  11423. * Bits 7:0
  11424. * Purpose: identifies this as HTT TX completion indication
  11425. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11426. * - status
  11427. * Bits 10:8
  11428. * Purpose: the TX completion status of payload fragmentations descriptors
  11429. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11430. * - tid
  11431. * Bits 14:11
  11432. * Purpose: the tid associated with those fragmentation descriptors. It is
  11433. * valid or not, depending on the tid_invalid bit.
  11434. * Value: 0 to 15
  11435. * - tid_invalid
  11436. * Bits 15:15
  11437. * Purpose: this bit indicates whether the tid field is valid or not
  11438. * Value: 0 indicates valid; 1 indicates invalid
  11439. * - num
  11440. * Bits 23:16
  11441. * Purpose: the number of payload in this indication
  11442. * Value: 1 to 255
  11443. * - append (a.k.a. append0)
  11444. * Bits 24:24
  11445. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11446. * the number of tx retries for one MSDU at the end of this message
  11447. * Value: 0 indicates no appending; 1 indicates appending
  11448. * - append1
  11449. * Bits 25:25
  11450. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11451. * contains the timestamp info for each TX msdu id in payload.
  11452. * The order of the timestamps matches the order of the MSDU IDs.
  11453. * Note that a big-endian host needs to account for the reordering
  11454. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11455. * conversion) when determining which tx timestamp corresponds to
  11456. * which MSDU ID.
  11457. * Value: 0 indicates no appending; 1 indicates appending
  11458. * - msdu_tx_power_presence
  11459. * Bits 26:26
  11460. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11461. * for each MSDU referenced by the TX_COMPL_IND message.
  11462. * The tx power is reported in 0.5 dBm units.
  11463. * The order of the per-MSDU tx power reports matches the order
  11464. * of the MSDU IDs.
  11465. * Note that a big-endian host needs to account for the reordering
  11466. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11467. * conversion) when determining which Tx Power corresponds to
  11468. * which MSDU ID.
  11469. * Value: 0 indicates MSDU tx power reports are not appended,
  11470. * 1 indicates MSDU tx power reports are appended
  11471. * - append2
  11472. * Bits 27:27
  11473. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11474. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11475. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11476. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11477. * for each MSDU, for convenience.
  11478. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11479. * this append2 bit is set).
  11480. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11481. * dB above the noise floor.
  11482. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11483. * 1 indicates MSDU ACK RSSI values are appended.
  11484. * - append3
  11485. * Bits 28:28
  11486. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11487. * contains the tx tsf info based on wlan global TSF for
  11488. * each TX msdu id in payload.
  11489. * The order of the tx tsf matches the order of the MSDU IDs.
  11490. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11491. * values to indicate the the lower 32 bits and higher 32 bits of
  11492. * the tx tsf.
  11493. * The tx_tsf64 here represents the time MSDU was acked and the
  11494. * tx_tsf64 has microseconds units.
  11495. * Value: 0 indicates no appending; 1 indicates appending
  11496. * - append4
  11497. * Bits 29:29
  11498. * Purpose: Indicate whether data frame control fields and fields required
  11499. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11500. * message. The order of the this message matches the order of
  11501. * the MSDU IDs.
  11502. * Value: 0 indicates frame control fields and fields required for
  11503. * radio tap header values are not appended,
  11504. * 1 indicates frame control fields and fields required for
  11505. * radio tap header values are appended.
  11506. * Payload fields:
  11507. * - hmsdu_id
  11508. * Bits 15:0
  11509. * Purpose: this ID is used to track the Tx buffer in host
  11510. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11511. */
  11512. PREPACK struct htt_tx_data_hdr_information {
  11513. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11514. A_UINT32 /* word 1 */
  11515. /* preamble:
  11516. * 0-OFDM,
  11517. * 1-CCk,
  11518. * 2-HT,
  11519. * 3-VHT
  11520. */
  11521. preamble: 2, /* [1:0] */
  11522. /* mcs:
  11523. * In case of HT preamble interpret
  11524. * MCS along with NSS.
  11525. * Valid values for HT are 0 to 7.
  11526. * HT mcs 0 with NSS 2 is mcs 8.
  11527. * Valid values for VHT are 0 to 9.
  11528. */
  11529. mcs: 4, /* [5:2] */
  11530. /* rate:
  11531. * This is applicable only for
  11532. * CCK and OFDM preamble type
  11533. * rate 0: OFDM 48 Mbps,
  11534. * 1: OFDM 24 Mbps,
  11535. * 2: OFDM 12 Mbps
  11536. * 3: OFDM 6 Mbps
  11537. * 4: OFDM 54 Mbps
  11538. * 5: OFDM 36 Mbps
  11539. * 6: OFDM 18 Mbps
  11540. * 7: OFDM 9 Mbps
  11541. * rate 0: CCK 11 Mbps Long
  11542. * 1: CCK 5.5 Mbps Long
  11543. * 2: CCK 2 Mbps Long
  11544. * 3: CCK 1 Mbps Long
  11545. * 4: CCK 11 Mbps Short
  11546. * 5: CCK 5.5 Mbps Short
  11547. * 6: CCK 2 Mbps Short
  11548. */
  11549. rate : 3, /* [ 8: 6] */
  11550. rssi : 8, /* [16: 9] units=dBm */
  11551. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11552. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11553. stbc : 1, /* [22] */
  11554. sgi : 1, /* [23] */
  11555. ldpc : 1, /* [24] */
  11556. beamformed: 1, /* [25] */
  11557. /* tx_retry_cnt:
  11558. * Indicates retry count of data tx frames provided by the host.
  11559. */
  11560. tx_retry_cnt: 6; /* [31:26] */
  11561. A_UINT32 /* word 2 */
  11562. framectrl:16, /* [15: 0] */
  11563. seqno:16; /* [31:16] */
  11564. } POSTPACK;
  11565. #define HTT_TX_COMPL_IND_STATUS_S 8
  11566. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11567. #define HTT_TX_COMPL_IND_TID_S 11
  11568. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11569. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11570. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11571. #define HTT_TX_COMPL_IND_NUM_S 16
  11572. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11573. #define HTT_TX_COMPL_IND_APPEND_S 24
  11574. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11575. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11576. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11577. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11578. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11579. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11580. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11581. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11582. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11583. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11584. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11585. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11586. do { \
  11587. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11588. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11589. } while (0)
  11590. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11591. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11592. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11593. do { \
  11594. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11595. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11596. } while (0)
  11597. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11598. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11599. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11600. do { \
  11601. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11602. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11603. } while (0)
  11604. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11605. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11606. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11607. do { \
  11608. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11609. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11610. } while (0)
  11611. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11612. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11613. HTT_TX_COMPL_IND_TID_INV_S)
  11614. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11615. do { \
  11616. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11617. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11618. } while (0)
  11619. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11620. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11621. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11622. do { \
  11623. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11624. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11625. } while (0)
  11626. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11627. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11628. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11629. do { \
  11630. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11631. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11632. } while (0)
  11633. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11634. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11635. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11636. do { \
  11637. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11638. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11639. } while (0)
  11640. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11641. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11642. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11643. do { \
  11644. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11645. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11646. } while (0)
  11647. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11648. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11649. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11650. do { \
  11651. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11652. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11653. } while (0)
  11654. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11655. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11656. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11657. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11658. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11659. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11660. #define HTT_TX_COMPL_IND_STAT_OK 0
  11661. /* DISCARD:
  11662. * current meaning:
  11663. * MSDUs were queued for transmission but filtered by HW or SW
  11664. * without any over the air attempts
  11665. * legacy meaning (HL Rome):
  11666. * MSDUs were discarded by the target FW without any over the air
  11667. * attempts due to lack of space
  11668. */
  11669. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11670. /* NO_ACK:
  11671. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11672. */
  11673. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11674. /* POSTPONE:
  11675. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11676. * be downloaded again later (in the appropriate order), when they are
  11677. * deliverable.
  11678. */
  11679. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11680. /*
  11681. * The PEER_DEL tx completion status is used for HL cases
  11682. * where the peer the frame is for has been deleted.
  11683. * The host has already discarded its copy of the frame, but
  11684. * it still needs the tx completion to restore its credit.
  11685. */
  11686. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11687. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11688. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11689. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11690. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11691. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11692. PREPACK struct htt_tx_compl_ind_base {
  11693. A_UINT32 hdr;
  11694. A_UINT16 payload[1/*or more*/];
  11695. } POSTPACK;
  11696. PREPACK struct htt_tx_compl_ind_append_retries {
  11697. A_UINT16 msdu_id;
  11698. A_UINT8 tx_retries;
  11699. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11700. 0: this is the last append_retries struct */
  11701. } POSTPACK;
  11702. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11703. A_UINT32 timestamp[1/*or more*/];
  11704. } POSTPACK;
  11705. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11706. A_UINT32 tx_tsf64_low;
  11707. A_UINT32 tx_tsf64_high;
  11708. } POSTPACK;
  11709. /* htt_tx_data_hdr_information payload extension fields: */
  11710. /* DWORD zero */
  11711. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11712. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11713. /* DWORD one */
  11714. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11715. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11716. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11717. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11718. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11719. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11720. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11721. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11722. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11723. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11724. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11725. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11726. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11727. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11728. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11729. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11730. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11731. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11732. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11733. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11734. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11735. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11736. /* DWORD two */
  11737. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11738. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11739. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11740. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11741. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11742. do { \
  11743. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11744. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11745. } while (0)
  11746. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11747. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11748. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11749. do { \
  11750. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11751. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11752. } while (0)
  11753. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11754. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11755. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11758. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11759. } while (0)
  11760. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11761. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11762. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11763. do { \
  11764. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11765. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11766. } while (0)
  11767. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11768. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11769. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11770. do { \
  11771. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11772. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11773. } while (0)
  11774. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11775. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11776. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11777. do { \
  11778. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11779. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11780. } while (0)
  11781. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11782. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11783. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11784. do { \
  11785. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11786. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11787. } while (0)
  11788. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11789. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11790. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11791. do { \
  11792. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11793. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11794. } while (0)
  11795. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11796. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11797. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11798. do { \
  11799. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11800. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11801. } while (0)
  11802. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11803. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11804. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11805. do { \
  11806. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11807. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11808. } while (0)
  11809. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11810. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11811. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11814. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11815. } while (0)
  11816. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11817. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11818. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11819. do { \
  11820. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11821. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11822. } while (0)
  11823. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11824. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11825. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11826. do { \
  11827. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11828. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11829. } while (0)
  11830. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11831. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11832. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11833. do { \
  11834. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11835. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11836. } while (0)
  11837. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11838. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11839. /**
  11840. * @brief target -> host rate-control update indication message
  11841. *
  11842. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11843. *
  11844. * @details
  11845. * The following diagram shows the format of the RC Update message
  11846. * sent from the target to the host, while processing the tx-completion
  11847. * of a transmitted PPDU.
  11848. *
  11849. * |31 24|23 16|15 8|7 0|
  11850. * |-------------------------------------------------------------|
  11851. * | peer ID | vdev ID | msg_type |
  11852. * |-------------------------------------------------------------|
  11853. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11854. * |-------------------------------------------------------------|
  11855. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11856. * |-------------------------------------------------------------|
  11857. * | : |
  11858. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11859. * | : |
  11860. * |-------------------------------------------------------------|
  11861. * | : |
  11862. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11863. * | : |
  11864. * |-------------------------------------------------------------|
  11865. * : :
  11866. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11867. *
  11868. */
  11869. typedef struct {
  11870. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11871. A_UINT32 rate_code_flags;
  11872. A_UINT32 flags; /* Encodes information such as excessive
  11873. retransmission, aggregate, some info
  11874. from .11 frame control,
  11875. STBC, LDPC, (SGI and Tx Chain Mask
  11876. are encoded in ptx_rc->flags field),
  11877. AMPDU truncation (BT/time based etc.),
  11878. RTS/CTS attempt */
  11879. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11880. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11881. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11882. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11883. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11884. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11885. } HTT_RC_TX_DONE_PARAMS;
  11886. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11887. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11888. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11889. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11890. #define HTT_RC_UPDATE_VDEVID_S 8
  11891. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11892. #define HTT_RC_UPDATE_PEERID_S 16
  11893. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11894. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11895. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11896. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11897. do { \
  11898. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11899. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11900. } while (0)
  11901. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11902. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11903. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11904. do { \
  11905. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11906. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11907. } while (0)
  11908. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11909. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11910. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11911. do { \
  11912. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11913. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11914. } while (0)
  11915. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11916. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11917. /**
  11918. * @brief target -> host rx fragment indication message definition
  11919. *
  11920. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11921. *
  11922. * @details
  11923. * The following field definitions describe the format of the rx fragment
  11924. * indication message sent from the target to the host.
  11925. * The rx fragment indication message shares the format of the
  11926. * rx indication message, but not all fields from the rx indication message
  11927. * are relevant to the rx fragment indication message.
  11928. *
  11929. *
  11930. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11931. * |-----------+-------------------+---------------------+-------------|
  11932. * | peer ID | |FV| ext TID | msg type |
  11933. * |-------------------------------------------------------------------|
  11934. * | | flush | flush |
  11935. * | | end | start |
  11936. * | | seq num | seq num |
  11937. * |-------------------------------------------------------------------|
  11938. * | reserved | FW rx desc bytes |
  11939. * |-------------------------------------------------------------------|
  11940. * | | FW MSDU Rx |
  11941. * | | desc B0 |
  11942. * |-------------------------------------------------------------------|
  11943. * Header fields:
  11944. * - MSG_TYPE
  11945. * Bits 7:0
  11946. * Purpose: identifies this as an rx fragment indication message
  11947. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11948. * - EXT_TID
  11949. * Bits 12:8
  11950. * Purpose: identify the traffic ID of the rx data, including
  11951. * special "extended" TID values for multicast, broadcast, and
  11952. * non-QoS data frames
  11953. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11954. * - FLUSH_VALID (FV)
  11955. * Bit 13
  11956. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11957. * is valid
  11958. * Value:
  11959. * 1 -> flush IE is valid and needs to be processed
  11960. * 0 -> flush IE is not valid and should be ignored
  11961. * - PEER_ID
  11962. * Bits 31:16
  11963. * Purpose: Identify, by ID, which peer sent the rx data
  11964. * Value: ID of the peer who sent the rx data
  11965. * - FLUSH_SEQ_NUM_START
  11966. * Bits 5:0
  11967. * Purpose: Indicate the start of a series of MPDUs to flush
  11968. * Not all MPDUs within this series are necessarily valid - the host
  11969. * must check each sequence number within this range to see if the
  11970. * corresponding MPDU is actually present.
  11971. * This field is only valid if the FV bit is set.
  11972. * Value:
  11973. * The sequence number for the first MPDUs to check to flush.
  11974. * The sequence number is masked by 0x3f.
  11975. * - FLUSH_SEQ_NUM_END
  11976. * Bits 11:6
  11977. * Purpose: Indicate the end of a series of MPDUs to flush
  11978. * Value:
  11979. * The sequence number one larger than the sequence number of the
  11980. * last MPDU to check to flush.
  11981. * The sequence number is masked by 0x3f.
  11982. * Not all MPDUs within this series are necessarily valid - the host
  11983. * must check each sequence number within this range to see if the
  11984. * corresponding MPDU is actually present.
  11985. * This field is only valid if the FV bit is set.
  11986. * Rx descriptor fields:
  11987. * - FW_RX_DESC_BYTES
  11988. * Bits 15:0
  11989. * Purpose: Indicate how many bytes in the Rx indication are used for
  11990. * FW Rx descriptors
  11991. * Value: 1
  11992. */
  11993. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11994. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11995. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11996. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11997. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11998. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11999. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12000. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12001. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12002. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12003. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12004. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12005. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12006. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12007. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12008. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12009. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12010. #define HTT_RX_FRAG_IND_BYTES \
  12011. (4 /* msg hdr */ + \
  12012. 4 /* flush spec */ + \
  12013. 4 /* (unused) FW rx desc bytes spec */ + \
  12014. 4 /* FW rx desc */)
  12015. /**
  12016. * @brief target -> host test message definition
  12017. *
  12018. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12019. *
  12020. * @details
  12021. * The following field definitions describe the format of the test
  12022. * message sent from the target to the host.
  12023. * The message consists of a 4-octet header, followed by a variable
  12024. * number of 32-bit integer values, followed by a variable number
  12025. * of 8-bit character values.
  12026. *
  12027. * |31 16|15 8|7 0|
  12028. * |-----------------------------------------------------------|
  12029. * | num chars | num ints | msg type |
  12030. * |-----------------------------------------------------------|
  12031. * | int 0 |
  12032. * |-----------------------------------------------------------|
  12033. * | int 1 |
  12034. * |-----------------------------------------------------------|
  12035. * | ... |
  12036. * |-----------------------------------------------------------|
  12037. * | char 3 | char 2 | char 1 | char 0 |
  12038. * |-----------------------------------------------------------|
  12039. * | | | ... | char 4 |
  12040. * |-----------------------------------------------------------|
  12041. * - MSG_TYPE
  12042. * Bits 7:0
  12043. * Purpose: identifies this as a test message
  12044. * Value: HTT_MSG_TYPE_TEST
  12045. * - NUM_INTS
  12046. * Bits 15:8
  12047. * Purpose: indicate how many 32-bit integers follow the message header
  12048. * - NUM_CHARS
  12049. * Bits 31:16
  12050. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12051. */
  12052. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12053. #define HTT_RX_TEST_NUM_INTS_S 8
  12054. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12055. #define HTT_RX_TEST_NUM_CHARS_S 16
  12056. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12057. do { \
  12058. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12059. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12060. } while (0)
  12061. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12062. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12063. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12064. do { \
  12065. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12066. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12067. } while (0)
  12068. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12069. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12070. /**
  12071. * @brief target -> host packet log message
  12072. *
  12073. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12074. *
  12075. * @details
  12076. * The following field definitions describe the format of the packet log
  12077. * message sent from the target to the host.
  12078. * The message consists of a 4-octet header,followed by a variable number
  12079. * of 32-bit character values.
  12080. *
  12081. * |31 16|15 12|11 10|9 8|7 0|
  12082. * |------------------------------------------------------------------|
  12083. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12084. * |------------------------------------------------------------------|
  12085. * | payload |
  12086. * |------------------------------------------------------------------|
  12087. * - MSG_TYPE
  12088. * Bits 7:0
  12089. * Purpose: identifies this as a pktlog message
  12090. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12091. * - mac_id
  12092. * Bits 9:8
  12093. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12094. * Value: 0-3
  12095. * - pdev_id
  12096. * Bits 11:10
  12097. * Purpose: pdev_id
  12098. * Value: 0-3
  12099. * 0 (for rings at SOC level),
  12100. * 1/2/3 PDEV -> 0/1/2
  12101. * - payload_size
  12102. * Bits 31:16
  12103. * Purpose: explicitly specify the payload size
  12104. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12105. */
  12106. PREPACK struct htt_pktlog_msg {
  12107. A_UINT32 header;
  12108. A_UINT32 payload[1/* or more */];
  12109. } POSTPACK;
  12110. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12111. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12112. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12113. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12114. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12115. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12116. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12117. do { \
  12118. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12119. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12120. } while (0)
  12121. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12122. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12123. HTT_T2H_PKTLOG_MAC_ID_S)
  12124. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12125. do { \
  12126. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12127. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12128. } while (0)
  12129. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12130. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12131. HTT_T2H_PKTLOG_PDEV_ID_S)
  12132. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12133. do { \
  12134. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12135. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12136. } while (0)
  12137. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12138. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12139. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12140. /*
  12141. * Rx reorder statistics
  12142. * NB: all the fields must be defined in 4 octets size.
  12143. */
  12144. struct rx_reorder_stats {
  12145. /* Non QoS MPDUs received */
  12146. A_UINT32 deliver_non_qos;
  12147. /* MPDUs received in-order */
  12148. A_UINT32 deliver_in_order;
  12149. /* Flush due to reorder timer expired */
  12150. A_UINT32 deliver_flush_timeout;
  12151. /* Flush due to move out of window */
  12152. A_UINT32 deliver_flush_oow;
  12153. /* Flush due to DELBA */
  12154. A_UINT32 deliver_flush_delba;
  12155. /* MPDUs dropped due to FCS error */
  12156. A_UINT32 fcs_error;
  12157. /* MPDUs dropped due to monitor mode non-data packet */
  12158. A_UINT32 mgmt_ctrl;
  12159. /* Unicast-data MPDUs dropped due to invalid peer */
  12160. A_UINT32 invalid_peer;
  12161. /* MPDUs dropped due to duplication (non aggregation) */
  12162. A_UINT32 dup_non_aggr;
  12163. /* MPDUs dropped due to processed before */
  12164. A_UINT32 dup_past;
  12165. /* MPDUs dropped due to duplicate in reorder queue */
  12166. A_UINT32 dup_in_reorder;
  12167. /* Reorder timeout happened */
  12168. A_UINT32 reorder_timeout;
  12169. /* invalid bar ssn */
  12170. A_UINT32 invalid_bar_ssn;
  12171. /* reorder reset due to bar ssn */
  12172. A_UINT32 ssn_reset;
  12173. /* Flush due to delete peer */
  12174. A_UINT32 deliver_flush_delpeer;
  12175. /* Flush due to offload*/
  12176. A_UINT32 deliver_flush_offload;
  12177. /* Flush due to out of buffer*/
  12178. A_UINT32 deliver_flush_oob;
  12179. /* MPDUs dropped due to PN check fail */
  12180. A_UINT32 pn_fail;
  12181. /* MPDUs dropped due to unable to allocate memory */
  12182. A_UINT32 store_fail;
  12183. /* Number of times the tid pool alloc succeeded */
  12184. A_UINT32 tid_pool_alloc_succ;
  12185. /* Number of times the MPDU pool alloc succeeded */
  12186. A_UINT32 mpdu_pool_alloc_succ;
  12187. /* Number of times the MSDU pool alloc succeeded */
  12188. A_UINT32 msdu_pool_alloc_succ;
  12189. /* Number of times the tid pool alloc failed */
  12190. A_UINT32 tid_pool_alloc_fail;
  12191. /* Number of times the MPDU pool alloc failed */
  12192. A_UINT32 mpdu_pool_alloc_fail;
  12193. /* Number of times the MSDU pool alloc failed */
  12194. A_UINT32 msdu_pool_alloc_fail;
  12195. /* Number of times the tid pool freed */
  12196. A_UINT32 tid_pool_free;
  12197. /* Number of times the MPDU pool freed */
  12198. A_UINT32 mpdu_pool_free;
  12199. /* Number of times the MSDU pool freed */
  12200. A_UINT32 msdu_pool_free;
  12201. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12202. A_UINT32 msdu_queued;
  12203. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12204. A_UINT32 msdu_recycled;
  12205. /* Number of MPDUs with invalid peer but A2 found in AST */
  12206. A_UINT32 invalid_peer_a2_in_ast;
  12207. /* Number of MPDUs with invalid peer but A3 found in AST */
  12208. A_UINT32 invalid_peer_a3_in_ast;
  12209. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12210. A_UINT32 invalid_peer_bmc_mpdus;
  12211. /* Number of MSDUs with err attention word */
  12212. A_UINT32 rxdesc_err_att;
  12213. /* Number of MSDUs with flag of peer_idx_invalid */
  12214. A_UINT32 rxdesc_err_peer_idx_inv;
  12215. /* Number of MSDUs with flag of peer_idx_timeout */
  12216. A_UINT32 rxdesc_err_peer_idx_to;
  12217. /* Number of MSDUs with flag of overflow */
  12218. A_UINT32 rxdesc_err_ov;
  12219. /* Number of MSDUs with flag of msdu_length_err */
  12220. A_UINT32 rxdesc_err_msdu_len;
  12221. /* Number of MSDUs with flag of mpdu_length_err */
  12222. A_UINT32 rxdesc_err_mpdu_len;
  12223. /* Number of MSDUs with flag of tkip_mic_err */
  12224. A_UINT32 rxdesc_err_tkip_mic;
  12225. /* Number of MSDUs with flag of decrypt_err */
  12226. A_UINT32 rxdesc_err_decrypt;
  12227. /* Number of MSDUs with flag of fcs_err */
  12228. A_UINT32 rxdesc_err_fcs;
  12229. /* Number of Unicast (bc_mc bit is not set in attention word)
  12230. * frames with invalid peer handler
  12231. */
  12232. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12233. /* Number of unicast frame directly (direct bit is set in attention word)
  12234. * to DUT with invalid peer handler
  12235. */
  12236. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12237. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12238. * frames with invalid peer handler
  12239. */
  12240. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12241. /* Number of MSDUs dropped due to no first MSDU flag */
  12242. A_UINT32 rxdesc_no_1st_msdu;
  12243. /* Number of MSDUs droped due to ring overflow */
  12244. A_UINT32 msdu_drop_ring_ov;
  12245. /* Number of MSDUs dropped due to FC mismatch */
  12246. A_UINT32 msdu_drop_fc_mismatch;
  12247. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12248. A_UINT32 msdu_drop_mgmt_remote_ring;
  12249. /* Number of MSDUs dropped due to errors not reported in attention word */
  12250. A_UINT32 msdu_drop_misc;
  12251. /* Number of MSDUs go to offload before reorder */
  12252. A_UINT32 offload_msdu_wal;
  12253. /* Number of data frame dropped by offload after reorder */
  12254. A_UINT32 offload_msdu_reorder;
  12255. /* Number of MPDUs with sequence number in the past and within the BA window */
  12256. A_UINT32 dup_past_within_window;
  12257. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12258. A_UINT32 dup_past_outside_window;
  12259. /* Number of MSDUs with decrypt/MIC error */
  12260. A_UINT32 rxdesc_err_decrypt_mic;
  12261. /* Number of data MSDUs received on both local and remote rings */
  12262. A_UINT32 data_msdus_on_both_rings;
  12263. /* MPDUs never filled */
  12264. A_UINT32 holes_not_filled;
  12265. };
  12266. /*
  12267. * Rx Remote buffer statistics
  12268. * NB: all the fields must be defined in 4 octets size.
  12269. */
  12270. struct rx_remote_buffer_mgmt_stats {
  12271. /* Total number of MSDUs reaped for Rx processing */
  12272. A_UINT32 remote_reaped;
  12273. /* MSDUs recycled within firmware */
  12274. A_UINT32 remote_recycled;
  12275. /* MSDUs stored by Data Rx */
  12276. A_UINT32 data_rx_msdus_stored;
  12277. /* Number of HTT indications from WAL Rx MSDU */
  12278. A_UINT32 wal_rx_ind;
  12279. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12280. A_UINT32 wal_rx_ind_unconsumed;
  12281. /* Number of HTT indications from Data Rx MSDU */
  12282. A_UINT32 data_rx_ind;
  12283. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12284. A_UINT32 data_rx_ind_unconsumed;
  12285. /* Number of HTT indications from ATHBUF */
  12286. A_UINT32 athbuf_rx_ind;
  12287. /* Number of remote buffers requested for refill */
  12288. A_UINT32 refill_buf_req;
  12289. /* Number of remote buffers filled by the host */
  12290. A_UINT32 refill_buf_rsp;
  12291. /* Number of times MAC hw_index = f/w write_index */
  12292. A_INT32 mac_no_bufs;
  12293. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12294. A_INT32 fw_indices_equal;
  12295. /* Number of times f/w finds no buffers to post */
  12296. A_INT32 host_no_bufs;
  12297. };
  12298. /*
  12299. * TXBF MU/SU packets and NDPA statistics
  12300. * NB: all the fields must be defined in 4 octets size.
  12301. */
  12302. struct rx_txbf_musu_ndpa_pkts_stats {
  12303. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12304. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12305. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12306. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12307. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12308. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12309. };
  12310. /*
  12311. * htt_dbg_stats_status -
  12312. * present - The requested stats have been delivered in full.
  12313. * This indicates that either the stats information was contained
  12314. * in its entirety within this message, or else this message
  12315. * completes the delivery of the requested stats info that was
  12316. * partially delivered through earlier STATS_CONF messages.
  12317. * partial - The requested stats have been delivered in part.
  12318. * One or more subsequent STATS_CONF messages with the same
  12319. * cookie value will be sent to deliver the remainder of the
  12320. * information.
  12321. * error - The requested stats could not be delivered, for example due
  12322. * to a shortage of memory to construct a message holding the
  12323. * requested stats.
  12324. * invalid - The requested stat type is either not recognized, or the
  12325. * target is configured to not gather the stats type in question.
  12326. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12327. * series_done - This special value indicates that no further stats info
  12328. * elements are present within a series of stats info elems
  12329. * (within a stats upload confirmation message).
  12330. */
  12331. enum htt_dbg_stats_status {
  12332. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12333. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12334. HTT_DBG_STATS_STATUS_ERROR = 2,
  12335. HTT_DBG_STATS_STATUS_INVALID = 3,
  12336. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12337. };
  12338. /**
  12339. * @brief target -> host statistics upload
  12340. *
  12341. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12342. *
  12343. * @details
  12344. * The following field definitions describe the format of the HTT target
  12345. * to host stats upload confirmation message.
  12346. * The message contains a cookie echoed from the HTT host->target stats
  12347. * upload request, which identifies which request the confirmation is
  12348. * for, and a series of tag-length-value stats information elements.
  12349. * The tag-length header for each stats info element also includes a
  12350. * status field, to indicate whether the request for the stat type in
  12351. * question was fully met, partially met, unable to be met, or invalid
  12352. * (if the stat type in question is disabled in the target).
  12353. * A special value of all 1's in this status field is used to indicate
  12354. * the end of the series of stats info elements.
  12355. *
  12356. *
  12357. * |31 16|15 8|7 5|4 0|
  12358. * |------------------------------------------------------------|
  12359. * | reserved | msg type |
  12360. * |------------------------------------------------------------|
  12361. * | cookie LSBs |
  12362. * |------------------------------------------------------------|
  12363. * | cookie MSBs |
  12364. * |------------------------------------------------------------|
  12365. * | stats entry length | reserved | S |stat type|
  12366. * |------------------------------------------------------------|
  12367. * | |
  12368. * | type-specific stats info |
  12369. * | |
  12370. * |------------------------------------------------------------|
  12371. * | stats entry length | reserved | S |stat type|
  12372. * |------------------------------------------------------------|
  12373. * | |
  12374. * | type-specific stats info |
  12375. * | |
  12376. * |------------------------------------------------------------|
  12377. * | n/a | reserved | 111 | n/a |
  12378. * |------------------------------------------------------------|
  12379. * Header fields:
  12380. * - MSG_TYPE
  12381. * Bits 7:0
  12382. * Purpose: identifies this is a statistics upload confirmation message
  12383. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12384. * - COOKIE_LSBS
  12385. * Bits 31:0
  12386. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12387. * message with its preceding host->target stats request message.
  12388. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12389. * - COOKIE_MSBS
  12390. * Bits 31:0
  12391. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12392. * message with its preceding host->target stats request message.
  12393. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12394. *
  12395. * Stats Information Element tag-length header fields:
  12396. * - STAT_TYPE
  12397. * Bits 4:0
  12398. * Purpose: identifies the type of statistics info held in the
  12399. * following information element
  12400. * Value: htt_dbg_stats_type
  12401. * - STATUS
  12402. * Bits 7:5
  12403. * Purpose: indicate whether the requested stats are present
  12404. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12405. * the completion of the stats entry series
  12406. * - LENGTH
  12407. * Bits 31:16
  12408. * Purpose: indicate the stats information size
  12409. * Value: This field specifies the number of bytes of stats information
  12410. * that follows the element tag-length header.
  12411. * It is expected but not required that this length is a multiple of
  12412. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12413. * subsequent stats entry header will begin on a 4-byte aligned
  12414. * boundary.
  12415. */
  12416. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12417. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12418. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12419. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12420. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12421. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12422. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12423. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12424. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12425. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12426. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12427. do { \
  12428. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12429. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12430. } while (0)
  12431. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12432. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12433. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12434. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12435. do { \
  12436. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12437. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12438. } while (0)
  12439. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12440. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12441. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12442. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12443. do { \
  12444. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12445. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12446. } while (0)
  12447. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12448. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12449. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12450. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12451. #define HTT_MAX_AGGR 64
  12452. #define HTT_HL_MAX_AGGR 18
  12453. /**
  12454. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12455. *
  12456. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12457. *
  12458. * @details
  12459. * The following field definitions describe the format of the HTT host
  12460. * to target frag_desc/msdu_ext bank configuration message.
  12461. * The message contains the based address and the min and max id of the
  12462. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12463. * MSDU_EXT/FRAG_DESC.
  12464. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12465. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12466. * the hardware does the mapping/translation.
  12467. *
  12468. * Total banks that can be configured is configured to 16.
  12469. *
  12470. * This should be called before any TX has be initiated by the HTT
  12471. *
  12472. * |31 16|15 8|7 5|4 0|
  12473. * |------------------------------------------------------------|
  12474. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12475. * |------------------------------------------------------------|
  12476. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12477. #if HTT_PADDR64
  12478. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12479. #endif
  12480. * |------------------------------------------------------------|
  12481. * | ... |
  12482. * |------------------------------------------------------------|
  12483. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12484. #if HTT_PADDR64
  12485. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12486. #endif
  12487. * |------------------------------------------------------------|
  12488. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12489. * |------------------------------------------------------------|
  12490. * | ... |
  12491. * |------------------------------------------------------------|
  12492. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12493. * |------------------------------------------------------------|
  12494. * Header fields:
  12495. * - MSG_TYPE
  12496. * Bits 7:0
  12497. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12498. * for systems with 64-bit format for bus addresses:
  12499. * - BANKx_BASE_ADDRESS_LO
  12500. * Bits 31:0
  12501. * Purpose: Provide a mechanism to specify the base address of the
  12502. * MSDU_EXT bank physical/bus address.
  12503. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12504. * - BANKx_BASE_ADDRESS_HI
  12505. * Bits 31:0
  12506. * Purpose: Provide a mechanism to specify the base address of the
  12507. * MSDU_EXT bank physical/bus address.
  12508. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12509. * for systems with 32-bit format for bus addresses:
  12510. * - BANKx_BASE_ADDRESS
  12511. * Bits 31:0
  12512. * Purpose: Provide a mechanism to specify the base address of the
  12513. * MSDU_EXT bank physical/bus address.
  12514. * Value: MSDU_EXT bank physical / bus address
  12515. * - BANKx_MIN_ID
  12516. * Bits 15:0
  12517. * Purpose: Provide a mechanism to specify the min index that needs to
  12518. * mapped.
  12519. * - BANKx_MAX_ID
  12520. * Bits 31:16
  12521. * Purpose: Provide a mechanism to specify the max index that needs to
  12522. * mapped.
  12523. *
  12524. */
  12525. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12526. * safe value.
  12527. * @note MAX supported banks is 16.
  12528. */
  12529. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12530. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12531. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12532. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12533. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12534. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12535. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12536. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12537. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12538. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12539. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12540. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12541. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12542. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12543. do { \
  12544. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12545. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12546. } while (0)
  12547. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12548. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12549. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12550. do { \
  12551. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12552. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12553. } while (0)
  12554. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12555. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12556. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12557. do { \
  12558. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12559. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12560. } while (0)
  12561. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12562. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12563. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12564. do { \
  12565. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12566. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12567. } while (0)
  12568. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12569. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12570. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12571. do { \
  12572. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12573. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12574. } while (0)
  12575. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12576. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12577. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12578. do { \
  12579. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12580. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12581. } while (0)
  12582. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12583. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12584. /*
  12585. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12586. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12587. * addresses are stored in a XXX-bit field.
  12588. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12589. * htt_tx_frag_desc64_bank_cfg_t structs.
  12590. */
  12591. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12592. _paddr_bits_, \
  12593. _paddr__bank_base_address_) \
  12594. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12595. /** word 0 \
  12596. * msg_type: 8, \
  12597. * pdev_id: 2, \
  12598. * swap: 1, \
  12599. * reserved0: 5, \
  12600. * num_banks: 8, \
  12601. * desc_size: 8; \
  12602. */ \
  12603. A_UINT32 word0; \
  12604. /* \
  12605. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12606. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12607. * the second A_UINT32). \
  12608. */ \
  12609. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12610. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12611. } POSTPACK
  12612. /* define htt_tx_frag_desc32_bank_cfg_t */
  12613. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12614. /* define htt_tx_frag_desc64_bank_cfg_t */
  12615. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12616. /*
  12617. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12618. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12619. */
  12620. #if HTT_PADDR64
  12621. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12622. #else
  12623. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12624. #endif
  12625. /**
  12626. * @brief target -> host HTT TX Credit total count update message definition
  12627. *
  12628. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12629. *
  12630. *|31 16|15|14 9| 8 |7 0 |
  12631. *|---------------------+--+----------+-------+----------|
  12632. *|cur htt credit delta | Q| reserved | sign | msg type |
  12633. *|------------------------------------------------------|
  12634. *
  12635. * Header fields:
  12636. * - MSG_TYPE
  12637. * Bits 7:0
  12638. * Purpose: identifies this as a htt tx credit delta update message
  12639. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12640. * - SIGN
  12641. * Bits 8
  12642. * identifies whether credit delta is positive or negative
  12643. * Value:
  12644. * - 0x0: credit delta is positive, rebalance in some buffers
  12645. * - 0x1: credit delta is negative, rebalance out some buffers
  12646. * - reserved
  12647. * Bits 14:9
  12648. * Value: 0x0
  12649. * - TXQ_GRP
  12650. * Bit 15
  12651. * Purpose: indicates whether any tx queue group information elements
  12652. * are appended to the tx credit update message
  12653. * Value: 0 -> no tx queue group information element is present
  12654. * 1 -> a tx queue group information element immediately follows
  12655. * - DELTA_COUNT
  12656. * Bits 31:16
  12657. * Purpose: Specify current htt credit delta absolute count
  12658. */
  12659. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12660. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12661. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12662. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12663. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12664. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12665. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12666. do { \
  12667. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12668. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12669. } while (0)
  12670. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12671. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12672. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12673. do { \
  12674. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12675. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12676. } while (0)
  12677. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12678. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12679. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12680. do { \
  12681. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12682. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12683. } while (0)
  12684. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12685. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12686. #define HTT_TX_CREDIT_MSG_BYTES 4
  12687. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12688. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12689. /**
  12690. * @brief HTT WDI_IPA Operation Response Message
  12691. *
  12692. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12693. *
  12694. * @details
  12695. * HTT WDI_IPA Operation Response message is sent by target
  12696. * to host confirming suspend or resume operation.
  12697. * |31 24|23 16|15 8|7 0|
  12698. * |----------------+----------------+----------------+----------------|
  12699. * | op_code | Rsvd | msg_type |
  12700. * |-------------------------------------------------------------------|
  12701. * | Rsvd | Response len |
  12702. * |-------------------------------------------------------------------|
  12703. * | |
  12704. * | Response-type specific info |
  12705. * | |
  12706. * | |
  12707. * |-------------------------------------------------------------------|
  12708. * Header fields:
  12709. * - MSG_TYPE
  12710. * Bits 7:0
  12711. * Purpose: Identifies this as WDI_IPA Operation Response message
  12712. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12713. * - OP_CODE
  12714. * Bits 31:16
  12715. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12716. * value: = enum htt_wdi_ipa_op_code
  12717. * - RSP_LEN
  12718. * Bits 16:0
  12719. * Purpose: length for the response-type specific info
  12720. * value: = length in bytes for response-type specific info
  12721. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12722. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12723. */
  12724. PREPACK struct htt_wdi_ipa_op_response_t
  12725. {
  12726. /* DWORD 0: flags and meta-data */
  12727. A_UINT32
  12728. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12729. reserved1: 8,
  12730. op_code: 16;
  12731. A_UINT32
  12732. rsp_len: 16,
  12733. reserved2: 16;
  12734. } POSTPACK;
  12735. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12736. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12737. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12738. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12739. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12740. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12741. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12742. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12743. do { \
  12744. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12745. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12746. } while (0)
  12747. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12748. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12749. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12750. do { \
  12751. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12752. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12753. } while (0)
  12754. enum htt_phy_mode {
  12755. htt_phy_mode_11a = 0,
  12756. htt_phy_mode_11g = 1,
  12757. htt_phy_mode_11b = 2,
  12758. htt_phy_mode_11g_only = 3,
  12759. htt_phy_mode_11na_ht20 = 4,
  12760. htt_phy_mode_11ng_ht20 = 5,
  12761. htt_phy_mode_11na_ht40 = 6,
  12762. htt_phy_mode_11ng_ht40 = 7,
  12763. htt_phy_mode_11ac_vht20 = 8,
  12764. htt_phy_mode_11ac_vht40 = 9,
  12765. htt_phy_mode_11ac_vht80 = 10,
  12766. htt_phy_mode_11ac_vht20_2g = 11,
  12767. htt_phy_mode_11ac_vht40_2g = 12,
  12768. htt_phy_mode_11ac_vht80_2g = 13,
  12769. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12770. htt_phy_mode_11ac_vht160 = 15,
  12771. htt_phy_mode_max,
  12772. };
  12773. /**
  12774. * @brief target -> host HTT channel change indication
  12775. *
  12776. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12777. *
  12778. * @details
  12779. * Specify when a channel change occurs.
  12780. * This allows the host to precisely determine which rx frames arrived
  12781. * on the old channel and which rx frames arrived on the new channel.
  12782. *
  12783. *|31 |7 0 |
  12784. *|-------------------------------------------+----------|
  12785. *| reserved | msg type |
  12786. *|------------------------------------------------------|
  12787. *| primary_chan_center_freq_mhz |
  12788. *|------------------------------------------------------|
  12789. *| contiguous_chan1_center_freq_mhz |
  12790. *|------------------------------------------------------|
  12791. *| contiguous_chan2_center_freq_mhz |
  12792. *|------------------------------------------------------|
  12793. *| phy_mode |
  12794. *|------------------------------------------------------|
  12795. *
  12796. * Header fields:
  12797. * - MSG_TYPE
  12798. * Bits 7:0
  12799. * Purpose: identifies this as a htt channel change indication message
  12800. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12801. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12802. * Bits 31:0
  12803. * Purpose: identify the (center of the) new 20 MHz primary channel
  12804. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12805. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12806. * Bits 31:0
  12807. * Purpose: identify the (center of the) contiguous frequency range
  12808. * comprising the new channel.
  12809. * For example, if the new channel is a 80 MHz channel extending
  12810. * 60 MHz beyond the primary channel, this field would be 30 larger
  12811. * than the primary channel center frequency field.
  12812. * Value: center frequency of the contiguous frequency range comprising
  12813. * the full channel in MHz units
  12814. * (80+80 channels also use the CONTIG_CHAN2 field)
  12815. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12816. * Bits 31:0
  12817. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12818. * within a VHT 80+80 channel.
  12819. * This field is only relevant for VHT 80+80 channels.
  12820. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12821. * channel (arbitrary value for cases besides VHT 80+80)
  12822. * - PHY_MODE
  12823. * Bits 31:0
  12824. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12825. * and band
  12826. * Value: htt_phy_mode enum value
  12827. */
  12828. PREPACK struct htt_chan_change_t
  12829. {
  12830. /* DWORD 0: flags and meta-data */
  12831. A_UINT32
  12832. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12833. reserved1: 24;
  12834. A_UINT32 primary_chan_center_freq_mhz;
  12835. A_UINT32 contig_chan1_center_freq_mhz;
  12836. A_UINT32 contig_chan2_center_freq_mhz;
  12837. A_UINT32 phy_mode;
  12838. } POSTPACK;
  12839. /*
  12840. * Due to historical / backwards-compatibility reasons, maintain the
  12841. * below htt_chan_change_msg struct definition, which needs to be
  12842. * consistent with the above htt_chan_change_t struct definition
  12843. * (aside from the htt_chan_change_t definition including the msg_type
  12844. * dword within the message, and the htt_chan_change_msg only containing
  12845. * the payload of the message that follows the msg_type dword).
  12846. */
  12847. PREPACK struct htt_chan_change_msg {
  12848. A_UINT32 chan_mhz; /* frequency in mhz */
  12849. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12850. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12851. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12852. } POSTPACK;
  12853. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12854. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12855. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12856. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12857. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12858. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12859. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12860. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12861. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12862. do { \
  12863. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12864. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12865. } while (0)
  12866. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12867. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12868. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12869. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12870. do { \
  12871. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12872. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12873. } while (0)
  12874. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12875. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12876. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12877. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12878. do { \
  12879. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12880. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12881. } while (0)
  12882. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12883. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12884. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12885. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12886. do { \
  12887. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12888. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12889. } while (0)
  12890. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12891. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12892. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12893. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12894. /**
  12895. * @brief rx offload packet error message
  12896. *
  12897. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12898. *
  12899. * @details
  12900. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12901. * of target payload like mic err.
  12902. *
  12903. * |31 24|23 16|15 8|7 0|
  12904. * |----------------+----------------+----------------+----------------|
  12905. * | tid | vdev_id | msg_sub_type | msg_type |
  12906. * |-------------------------------------------------------------------|
  12907. * : (sub-type dependent content) :
  12908. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12909. * Header fields:
  12910. * - msg_type
  12911. * Bits 7:0
  12912. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12913. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12914. * - msg_sub_type
  12915. * Bits 15:8
  12916. * Purpose: Identifies which type of rx error is reported by this message
  12917. * value: htt_rx_ofld_pkt_err_type
  12918. * - vdev_id
  12919. * Bits 23:16
  12920. * Purpose: Identifies which vdev received the erroneous rx frame
  12921. * value:
  12922. * - tid
  12923. * Bits 31:24
  12924. * Purpose: Identifies the traffic type of the rx frame
  12925. * value:
  12926. *
  12927. * - The payload fields used if the sub-type == MIC error are shown below.
  12928. * Note - MIC err is per MSDU, while PN is per MPDU.
  12929. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12930. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12931. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12932. * instead of sending separate HTT messages for each wrong MSDU within
  12933. * the MPDU.
  12934. *
  12935. * |31 24|23 16|15 8|7 0|
  12936. * |----------------+----------------+----------------+----------------|
  12937. * | Rsvd | key_id | peer_id |
  12938. * |-------------------------------------------------------------------|
  12939. * | receiver MAC addr 31:0 |
  12940. * |-------------------------------------------------------------------|
  12941. * | Rsvd | receiver MAC addr 47:32 |
  12942. * |-------------------------------------------------------------------|
  12943. * | transmitter MAC addr 31:0 |
  12944. * |-------------------------------------------------------------------|
  12945. * | Rsvd | transmitter MAC addr 47:32 |
  12946. * |-------------------------------------------------------------------|
  12947. * | PN 31:0 |
  12948. * |-------------------------------------------------------------------|
  12949. * | Rsvd | PN 47:32 |
  12950. * |-------------------------------------------------------------------|
  12951. * - peer_id
  12952. * Bits 15:0
  12953. * Purpose: identifies which peer is frame is from
  12954. * value:
  12955. * - key_id
  12956. * Bits 23:16
  12957. * Purpose: identifies key_id of rx frame
  12958. * value:
  12959. * - RA_31_0 (receiver MAC addr 31:0)
  12960. * Bits 31:0
  12961. * Purpose: identifies by MAC address which vdev received the frame
  12962. * value: MAC address lower 4 bytes
  12963. * - RA_47_32 (receiver MAC addr 47:32)
  12964. * Bits 15:0
  12965. * Purpose: identifies by MAC address which vdev received the frame
  12966. * value: MAC address upper 2 bytes
  12967. * - TA_31_0 (transmitter MAC addr 31:0)
  12968. * Bits 31:0
  12969. * Purpose: identifies by MAC address which peer transmitted the frame
  12970. * value: MAC address lower 4 bytes
  12971. * - TA_47_32 (transmitter MAC addr 47:32)
  12972. * Bits 15:0
  12973. * Purpose: identifies by MAC address which peer transmitted the frame
  12974. * value: MAC address upper 2 bytes
  12975. * - PN_31_0
  12976. * Bits 31:0
  12977. * Purpose: Identifies pn of rx frame
  12978. * value: PN lower 4 bytes
  12979. * - PN_47_32
  12980. * Bits 15:0
  12981. * Purpose: Identifies pn of rx frame
  12982. * value:
  12983. * TKIP or CCMP: PN upper 2 bytes
  12984. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12985. */
  12986. enum htt_rx_ofld_pkt_err_type {
  12987. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12988. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12989. };
  12990. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12991. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12992. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12993. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12994. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12995. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12996. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12997. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12998. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12999. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13000. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13001. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13002. do { \
  13003. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13004. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13005. } while (0)
  13006. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13007. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13008. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13009. do { \
  13010. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13011. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13012. } while (0)
  13013. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13014. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13015. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13016. do { \
  13017. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13018. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13019. } while (0)
  13020. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13021. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13022. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13023. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13024. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13025. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13026. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13027. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13028. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13029. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13030. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13031. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13032. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13033. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13034. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13035. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13036. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13037. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13038. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13039. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13040. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13041. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13042. do { \
  13043. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13044. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13045. } while (0)
  13046. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13047. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13048. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13049. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13050. do { \
  13051. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13052. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13053. } while (0)
  13054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13055. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13056. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13058. do { \
  13059. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13060. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13061. } while (0)
  13062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13063. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13064. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13066. do { \
  13067. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13068. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13069. } while (0)
  13070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13071. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13072. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13073. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13074. do { \
  13075. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13076. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13077. } while (0)
  13078. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13079. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13080. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13081. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13082. do { \
  13083. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13084. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13085. } while (0)
  13086. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13087. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13088. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13089. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13090. do { \
  13091. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13092. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13093. } while (0)
  13094. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13095. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13096. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13097. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13098. do { \
  13099. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13100. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13101. } while (0)
  13102. /**
  13103. * @brief target -> host peer rate report message
  13104. *
  13105. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13106. *
  13107. * @details
  13108. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13109. * justified rate of all the peers.
  13110. *
  13111. * |31 24|23 16|15 8|7 0|
  13112. * |----------------+----------------+----------------+----------------|
  13113. * | peer_count | | msg_type |
  13114. * |-------------------------------------------------------------------|
  13115. * : Payload (variant number of peer rate report) :
  13116. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13117. * Header fields:
  13118. * - msg_type
  13119. * Bits 7:0
  13120. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13121. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13122. * - reserved
  13123. * Bits 15:8
  13124. * Purpose:
  13125. * value:
  13126. * - peer_count
  13127. * Bits 31:16
  13128. * Purpose: Specify how many peer rate report elements are present in the payload.
  13129. * value:
  13130. *
  13131. * Payload:
  13132. * There are variant number of peer rate report follow the first 32 bits.
  13133. * The peer rate report is defined as follows.
  13134. *
  13135. * |31 20|19 16|15 0|
  13136. * |-----------------------+---------+---------------------------------|-
  13137. * | reserved | phy | peer_id | \
  13138. * |-------------------------------------------------------------------| -> report #0
  13139. * | rate | /
  13140. * |-----------------------+---------+---------------------------------|-
  13141. * | reserved | phy | peer_id | \
  13142. * |-------------------------------------------------------------------| -> report #1
  13143. * | rate | /
  13144. * |-----------------------+---------+---------------------------------|-
  13145. * | reserved | phy | peer_id | \
  13146. * |-------------------------------------------------------------------| -> report #2
  13147. * | rate | /
  13148. * |-------------------------------------------------------------------|-
  13149. * : :
  13150. * : :
  13151. * : :
  13152. * :-------------------------------------------------------------------:
  13153. *
  13154. * - peer_id
  13155. * Bits 15:0
  13156. * Purpose: identify the peer
  13157. * value:
  13158. * - phy
  13159. * Bits 19:16
  13160. * Purpose: identify which phy is in use
  13161. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13162. * Please see enum htt_peer_report_phy_type for detail.
  13163. * - reserved
  13164. * Bits 31:20
  13165. * Purpose:
  13166. * value:
  13167. * - rate
  13168. * Bits 31:0
  13169. * Purpose: represent the justified rate of the peer specified by peer_id
  13170. * value:
  13171. */
  13172. enum htt_peer_rate_report_phy_type {
  13173. HTT_PEER_RATE_REPORT_11B = 0,
  13174. HTT_PEER_RATE_REPORT_11A_G,
  13175. HTT_PEER_RATE_REPORT_11N,
  13176. HTT_PEER_RATE_REPORT_11AC,
  13177. };
  13178. #define HTT_PEER_RATE_REPORT_SIZE 8
  13179. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13180. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13181. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13182. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13183. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13184. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13185. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13186. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13187. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13188. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13189. do { \
  13190. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13191. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13192. } while (0)
  13193. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13194. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13195. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13196. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13197. do { \
  13198. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13199. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13200. } while (0)
  13201. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13202. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13203. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13204. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13205. do { \
  13206. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13207. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13208. } while (0)
  13209. /**
  13210. * @brief target -> host flow pool map message
  13211. *
  13212. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13213. *
  13214. * @details
  13215. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13216. * a flow of descriptors.
  13217. *
  13218. * This message is in TLV format and indicates the parameters to be setup a
  13219. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13220. * receive descriptors from a specified pool.
  13221. *
  13222. * The message would appear as follows:
  13223. *
  13224. * |31 24|23 16|15 8|7 0|
  13225. * |----------------+----------------+----------------+----------------|
  13226. * header | reserved | num_flows | msg_type |
  13227. * |-------------------------------------------------------------------|
  13228. * | |
  13229. * : payload :
  13230. * | |
  13231. * |-------------------------------------------------------------------|
  13232. *
  13233. * The header field is one DWORD long and is interpreted as follows:
  13234. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13235. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13236. * this message
  13237. * b'16-31 - reserved: These bits are reserved for future use
  13238. *
  13239. * Payload:
  13240. * The payload would contain multiple objects of the following structure. Each
  13241. * object represents a flow.
  13242. *
  13243. * |31 24|23 16|15 8|7 0|
  13244. * |----------------+----------------+----------------+----------------|
  13245. * header | reserved | num_flows | msg_type |
  13246. * |-------------------------------------------------------------------|
  13247. * payload0| flow_type |
  13248. * |-------------------------------------------------------------------|
  13249. * | flow_id |
  13250. * |-------------------------------------------------------------------|
  13251. * | reserved0 | flow_pool_id |
  13252. * |-------------------------------------------------------------------|
  13253. * | reserved1 | flow_pool_size |
  13254. * |-------------------------------------------------------------------|
  13255. * | reserved2 |
  13256. * |-------------------------------------------------------------------|
  13257. * payload1| flow_type |
  13258. * |-------------------------------------------------------------------|
  13259. * | flow_id |
  13260. * |-------------------------------------------------------------------|
  13261. * | reserved0 | flow_pool_id |
  13262. * |-------------------------------------------------------------------|
  13263. * | reserved1 | flow_pool_size |
  13264. * |-------------------------------------------------------------------|
  13265. * | reserved2 |
  13266. * |-------------------------------------------------------------------|
  13267. * | . |
  13268. * | . |
  13269. * | . |
  13270. * |-------------------------------------------------------------------|
  13271. *
  13272. * Each payload is 5 DWORDS long and is interpreted as follows:
  13273. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13274. * this flow is associated. It can be VDEV, peer,
  13275. * or tid (AC). Based on enum htt_flow_type.
  13276. *
  13277. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13278. * object. For flow_type vdev it is set to the
  13279. * vdevid, for peer it is peerid and for tid, it is
  13280. * tid_num.
  13281. *
  13282. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13283. * in the host for this flow
  13284. * b'16:31 - reserved0: This field in reserved for the future. In case
  13285. * we have a hierarchical implementation (HCM) of
  13286. * pools, it can be used to indicate the ID of the
  13287. * parent-pool.
  13288. *
  13289. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13290. * Descriptors for this flow will be
  13291. * allocated from this pool in the host.
  13292. * b'16:31 - reserved1: This field in reserved for the future. In case
  13293. * we have a hierarchical implementation of pools,
  13294. * it can be used to indicate the max number of
  13295. * descriptors in the pool. The b'0:15 can be used
  13296. * to indicate min number of descriptors in the
  13297. * HCM scheme.
  13298. *
  13299. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13300. * we have a hierarchical implementation of pools,
  13301. * b'0:15 can be used to indicate the
  13302. * priority-based borrowing (PBB) threshold of
  13303. * the flow's pool. The b'16:31 are still left
  13304. * reserved.
  13305. */
  13306. enum htt_flow_type {
  13307. FLOW_TYPE_VDEV = 0,
  13308. /* Insert new flow types above this line */
  13309. };
  13310. PREPACK struct htt_flow_pool_map_payload_t {
  13311. A_UINT32 flow_type;
  13312. A_UINT32 flow_id;
  13313. A_UINT32 flow_pool_id:16,
  13314. reserved0:16;
  13315. A_UINT32 flow_pool_size:16,
  13316. reserved1:16;
  13317. A_UINT32 reserved2;
  13318. } POSTPACK;
  13319. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13320. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13321. (sizeof(struct htt_flow_pool_map_payload_t))
  13322. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13323. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13324. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13325. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13326. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13327. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13328. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13329. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13330. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13331. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13332. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13333. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13334. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13335. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13336. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13337. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13338. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13339. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13340. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13341. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13342. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13343. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13344. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13345. do { \
  13346. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13347. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13348. } while (0)
  13349. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13350. do { \
  13351. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13352. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13353. } while (0)
  13354. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13355. do { \
  13356. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13357. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13358. } while (0)
  13359. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13360. do { \
  13361. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13362. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13363. } while (0)
  13364. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13365. do { \
  13366. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13367. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13368. } while (0)
  13369. /**
  13370. * @brief target -> host flow pool unmap message
  13371. *
  13372. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13373. *
  13374. * @details
  13375. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13376. * down a flow of descriptors.
  13377. * This message indicates that for the flow (whose ID is provided) is wanting
  13378. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13379. * pool of descriptors from where descriptors are being allocated for this
  13380. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13381. * be unmapped by the host.
  13382. *
  13383. * The message would appear as follows:
  13384. *
  13385. * |31 24|23 16|15 8|7 0|
  13386. * |----------------+----------------+----------------+----------------|
  13387. * | reserved0 | msg_type |
  13388. * |-------------------------------------------------------------------|
  13389. * | flow_type |
  13390. * |-------------------------------------------------------------------|
  13391. * | flow_id |
  13392. * |-------------------------------------------------------------------|
  13393. * | reserved1 | flow_pool_id |
  13394. * |-------------------------------------------------------------------|
  13395. *
  13396. * The message is interpreted as follows:
  13397. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13398. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13399. * b'8:31 - reserved0: Reserved for future use
  13400. *
  13401. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13402. * this flow is associated. It can be VDEV, peer,
  13403. * or tid (AC). Based on enum htt_flow_type.
  13404. *
  13405. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13406. * object. For flow_type vdev it is set to the
  13407. * vdevid, for peer it is peerid and for tid, it is
  13408. * tid_num.
  13409. *
  13410. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13411. * used in the host for this flow
  13412. * b'16:31 - reserved0: This field in reserved for the future.
  13413. *
  13414. */
  13415. PREPACK struct htt_flow_pool_unmap_t {
  13416. A_UINT32 msg_type:8,
  13417. reserved0:24;
  13418. A_UINT32 flow_type;
  13419. A_UINT32 flow_id;
  13420. A_UINT32 flow_pool_id:16,
  13421. reserved1:16;
  13422. } POSTPACK;
  13423. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13424. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13425. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13426. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13427. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13428. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13429. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13430. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13431. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13432. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13433. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13434. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13435. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13436. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13437. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13438. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13439. do { \
  13440. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13441. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13442. } while (0)
  13443. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13444. do { \
  13445. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13446. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13447. } while (0)
  13448. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13449. do { \
  13450. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13451. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13452. } while (0)
  13453. /**
  13454. * @brief target -> host SRING setup done message
  13455. *
  13456. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13457. *
  13458. * @details
  13459. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13460. * SRNG ring setup is done
  13461. *
  13462. * This message indicates whether the last setup operation is successful.
  13463. * It will be sent to host when host set respose_required bit in
  13464. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13465. * The message would appear as follows:
  13466. *
  13467. * |31 24|23 16|15 8|7 0|
  13468. * |--------------- +----------------+----------------+----------------|
  13469. * | setup_status | ring_id | pdev_id | msg_type |
  13470. * |-------------------------------------------------------------------|
  13471. *
  13472. * The message is interpreted as follows:
  13473. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13474. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13475. * b'8:15 - pdev_id:
  13476. * 0 (for rings at SOC/UMAC level),
  13477. * 1/2/3 mac id (for rings at LMAC level)
  13478. * b'16:23 - ring_id: Identify the ring which is set up
  13479. * More details can be got from enum htt_srng_ring_id
  13480. * b'24:31 - setup_status: Indicate status of setup operation
  13481. * Refer to htt_ring_setup_status
  13482. */
  13483. PREPACK struct htt_sring_setup_done_t {
  13484. A_UINT32 msg_type: 8,
  13485. pdev_id: 8,
  13486. ring_id: 8,
  13487. setup_status: 8;
  13488. } POSTPACK;
  13489. enum htt_ring_setup_status {
  13490. htt_ring_setup_status_ok = 0,
  13491. htt_ring_setup_status_error,
  13492. };
  13493. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13494. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13495. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13496. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13497. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13498. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13499. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13500. do { \
  13501. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13502. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13503. } while (0)
  13504. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13505. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13506. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13507. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13508. HTT_SRING_SETUP_DONE_RING_ID_S)
  13509. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13510. do { \
  13511. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13512. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13513. } while (0)
  13514. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13515. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13516. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13517. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13518. HTT_SRING_SETUP_DONE_STATUS_S)
  13519. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13520. do { \
  13521. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13522. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13523. } while (0)
  13524. /**
  13525. * @brief target -> flow map flow info
  13526. *
  13527. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13528. *
  13529. * @details
  13530. * HTT TX map flow entry with tqm flow pointer
  13531. * Sent from firmware to host to add tqm flow pointer in corresponding
  13532. * flow search entry. Flow metadata is replayed back to host as part of this
  13533. * struct to enable host to find the specific flow search entry
  13534. *
  13535. * The message would appear as follows:
  13536. *
  13537. * |31 28|27 18|17 14|13 8|7 0|
  13538. * |-------+------------------------------------------+----------------|
  13539. * | rsvd0 | fse_hsh_idx | msg_type |
  13540. * |-------------------------------------------------------------------|
  13541. * | rsvd1 | tid | peer_id |
  13542. * |-------------------------------------------------------------------|
  13543. * | tqm_flow_pntr_lo |
  13544. * |-------------------------------------------------------------------|
  13545. * | tqm_flow_pntr_hi |
  13546. * |-------------------------------------------------------------------|
  13547. * | fse_meta_data |
  13548. * |-------------------------------------------------------------------|
  13549. *
  13550. * The message is interpreted as follows:
  13551. *
  13552. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13553. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13554. *
  13555. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13556. * for this flow entry
  13557. *
  13558. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13559. *
  13560. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13561. *
  13562. * dword1 - b'14:17 - tid
  13563. *
  13564. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13565. *
  13566. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13567. *
  13568. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13569. *
  13570. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13571. * given by host
  13572. */
  13573. PREPACK struct htt_tx_map_flow_info {
  13574. A_UINT32
  13575. msg_type: 8,
  13576. fse_hsh_idx: 20,
  13577. rsvd0: 4;
  13578. A_UINT32
  13579. peer_id: 14,
  13580. tid: 4,
  13581. rsvd1: 14;
  13582. A_UINT32 tqm_flow_pntr_lo;
  13583. A_UINT32 tqm_flow_pntr_hi;
  13584. struct htt_tx_flow_metadata fse_meta_data;
  13585. } POSTPACK;
  13586. /* DWORD 0 */
  13587. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13588. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13589. /* DWORD 1 */
  13590. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13591. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13592. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13593. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13594. /* DWORD 0 */
  13595. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13596. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13597. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13598. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13599. do { \
  13600. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13601. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13602. } while (0)
  13603. /* DWORD 1 */
  13604. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13605. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13606. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13607. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13608. do { \
  13609. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13610. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13611. } while (0)
  13612. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13613. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13614. HTT_TX_MAP_FLOW_INFO_TID_S)
  13615. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13616. do { \
  13617. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13618. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13619. } while (0)
  13620. /*
  13621. * htt_dbg_ext_stats_status -
  13622. * present - The requested stats have been delivered in full.
  13623. * This indicates that either the stats information was contained
  13624. * in its entirety within this message, or else this message
  13625. * completes the delivery of the requested stats info that was
  13626. * partially delivered through earlier STATS_CONF messages.
  13627. * partial - The requested stats have been delivered in part.
  13628. * One or more subsequent STATS_CONF messages with the same
  13629. * cookie value will be sent to deliver the remainder of the
  13630. * information.
  13631. * error - The requested stats could not be delivered, for example due
  13632. * to a shortage of memory to construct a message holding the
  13633. * requested stats.
  13634. * invalid - The requested stat type is either not recognized, or the
  13635. * target is configured to not gather the stats type in question.
  13636. */
  13637. enum htt_dbg_ext_stats_status {
  13638. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13639. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13640. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13641. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13642. };
  13643. /**
  13644. * @brief target -> host ppdu stats upload
  13645. *
  13646. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13647. *
  13648. * @details
  13649. * The following field definitions describe the format of the HTT target
  13650. * to host ppdu stats indication message.
  13651. *
  13652. *
  13653. * |31 16|15 12|11 10|9 8|7 0 |
  13654. * |----------------------------------------------------------------------|
  13655. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13656. * |----------------------------------------------------------------------|
  13657. * | ppdu_id |
  13658. * |----------------------------------------------------------------------|
  13659. * | Timestamp in us |
  13660. * |----------------------------------------------------------------------|
  13661. * | reserved |
  13662. * |----------------------------------------------------------------------|
  13663. * | type-specific stats info |
  13664. * | (see htt_ppdu_stats.h) |
  13665. * |----------------------------------------------------------------------|
  13666. * Header fields:
  13667. * - MSG_TYPE
  13668. * Bits 7:0
  13669. * Purpose: Identifies this is a PPDU STATS indication
  13670. * message.
  13671. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13672. * - mac_id
  13673. * Bits 9:8
  13674. * Purpose: mac_id of this ppdu_id
  13675. * Value: 0-3
  13676. * - pdev_id
  13677. * Bits 11:10
  13678. * Purpose: pdev_id of this ppdu_id
  13679. * Value: 0-3
  13680. * 0 (for rings at SOC level),
  13681. * 1/2/3 PDEV -> 0/1/2
  13682. * - payload_size
  13683. * Bits 31:16
  13684. * Purpose: total tlv size
  13685. * Value: payload_size in bytes
  13686. */
  13687. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13688. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13689. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13690. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13691. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13692. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13693. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13694. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13695. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13696. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13697. do { \
  13698. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13699. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13700. } while (0)
  13701. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13702. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13703. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13704. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13705. do { \
  13706. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13707. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13708. } while (0)
  13709. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13710. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13711. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13712. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13713. do { \
  13714. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13715. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13716. } while (0)
  13717. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13718. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13719. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13720. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13721. do { \
  13722. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13723. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13724. } while (0)
  13725. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13726. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13727. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13728. /* htt_t2h_ppdu_stats_ind_hdr_t
  13729. * This struct contains the fields within the header of the
  13730. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13731. * stats info.
  13732. * This struct assumes little-endian layout, and thus is only
  13733. * suitable for use within processors known to be little-endian
  13734. * (such as the target).
  13735. * In contrast, the above macros provide endian-portable methods
  13736. * to get and set the bitfields within this PPDU_STATS_IND header.
  13737. */
  13738. typedef struct {
  13739. A_UINT32 msg_type: 8, /* bits 7:0 */
  13740. mac_id: 2, /* bits 9:8 */
  13741. pdev_id: 2, /* bits 11:10 */
  13742. reserved1: 4, /* bits 15:12 */
  13743. payload_size: 16; /* bits 31:16 */
  13744. A_UINT32 ppdu_id;
  13745. A_UINT32 timestamp_us;
  13746. A_UINT32 reserved2;
  13747. } htt_t2h_ppdu_stats_ind_hdr_t;
  13748. /**
  13749. * @brief target -> host extended statistics upload
  13750. *
  13751. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13752. *
  13753. * @details
  13754. * The following field definitions describe the format of the HTT target
  13755. * to host stats upload confirmation message.
  13756. * The message contains a cookie echoed from the HTT host->target stats
  13757. * upload request, which identifies which request the confirmation is
  13758. * for, and a single stats can span over multiple HTT stats indication
  13759. * due to the HTT message size limitation so every HTT ext stats indication
  13760. * will have tag-length-value stats information elements.
  13761. * The tag-length header for each HTT stats IND message also includes a
  13762. * status field, to indicate whether the request for the stat type in
  13763. * question was fully met, partially met, unable to be met, or invalid
  13764. * (if the stat type in question is disabled in the target).
  13765. * A Done bit 1's indicate the end of the of stats info elements.
  13766. *
  13767. *
  13768. * |31 16|15 12|11|10 8|7 5|4 0|
  13769. * |--------------------------------------------------------------|
  13770. * | reserved | msg type |
  13771. * |--------------------------------------------------------------|
  13772. * | cookie LSBs |
  13773. * |--------------------------------------------------------------|
  13774. * | cookie MSBs |
  13775. * |--------------------------------------------------------------|
  13776. * | stats entry length | rsvd | D| S | stat type |
  13777. * |--------------------------------------------------------------|
  13778. * | type-specific stats info |
  13779. * | (see htt_stats.h) |
  13780. * |--------------------------------------------------------------|
  13781. * Header fields:
  13782. * - MSG_TYPE
  13783. * Bits 7:0
  13784. * Purpose: Identifies this is a extended statistics upload confirmation
  13785. * message.
  13786. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13787. * - COOKIE_LSBS
  13788. * Bits 31:0
  13789. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13790. * message with its preceding host->target stats request message.
  13791. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13792. * - COOKIE_MSBS
  13793. * Bits 31:0
  13794. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13795. * message with its preceding host->target stats request message.
  13796. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13797. *
  13798. * Stats Information Element tag-length header fields:
  13799. * - STAT_TYPE
  13800. * Bits 7:0
  13801. * Purpose: identifies the type of statistics info held in the
  13802. * following information element
  13803. * Value: htt_dbg_ext_stats_type
  13804. * - STATUS
  13805. * Bits 10:8
  13806. * Purpose: indicate whether the requested stats are present
  13807. * Value: htt_dbg_ext_stats_status
  13808. * - DONE
  13809. * Bits 11
  13810. * Purpose:
  13811. * Indicates the completion of the stats entry, this will be the last
  13812. * stats conf HTT segment for the requested stats type.
  13813. * Value:
  13814. * 0 -> the stats retrieval is ongoing
  13815. * 1 -> the stats retrieval is complete
  13816. * - LENGTH
  13817. * Bits 31:16
  13818. * Purpose: indicate the stats information size
  13819. * Value: This field specifies the number of bytes of stats information
  13820. * that follows the element tag-length header.
  13821. * It is expected but not required that this length is a multiple of
  13822. * 4 bytes.
  13823. */
  13824. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13825. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13826. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13827. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13828. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13829. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13830. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13831. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13832. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13833. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13834. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13835. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13836. do { \
  13837. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13838. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13839. } while (0)
  13840. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13841. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13842. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13843. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13844. do { \
  13845. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13846. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13847. } while (0)
  13848. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13849. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13850. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13851. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13852. do { \
  13853. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13854. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13855. } while (0)
  13856. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13857. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13858. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13859. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13860. do { \
  13861. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13862. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13863. } while (0)
  13864. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13865. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13866. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13867. typedef enum {
  13868. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13869. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13870. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13871. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13872. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13873. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13874. /* Reserved from 128 - 255 for target internal use.*/
  13875. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13876. } HTT_PEER_TYPE;
  13877. /** macro to convert MAC address from char array to HTT word format */
  13878. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13879. (phtt_mac_addr)->mac_addr31to0 = \
  13880. (((c_macaddr)[0] << 0) | \
  13881. ((c_macaddr)[1] << 8) | \
  13882. ((c_macaddr)[2] << 16) | \
  13883. ((c_macaddr)[3] << 24)); \
  13884. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13885. } while (0)
  13886. /**
  13887. * @brief target -> host monitor mac header indication message
  13888. *
  13889. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13890. *
  13891. * @details
  13892. * The following diagram shows the format of the monitor mac header message
  13893. * sent from the target to the host.
  13894. * This message is primarily sent when promiscuous rx mode is enabled.
  13895. * One message is sent per rx PPDU.
  13896. *
  13897. * |31 24|23 16|15 8|7 0|
  13898. * |-------------------------------------------------------------|
  13899. * | peer_id | reserved0 | msg_type |
  13900. * |-------------------------------------------------------------|
  13901. * | reserved1 | num_mpdu |
  13902. * |-------------------------------------------------------------|
  13903. * | struct hw_rx_desc |
  13904. * | (see wal_rx_desc.h) |
  13905. * |-------------------------------------------------------------|
  13906. * | struct ieee80211_frame_addr4 |
  13907. * | (see ieee80211_defs.h) |
  13908. * |-------------------------------------------------------------|
  13909. * | struct ieee80211_frame_addr4 |
  13910. * | (see ieee80211_defs.h) |
  13911. * |-------------------------------------------------------------|
  13912. * | ...... |
  13913. * |-------------------------------------------------------------|
  13914. *
  13915. * Header fields:
  13916. * - msg_type
  13917. * Bits 7:0
  13918. * Purpose: Identifies this is a monitor mac header indication message.
  13919. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13920. * - peer_id
  13921. * Bits 31:16
  13922. * Purpose: Software peer id given by host during association,
  13923. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13924. * for rx PPDUs received from unassociated peers.
  13925. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13926. * - num_mpdu
  13927. * Bits 15:0
  13928. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13929. * delivered within the message.
  13930. * Value: 1 to 32
  13931. * num_mpdu is limited to a maximum value of 32, due to buffer
  13932. * size limits. For PPDUs with more than 32 MPDUs, only the
  13933. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13934. * the PPDU will be provided.
  13935. */
  13936. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13937. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13938. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13939. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13940. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13941. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13942. do { \
  13943. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13944. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13945. } while (0)
  13946. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13947. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13948. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13949. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13950. do { \
  13951. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13952. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13953. } while (0)
  13954. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13955. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13956. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13957. /**
  13958. * @brief target -> host flow pool resize Message
  13959. *
  13960. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13961. *
  13962. * @details
  13963. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13964. * the flow pool associated with the specified ID is resized
  13965. *
  13966. * The message would appear as follows:
  13967. *
  13968. * |31 16|15 8|7 0|
  13969. * |---------------------------------+----------------+----------------|
  13970. * | reserved0 | Msg type |
  13971. * |-------------------------------------------------------------------|
  13972. * | flow pool new size | flow pool ID |
  13973. * |-------------------------------------------------------------------|
  13974. *
  13975. * The message is interpreted as follows:
  13976. * b'0:7 - msg_type: This will be set to 0x21
  13977. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13978. *
  13979. * b'0:15 - flow pool ID: Existing flow pool ID
  13980. *
  13981. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13982. *
  13983. */
  13984. PREPACK struct htt_flow_pool_resize_t {
  13985. A_UINT32 msg_type:8,
  13986. reserved0:24;
  13987. A_UINT32 flow_pool_id:16,
  13988. flow_pool_new_size:16;
  13989. } POSTPACK;
  13990. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13991. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13992. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13993. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13994. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13995. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13996. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13997. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13998. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13999. do { \
  14000. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14001. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14002. } while (0)
  14003. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14004. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14005. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14006. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14007. do { \
  14008. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14009. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14010. } while (0)
  14011. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14012. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14013. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14014. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14015. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14016. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14017. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14018. /*
  14019. * The read and write indices point to the data within the host buffer.
  14020. * Because the first 4 bytes of the host buffer is used for the read index and
  14021. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14022. * The read index and write index are the byte offsets from the base of the
  14023. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14024. * Refer the ASCII text picture below.
  14025. */
  14026. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14027. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14028. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14029. /*
  14030. ***************************************************************************
  14031. *
  14032. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14033. *
  14034. ***************************************************************************
  14035. *
  14036. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14037. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14038. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14039. * written into the Host memory region mentioned below.
  14040. *
  14041. * Read index is updated by the Host. At any point of time, the read index will
  14042. * indicate the index that will next be read by the Host. The read index is
  14043. * in units of bytes offset from the base of the meta-data buffer.
  14044. *
  14045. * Write index is updated by the FW. At any point of time, the write index will
  14046. * indicate from where the FW can start writing any new data. The write index is
  14047. * in units of bytes offset from the base of the meta-data buffer.
  14048. *
  14049. * If the Host is not fast enough in reading the CFR data, any new capture data
  14050. * would be dropped if there is no space left to write the new captures.
  14051. *
  14052. * The last 4 bytes of the memory region will have the magic pattern
  14053. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14054. * not overrun the host buffer.
  14055. *
  14056. * ,--------------------. read and write indices store the
  14057. * | | byte offset from the base of the
  14058. * | ,--------+--------. meta-data buffer to the next
  14059. * | | | | location within the data buffer
  14060. * | | v v that will be read / written
  14061. * ************************************************************************
  14062. * * Read * Write * * Magic *
  14063. * * index * index * CFR data1 ...... CFR data N * pattern *
  14064. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14065. * ************************************************************************
  14066. * |<---------- data buffer ---------->|
  14067. *
  14068. * |<----------------- meta-data buffer allocated in Host ----------------|
  14069. *
  14070. * Note:
  14071. * - Considering the 4 bytes needed to store the Read index (R) and the
  14072. * Write index (W), the initial value is as follows:
  14073. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14074. * - Buffer empty condition:
  14075. * R = W
  14076. *
  14077. * Regarding CFR data format:
  14078. * --------------------------
  14079. *
  14080. * Each CFR tone is stored in HW as 16-bits with the following format:
  14081. * {bits[15:12], bits[11:6], bits[5:0]} =
  14082. * {unsigned exponent (4 bits),
  14083. * signed mantissa_real (6 bits),
  14084. * signed mantissa_imag (6 bits)}
  14085. *
  14086. * CFR_real = mantissa_real * 2^(exponent-5)
  14087. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14088. *
  14089. *
  14090. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14091. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14092. *
  14093. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14094. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14095. * .
  14096. * .
  14097. * .
  14098. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14099. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14100. */
  14101. /* Bandwidth of peer CFR captures */
  14102. typedef enum {
  14103. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14104. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14105. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14106. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14107. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14108. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14109. } HTT_PEER_CFR_CAPTURE_BW;
  14110. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14111. * was captured
  14112. */
  14113. typedef enum {
  14114. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14115. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14116. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14117. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14118. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14119. } HTT_PEER_CFR_CAPTURE_MODE;
  14120. typedef enum {
  14121. /* This message type is currently used for the below purpose:
  14122. *
  14123. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14124. * wmi_peer_cfr_capture_cmd.
  14125. * If payload_present bit is set to 0 then the associated memory region
  14126. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14127. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14128. * message; the CFR dump will be present at the end of the message,
  14129. * after the chan_phy_mode.
  14130. */
  14131. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14132. /* Always keep this last */
  14133. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14134. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14135. /**
  14136. * @brief target -> host CFR dump completion indication message definition
  14137. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14138. *
  14139. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14140. *
  14141. * @details
  14142. * The following diagram shows the format of the Channel Frequency Response
  14143. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14144. * the channel capture of a peer is copied by Firmware into the Host memory
  14145. *
  14146. * **************************************************************************
  14147. *
  14148. * Message format when the CFR capture message type is
  14149. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14150. *
  14151. * **************************************************************************
  14152. *
  14153. * |31 16|15 |8|7 0|
  14154. * |----------------------------------------------------------------|
  14155. * header: | reserved |P| msg_type |
  14156. * word 0 | | | |
  14157. * |----------------------------------------------------------------|
  14158. * payload: | cfr_capture_msg_type |
  14159. * word 1 | |
  14160. * |----------------------------------------------------------------|
  14161. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14162. * word 2 | | | | | | | | |
  14163. * |----------------------------------------------------------------|
  14164. * | mac_addr31to0 |
  14165. * word 3 | |
  14166. * |----------------------------------------------------------------|
  14167. * | unused / reserved | mac_addr47to32 |
  14168. * word 4 | | |
  14169. * |----------------------------------------------------------------|
  14170. * | index |
  14171. * word 5 | |
  14172. * |----------------------------------------------------------------|
  14173. * | length |
  14174. * word 6 | |
  14175. * |----------------------------------------------------------------|
  14176. * | timestamp |
  14177. * word 7 | |
  14178. * |----------------------------------------------------------------|
  14179. * | counter |
  14180. * word 8 | |
  14181. * |----------------------------------------------------------------|
  14182. * | chan_mhz |
  14183. * word 9 | |
  14184. * |----------------------------------------------------------------|
  14185. * | band_center_freq1 |
  14186. * word 10 | |
  14187. * |----------------------------------------------------------------|
  14188. * | band_center_freq2 |
  14189. * word 11 | |
  14190. * |----------------------------------------------------------------|
  14191. * | chan_phy_mode |
  14192. * word 12 | |
  14193. * |----------------------------------------------------------------|
  14194. * where,
  14195. * P - payload present bit (payload_present explained below)
  14196. * req_id - memory request id (mem_req_id explained below)
  14197. * S - status field (status explained below)
  14198. * capbw - capture bandwidth (capture_bw explained below)
  14199. * mode - mode of capture (mode explained below)
  14200. * sts - space time streams (sts_count explained below)
  14201. * chbw - channel bandwidth (channel_bw explained below)
  14202. * captype - capture type (cap_type explained below)
  14203. *
  14204. * The following field definitions describe the format of the CFR dump
  14205. * completion indication sent from the target to the host
  14206. *
  14207. * Header fields:
  14208. *
  14209. * Word 0
  14210. * - msg_type
  14211. * Bits 7:0
  14212. * Purpose: Identifies this as CFR TX completion indication
  14213. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14214. * - payload_present
  14215. * Bit 8
  14216. * Purpose: Identifies how CFR data is sent to host
  14217. * Value: 0 - If CFR Payload is written to host memory
  14218. * 1 - If CFR Payload is sent as part of HTT message
  14219. * (This is the requirement for SDIO/USB where it is
  14220. * not possible to write CFR data to host memory)
  14221. * - reserved
  14222. * Bits 31:9
  14223. * Purpose: Reserved
  14224. * Value: 0
  14225. *
  14226. * Payload fields:
  14227. *
  14228. * Word 1
  14229. * - cfr_capture_msg_type
  14230. * Bits 31:0
  14231. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14232. * to specify the format used for the remainder of the message
  14233. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14234. * (currently only MSG_TYPE_1 is defined)
  14235. *
  14236. * Word 2
  14237. * - mem_req_id
  14238. * Bits 6:0
  14239. * Purpose: Contain the mem request id of the region where the CFR capture
  14240. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14241. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14242. this value is invalid)
  14243. * - status
  14244. * Bit 7
  14245. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14246. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14247. * - capture_bw
  14248. * Bits 10:8
  14249. * Purpose: Carry the bandwidth of the CFR capture
  14250. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14251. * - mode
  14252. * Bits 13:11
  14253. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14254. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14255. * - sts_count
  14256. * Bits 16:14
  14257. * Purpose: Carry the number of space time streams
  14258. * Value: Number of space time streams
  14259. * - channel_bw
  14260. * Bits 19:17
  14261. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14262. * measurement
  14263. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14264. * - cap_type
  14265. * Bits 23:20
  14266. * Purpose: Carry the type of the capture
  14267. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14268. * - vdev_id
  14269. * Bits 31:24
  14270. * Purpose: Carry the virtual device id
  14271. * Value: vdev ID
  14272. *
  14273. * Word 3
  14274. * - mac_addr31to0
  14275. * Bits 31:0
  14276. * Purpose: Contain the bits 31:0 of the peer MAC address
  14277. * Value: Bits 31:0 of the peer MAC address
  14278. *
  14279. * Word 4
  14280. * - mac_addr47to32
  14281. * Bits 15:0
  14282. * Purpose: Contain the bits 47:32 of the peer MAC address
  14283. * Value: Bits 47:32 of the peer MAC address
  14284. *
  14285. * Word 5
  14286. * - index
  14287. * Bits 31:0
  14288. * Purpose: Contain the index at which this CFR dump was written in the Host
  14289. * allocated memory. This index is the number of bytes from the base address.
  14290. * Value: Index position
  14291. *
  14292. * Word 6
  14293. * - length
  14294. * Bits 31:0
  14295. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14296. * Value: Length of the CFR capture of the peer
  14297. *
  14298. * Word 7
  14299. * - timestamp
  14300. * Bits 31:0
  14301. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14302. * clock used for this timestamp is private to the target and not visible to
  14303. * the host i.e., Host can interpret only the relative timestamp deltas from
  14304. * one message to the next, but can't interpret the absolute timestamp from a
  14305. * single message.
  14306. * Value: Timestamp in microseconds
  14307. *
  14308. * Word 8
  14309. * - counter
  14310. * Bits 31:0
  14311. * Purpose: Carry the count of the current CFR capture from FW. This is
  14312. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14313. * in host memory)
  14314. * Value: Count of the current CFR capture
  14315. *
  14316. * Word 9
  14317. * - chan_mhz
  14318. * Bits 31:0
  14319. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14320. * Value: Primary 20 channel frequency
  14321. *
  14322. * Word 10
  14323. * - band_center_freq1
  14324. * Bits 31:0
  14325. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14326. * Value: Center frequency 1 in MHz
  14327. *
  14328. * Word 11
  14329. * - band_center_freq2
  14330. * Bits 31:0
  14331. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14332. * the VDEV
  14333. * 80plus80 mode
  14334. * Value: Center frequency 2 in MHz
  14335. *
  14336. * Word 12
  14337. * - chan_phy_mode
  14338. * Bits 31:0
  14339. * Purpose: Carry the phy mode of the channel, of the VDEV
  14340. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14341. */
  14342. PREPACK struct htt_cfr_dump_ind_type_1 {
  14343. A_UINT32 mem_req_id:7,
  14344. status:1,
  14345. capture_bw:3,
  14346. mode:3,
  14347. sts_count:3,
  14348. channel_bw:3,
  14349. cap_type:4,
  14350. vdev_id:8;
  14351. htt_mac_addr addr;
  14352. A_UINT32 index;
  14353. A_UINT32 length;
  14354. A_UINT32 timestamp;
  14355. A_UINT32 counter;
  14356. struct htt_chan_change_msg chan;
  14357. } POSTPACK;
  14358. PREPACK struct htt_cfr_dump_compl_ind {
  14359. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14360. union {
  14361. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14362. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14363. /* If there is a need to change the memory layout and its associated
  14364. * HTT indication format, a new CFR capture message type can be
  14365. * introduced and added into this union.
  14366. */
  14367. };
  14368. } POSTPACK;
  14369. /*
  14370. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14371. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14372. */
  14373. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14374. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14375. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14376. do { \
  14377. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14378. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14379. } while(0)
  14380. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14381. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14382. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14383. /*
  14384. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14385. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14386. */
  14387. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14388. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14389. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14390. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14391. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14392. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14393. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14394. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14395. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14396. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14397. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14398. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14399. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14400. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14401. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14402. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14403. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14404. do { \
  14405. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14406. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14407. } while (0)
  14408. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14409. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14410. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14411. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14412. do { \
  14413. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14414. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14415. } while (0)
  14416. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14417. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14418. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14419. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14420. do { \
  14421. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14422. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14423. } while (0)
  14424. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14425. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14426. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14427. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14428. do { \
  14429. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14430. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14431. } while (0)
  14432. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14433. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14434. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14435. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14436. do { \
  14437. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14438. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14439. } while (0)
  14440. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14441. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14442. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14443. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14444. do { \
  14445. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14446. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14447. } while (0)
  14448. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14449. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14450. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14451. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14452. do { \
  14453. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14454. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14455. } while (0)
  14456. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14457. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14458. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14459. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14460. do { \
  14461. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14462. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14463. } while (0)
  14464. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14465. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14466. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14467. /**
  14468. * @brief target -> host peer (PPDU) stats message
  14469. *
  14470. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14471. *
  14472. * @details
  14473. * This message is generated by FW when FW is sending stats to host
  14474. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14475. * This message is sent autonomously by the target rather than upon request
  14476. * by the host.
  14477. * The following field definitions describe the format of the HTT target
  14478. * to host peer stats indication message.
  14479. *
  14480. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14481. * or more PPDU stats records.
  14482. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14483. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14484. * then the message would start with the
  14485. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14486. * below.
  14487. *
  14488. * |31 16|15|14|13 11|10 9|8|7 0|
  14489. * |-------------------------------------------------------------|
  14490. * | reserved |MSG_TYPE |
  14491. * |-------------------------------------------------------------|
  14492. * rec 0 | TLV header |
  14493. * rec 0 |-------------------------------------------------------------|
  14494. * rec 0 | ppdu successful bytes |
  14495. * rec 0 |-------------------------------------------------------------|
  14496. * rec 0 | ppdu retry bytes |
  14497. * rec 0 |-------------------------------------------------------------|
  14498. * rec 0 | ppdu failed bytes |
  14499. * rec 0 |-------------------------------------------------------------|
  14500. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14501. * rec 0 |-------------------------------------------------------------|
  14502. * rec 0 | retried MSDUs | successful MSDUs |
  14503. * rec 0 |-------------------------------------------------------------|
  14504. * rec 0 | TX duration | failed MSDUs |
  14505. * rec 0 |-------------------------------------------------------------|
  14506. * ...
  14507. * |-------------------------------------------------------------|
  14508. * rec N | TLV header |
  14509. * rec N |-------------------------------------------------------------|
  14510. * rec N | ppdu successful bytes |
  14511. * rec N |-------------------------------------------------------------|
  14512. * rec N | ppdu retry bytes |
  14513. * rec N |-------------------------------------------------------------|
  14514. * rec N | ppdu failed bytes |
  14515. * rec N |-------------------------------------------------------------|
  14516. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14517. * rec N |-------------------------------------------------------------|
  14518. * rec N | retried MSDUs | successful MSDUs |
  14519. * rec N |-------------------------------------------------------------|
  14520. * rec N | TX duration | failed MSDUs |
  14521. * rec N |-------------------------------------------------------------|
  14522. *
  14523. * where:
  14524. * A = is A-MPDU flag
  14525. * BA = block-ack failure flags
  14526. * BW = bandwidth spec
  14527. * SG = SGI enabled spec
  14528. * S = skipped rate ctrl
  14529. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14530. *
  14531. * Header
  14532. * ------
  14533. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14534. * dword0 - b'8:31 - reserved : Reserved for future use
  14535. *
  14536. * payload include below peer_stats information
  14537. * --------------------------------------------
  14538. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14539. * @tx_success_bytes : total successful bytes in the PPDU.
  14540. * @tx_retry_bytes : total retried bytes in the PPDU.
  14541. * @tx_failed_bytes : total failed bytes in the PPDU.
  14542. * @tx_ratecode : rate code used for the PPDU.
  14543. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14544. * @ba_ack_failed : BA/ACK failed for this PPDU
  14545. * b00 -> BA received
  14546. * b01 -> BA failed once
  14547. * b10 -> BA failed twice, when HW retry is enabled.
  14548. * @bw : BW
  14549. * b00 -> 20 MHz
  14550. * b01 -> 40 MHz
  14551. * b10 -> 80 MHz
  14552. * b11 -> 160 MHz (or 80+80)
  14553. * @sg : SGI enabled
  14554. * @s : skipped ratectrl
  14555. * @peer_id : peer id
  14556. * @tx_success_msdus : successful MSDUs
  14557. * @tx_retry_msdus : retried MSDUs
  14558. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14559. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14560. */
  14561. /**
  14562. * @brief target -> host backpressure event
  14563. *
  14564. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14565. *
  14566. * @details
  14567. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14568. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14569. * This message will only be sent if the backpressure condition has existed
  14570. * continuously for an initial period (100 ms).
  14571. * Repeat messages with updated information will be sent after each
  14572. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14573. * This message indicates the ring id along with current head and tail index
  14574. * locations (i.e. write and read indices).
  14575. * The backpressure time indicates the time in ms for which continous
  14576. * backpressure has been observed in the ring.
  14577. *
  14578. * The message format is as follows:
  14579. *
  14580. * |31 24|23 16|15 8|7 0|
  14581. * |----------------+----------------+----------------+----------------|
  14582. * | ring_id | ring_type | pdev_id | msg_type |
  14583. * |-------------------------------------------------------------------|
  14584. * | tail_idx | head_idx |
  14585. * |-------------------------------------------------------------------|
  14586. * | backpressure_time_ms |
  14587. * |-------------------------------------------------------------------|
  14588. *
  14589. * The message is interpreted as follows:
  14590. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14591. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14592. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14593. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14594. the msg is for LMAC ring.
  14595. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14596. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14597. * htt_backpressure_lmac_ring_id. This represents
  14598. * the ring id for which continous backpressure is seen
  14599. *
  14600. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14601. * the ring indicated by the ring_id
  14602. *
  14603. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14604. * the ring indicated by the ring id
  14605. *
  14606. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14607. * backpressure has been seen in the ring
  14608. * indicated by the ring_id.
  14609. * Units = milliseconds
  14610. */
  14611. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14612. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14613. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14614. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14615. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14616. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14617. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14618. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14619. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14620. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14621. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14622. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14623. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14624. do { \
  14625. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14626. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14627. } while (0)
  14628. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14629. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14630. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14631. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14632. do { \
  14633. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14634. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14635. } while (0)
  14636. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14637. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14638. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14639. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14640. do { \
  14641. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14642. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14643. } while (0)
  14644. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14645. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14646. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14647. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14648. do { \
  14649. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14650. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14651. } while (0)
  14652. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14653. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14654. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14655. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14656. do { \
  14657. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14658. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14659. } while (0)
  14660. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14661. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14662. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14663. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14664. do { \
  14665. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14666. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14667. } while (0)
  14668. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14669. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14670. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14671. enum htt_backpressure_ring_type {
  14672. HTT_SW_RING_TYPE_UMAC,
  14673. HTT_SW_RING_TYPE_LMAC,
  14674. HTT_SW_RING_TYPE_MAX,
  14675. };
  14676. /* Ring id for which the message is sent to host */
  14677. enum htt_backpressure_umac_ringid {
  14678. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14679. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14680. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14681. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14682. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14683. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14684. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14685. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14686. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14687. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14688. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14689. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14690. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14691. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14692. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14693. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14694. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14695. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14696. HTT_SW_UMAC_RING_IDX_MAX,
  14697. };
  14698. enum htt_backpressure_lmac_ringid {
  14699. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14700. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14701. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14702. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14703. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14704. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14705. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14706. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14707. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14708. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14709. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14710. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14711. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14712. HTT_SW_LMAC_RING_IDX_MAX,
  14713. };
  14714. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14715. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14716. pdev_id: 8,
  14717. ring_type: 8, /* htt_backpressure_ring_type */
  14718. /*
  14719. * ring_id holds an enum value from either
  14720. * htt_backpressure_umac_ringid or
  14721. * htt_backpressure_lmac_ringid, based on
  14722. * the ring_type setting.
  14723. */
  14724. ring_id: 8;
  14725. A_UINT16 head_idx;
  14726. A_UINT16 tail_idx;
  14727. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14728. } POSTPACK;
  14729. /*
  14730. * Defines two 32 bit words that can be used by the target to indicate a per
  14731. * user RU allocation and rate information.
  14732. *
  14733. * This information is currently provided in the "sw_response_reference_ptr"
  14734. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14735. * "rx_ppdu_end_user_stats" TLV.
  14736. *
  14737. * VALID:
  14738. * The consumer of these words must explicitly check the valid bit,
  14739. * and only attempt interpretation of any of the remaining fields if
  14740. * the valid bit is set to 1.
  14741. *
  14742. * VERSION:
  14743. * The consumer of these words must also explicitly check the version bit,
  14744. * and only use the V0 definition if the VERSION field is set to 0.
  14745. *
  14746. * Version 1 is currently undefined, with the exception of the VALID and
  14747. * VERSION fields.
  14748. *
  14749. * Version 0:
  14750. *
  14751. * The fields below are duplicated per BW.
  14752. *
  14753. * The consumer must determine which BW field to use, based on the UL OFDMA
  14754. * PPDU BW indicated by HW.
  14755. *
  14756. * RU_START: RU26 start index for the user.
  14757. * Note that this is always using the RU26 index, regardless
  14758. * of the actual RU assigned to the user
  14759. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14760. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14761. *
  14762. * For example, 20MHz (the value in the top row is RU_START)
  14763. *
  14764. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14765. * RU Size 1 (52): | | | | | |
  14766. * RU Size 2 (106): | | | |
  14767. * RU Size 3 (242): | |
  14768. *
  14769. * RU_SIZE: Indicates the RU size, as defined by enum
  14770. * htt_ul_ofdma_user_info_ru_size.
  14771. *
  14772. * LDPC: LDPC enabled (if 0, BCC is used)
  14773. *
  14774. * DCM: DCM enabled
  14775. *
  14776. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14777. * |---------------------------------+--------------------------------|
  14778. * |Ver|Valid| FW internal |
  14779. * |---------------------------------+--------------------------------|
  14780. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14781. * |---------------------------------+--------------------------------|
  14782. */
  14783. enum htt_ul_ofdma_user_info_ru_size {
  14784. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14785. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14786. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14787. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14788. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14789. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14790. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14791. };
  14792. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14793. struct htt_ul_ofdma_user_info_v0 {
  14794. A_UINT32 word0;
  14795. A_UINT32 word1;
  14796. };
  14797. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14798. A_UINT32 w0_fw_rsvd:30; \
  14799. A_UINT32 w0_valid:1; \
  14800. A_UINT32 w0_version:1;
  14801. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14802. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14803. };
  14804. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14805. A_UINT32 w1_nss:3; \
  14806. A_UINT32 w1_mcs:4; \
  14807. A_UINT32 w1_ldpc:1; \
  14808. A_UINT32 w1_dcm:1; \
  14809. A_UINT32 w1_ru_start:7; \
  14810. A_UINT32 w1_ru_size:3; \
  14811. A_UINT32 w1_trig_type:4; \
  14812. A_UINT32 w1_unused:9;
  14813. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14814. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14815. };
  14816. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14817. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14818. union {
  14819. A_UINT32 word0;
  14820. struct {
  14821. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14822. };
  14823. };
  14824. union {
  14825. A_UINT32 word1;
  14826. struct {
  14827. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14828. };
  14829. };
  14830. } POSTPACK;
  14831. enum HTT_UL_OFDMA_TRIG_TYPE {
  14832. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14833. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14834. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14835. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14836. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14837. };
  14838. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14839. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14840. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14841. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14842. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14843. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14844. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14845. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14846. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14847. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14848. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14849. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14850. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14851. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14852. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14853. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14854. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14855. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14856. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14857. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14858. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14859. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14860. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14861. /*--- word 0 ---*/
  14862. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14863. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14864. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14865. do { \
  14866. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14867. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14868. } while (0)
  14869. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14870. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14871. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14872. do { \
  14873. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14874. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14875. } while (0)
  14876. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14877. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14878. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14879. do { \
  14880. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14881. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14882. } while (0)
  14883. /*--- word 1 ---*/
  14884. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14885. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14886. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14887. do { \
  14888. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14889. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14890. } while (0)
  14891. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14892. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14893. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14894. do { \
  14895. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14896. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14897. } while (0)
  14898. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14899. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14900. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14901. do { \
  14902. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14903. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14904. } while (0)
  14905. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14906. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14907. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14908. do { \
  14909. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14910. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14911. } while (0)
  14912. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14913. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14914. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14915. do { \
  14916. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14917. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14918. } while (0)
  14919. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14920. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14921. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14922. do { \
  14923. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14924. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14925. } while (0)
  14926. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14927. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14928. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14929. do { \
  14930. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14931. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14932. } while (0)
  14933. /**
  14934. * @brief target -> host channel calibration data message
  14935. *
  14936. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14937. *
  14938. * @brief host -> target channel calibration data message
  14939. *
  14940. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14941. *
  14942. * @details
  14943. * The following field definitions describe the format of the channel
  14944. * calibration data message sent from the target to the host when
  14945. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14946. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14947. * The message is defined as htt_chan_caldata_msg followed by a variable
  14948. * number of 32-bit character values.
  14949. *
  14950. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14951. * |------------------------------------------------------------------|
  14952. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14953. * |------------------------------------------------------------------|
  14954. * | payload size | mhz |
  14955. * |------------------------------------------------------------------|
  14956. * | center frequency 2 | center frequency 1 |
  14957. * |------------------------------------------------------------------|
  14958. * | check sum |
  14959. * |------------------------------------------------------------------|
  14960. * | payload |
  14961. * |------------------------------------------------------------------|
  14962. * message info field:
  14963. * - MSG_TYPE
  14964. * Bits 7:0
  14965. * Purpose: identifies this as a channel calibration data message
  14966. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14967. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14968. * - SUB_TYPE
  14969. * Bits 11:8
  14970. * Purpose: T2H: indicates whether target is providing chan cal data
  14971. * to the host to store, or requesting that the host
  14972. * download previously-stored data.
  14973. * H2T: indicates whether the host is providing the requested
  14974. * channel cal data, or if it is rejecting the data
  14975. * request because it does not have the requested data.
  14976. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14977. * - CHKSUM_VALID
  14978. * Bit 12
  14979. * Purpose: indicates if the checksum field is valid
  14980. * value:
  14981. * - FRAG
  14982. * Bit 19:16
  14983. * Purpose: indicates the fragment index for message
  14984. * value: 0 for first fragment, 1 for second fragment, ...
  14985. * - APPEND
  14986. * Bit 20
  14987. * Purpose: indicates if this is the last fragment
  14988. * value: 0 = final fragment, 1 = more fragments will be appended
  14989. *
  14990. * channel and payload size field
  14991. * - MHZ
  14992. * Bits 15:0
  14993. * Purpose: indicates the channel primary frequency
  14994. * Value:
  14995. * - PAYLOAD_SIZE
  14996. * Bits 31:16
  14997. * Purpose: indicates the bytes of calibration data in payload
  14998. * Value:
  14999. *
  15000. * center frequency field
  15001. * - CENTER FREQUENCY 1
  15002. * Bits 15:0
  15003. * Purpose: indicates the channel center frequency
  15004. * Value: channel center frequency, in MHz units
  15005. * - CENTER FREQUENCY 2
  15006. * Bits 31:16
  15007. * Purpose: indicates the secondary channel center frequency,
  15008. * only for 11acvht 80plus80 mode
  15009. * Value: secondary channel center frequeny, in MHz units, if applicable
  15010. *
  15011. * checksum field
  15012. * - CHECK_SUM
  15013. * Bits 31:0
  15014. * Purpose: check the payload data, it is just for this fragment.
  15015. * This is intended for the target to check that the channel
  15016. * calibration data returned by the host is the unmodified data
  15017. * that was previously provided to the host by the target.
  15018. * value: checksum of fragment payload
  15019. */
  15020. PREPACK struct htt_chan_caldata_msg {
  15021. /* DWORD 0: message info */
  15022. A_UINT32
  15023. msg_type: 8,
  15024. sub_type: 4 ,
  15025. chksum_valid: 1, /** 1:valid, 0:invalid */
  15026. reserved1: 3,
  15027. frag_idx: 4, /** fragment index for calibration data */
  15028. appending: 1, /** 0: no fragment appending,
  15029. * 1: extra fragment appending */
  15030. reserved2: 11;
  15031. /* DWORD 1: channel and payload size */
  15032. A_UINT32
  15033. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15034. payload_size: 16; /** unit: bytes */
  15035. /* DWORD 2: center frequency */
  15036. A_UINT32
  15037. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15038. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15039. * valid only for 11acvht 80plus80 mode */
  15040. /* DWORD 3: check sum */
  15041. A_UINT32 chksum;
  15042. /* variable length for calibration data */
  15043. A_UINT32 payload[1/* or more */];
  15044. } POSTPACK;
  15045. /* T2H SUBTYPE */
  15046. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15047. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15048. /* H2T SUBTYPE */
  15049. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15050. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15051. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15052. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15053. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15054. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15055. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15056. do { \
  15057. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15058. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15059. } while (0)
  15060. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15061. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15062. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15063. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15064. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15065. do { \
  15066. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15067. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15068. } while (0)
  15069. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15070. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15071. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15072. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15073. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15074. do { \
  15075. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15076. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15077. } while (0)
  15078. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15079. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15080. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15081. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15082. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15083. do { \
  15084. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15085. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15086. } while (0)
  15087. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15088. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15089. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15090. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15091. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15092. do { \
  15093. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15094. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15095. } while (0)
  15096. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15097. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15098. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15099. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15100. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15101. do { \
  15102. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15103. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15104. } while (0)
  15105. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15106. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15107. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15108. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15109. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15110. do { \
  15111. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15112. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15113. } while (0)
  15114. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15115. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15116. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15117. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15118. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15119. do { \
  15120. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15121. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15122. } while (0)
  15123. /**
  15124. * @brief target -> host FSE CMEM based send
  15125. *
  15126. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15127. *
  15128. * @details
  15129. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15130. * FSE placement in CMEM is enabled.
  15131. *
  15132. * This message sends the non-secure CMEM base address.
  15133. * It will be sent to host in response to message
  15134. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15135. * The message would appear as follows:
  15136. *
  15137. * |31 24|23 16|15 8|7 0|
  15138. * |----------------+----------------+----------------+----------------|
  15139. * | reserved | num_entries | msg_type |
  15140. * |----------------+----------------+----------------+----------------|
  15141. * | base_address_lo |
  15142. * |----------------+----------------+----------------+----------------|
  15143. * | base_address_hi |
  15144. * |-------------------------------------------------------------------|
  15145. *
  15146. * The message is interpreted as follows:
  15147. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15148. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15149. * b'8:15 - number_entries: Indicated the number of entries
  15150. * programmed.
  15151. * b'16:31 - reserved.
  15152. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15153. * CMEM base address
  15154. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15155. * CMEM base address
  15156. */
  15157. PREPACK struct htt_cmem_base_send_t {
  15158. A_UINT32 msg_type: 8,
  15159. num_entries: 8,
  15160. reserved: 16;
  15161. A_UINT32 base_address_lo;
  15162. A_UINT32 base_address_hi;
  15163. } POSTPACK;
  15164. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15165. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15166. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15167. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15168. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15169. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15170. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15171. do { \
  15172. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15173. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15174. } while (0)
  15175. /**
  15176. * @brief - HTT PPDU ID format
  15177. *
  15178. * @details
  15179. * The following field definitions describe the format of the PPDU ID.
  15180. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15181. *
  15182. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15183. * +--------------------------------------------------------------------------
  15184. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15185. * +--------------------------------------------------------------------------
  15186. *
  15187. * sch id :Schedule command id
  15188. * Bits [11 : 0] : monotonically increasing counter to track the
  15189. * PPDU posted to a specific transmit queue.
  15190. *
  15191. * hwq_id: Hardware Queue ID.
  15192. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15193. *
  15194. * mac_id: MAC ID
  15195. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15196. *
  15197. * seq_idx: Sequence index.
  15198. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15199. * a particular TXOP.
  15200. *
  15201. * tqm_cmd: HWSCH/TQM flag.
  15202. * Bit [23] : Always set to 0.
  15203. *
  15204. * seq_cmd_type: Sequence command type.
  15205. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15206. * Refer to enum HTT_STATS_FTYPE for values.
  15207. */
  15208. PREPACK struct htt_ppdu_id {
  15209. A_UINT32
  15210. sch_id: 12,
  15211. hwq_id: 5,
  15212. mac_id: 2,
  15213. seq_idx: 2,
  15214. reserved1: 2,
  15215. tqm_cmd: 1,
  15216. seq_cmd_type: 6,
  15217. reserved2: 2;
  15218. } POSTPACK;
  15219. #define HTT_PPDU_ID_SCH_ID_S 0
  15220. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15221. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15222. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15223. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15224. do { \
  15225. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15226. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15227. } while (0)
  15228. #define HTT_PPDU_ID_HWQ_ID_S 12
  15229. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15230. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15231. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15232. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15233. do { \
  15234. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15235. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15236. } while (0)
  15237. #define HTT_PPDU_ID_MAC_ID_S 17
  15238. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15239. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15240. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15241. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15242. do { \
  15243. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15244. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15245. } while (0)
  15246. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15247. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15248. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15249. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15250. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15251. do { \
  15252. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15253. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15254. } while (0)
  15255. #define HTT_PPDU_ID_TQM_CMD_S 23
  15256. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15257. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15258. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15259. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15260. do { \
  15261. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15262. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15263. } while (0)
  15264. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15265. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15266. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15267. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15268. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15269. do { \
  15270. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15271. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15272. } while (0)
  15273. /**
  15274. * @brief target -> RX PEER METADATA V0 format
  15275. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15276. * message from target, and will confirm to the target which peer metadata
  15277. * version to use in the wmi_init message.
  15278. *
  15279. * The following diagram shows the format of the RX PEER METADATA.
  15280. *
  15281. * |31 24|23 16|15 8|7 0|
  15282. * |-----------------------------------------------------------------------|
  15283. * | Reserved | VDEV ID | PEER ID |
  15284. * |-----------------------------------------------------------------------|
  15285. */
  15286. PREPACK struct htt_rx_peer_metadata_v0 {
  15287. A_UINT32
  15288. peer_id: 16,
  15289. vdev_id: 8,
  15290. reserved1: 8;
  15291. } POSTPACK;
  15292. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15293. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15294. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15295. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15296. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15297. do { \
  15298. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15299. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15300. } while (0)
  15301. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15302. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15303. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15304. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15305. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15306. do { \
  15307. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15308. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15309. } while (0)
  15310. /**
  15311. * @brief target -> RX PEER METADATA V1 format
  15312. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15313. * message from target, and will confirm to the target which peer metadata
  15314. * version to use in the wmi_init message.
  15315. *
  15316. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15317. *
  15318. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15319. * |-----------------------------------------------------------------------|
  15320. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15321. * |-----------------------------------------------------------------------|
  15322. */
  15323. PREPACK struct htt_rx_peer_metadata_v1 {
  15324. A_UINT32
  15325. peer_id: 13,
  15326. ml_peer_valid: 1,
  15327. reserved1: 2,
  15328. vdev_id: 8,
  15329. lmac_id: 2,
  15330. chip_id: 3,
  15331. reserved2: 3;
  15332. } POSTPACK;
  15333. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15334. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15335. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15336. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15337. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15338. do { \
  15339. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15340. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15341. } while (0)
  15342. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15343. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15344. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15345. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15346. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15347. do { \
  15348. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15349. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15350. } while (0)
  15351. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15352. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15353. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15354. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15355. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15356. do { \
  15357. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15358. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15359. } while (0)
  15360. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15361. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15362. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15363. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15364. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15365. do { \
  15366. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15367. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15368. } while (0)
  15369. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15370. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15371. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15372. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15373. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15374. do { \
  15375. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15376. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15377. } while (0)
  15378. /*
  15379. * In some systems, the host SW wants to specify priorities between
  15380. * different MSDU / flow queues within the same peer-TID.
  15381. * The below enums are used for the host to identify to the target
  15382. * which MSDU queue's priority it wants to adjust.
  15383. */
  15384. /*
  15385. * The MSDUQ index describe index of TCL HW, where each index is
  15386. * used for queuing particular types of MSDUs.
  15387. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15388. */
  15389. enum HTT_MSDUQ_INDEX {
  15390. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15391. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15392. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15393. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15394. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15395. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15396. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15397. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15398. HTT_MSDUQ_MAX_INDEX,
  15399. };
  15400. /* MSDU qtype definition */
  15401. enum HTT_MSDU_QTYPE {
  15402. /*
  15403. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15404. * relative priority. Instead, the relative priority of CRIT_0 versus
  15405. * CRIT_1 is controlled by the FW, through the configuration parameters
  15406. * it applies to the queues.
  15407. */
  15408. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15409. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15410. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15411. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15412. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15413. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15414. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15415. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15416. /* New MSDU_QTYPE should be added above this line */
  15417. /*
  15418. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15419. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15420. * any host/target message definitions. The QTYPE_MAX value can
  15421. * only be used internally within the host or within the target.
  15422. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15423. * it must regard the unexpected value as a default qtype value,
  15424. * or ignore it.
  15425. */
  15426. HTT_MSDU_QTYPE_MAX,
  15427. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15428. };
  15429. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15430. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15431. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15432. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15433. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15434. };
  15435. /**
  15436. * @brief target -> host mlo timestamp offset indication
  15437. *
  15438. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15439. *
  15440. * @details
  15441. * The following field definitions describe the format of the HTT target
  15442. * to host mlo timestamp offset indication message.
  15443. *
  15444. *
  15445. * |31 16|15 12|11 10|9 8|7 0 |
  15446. * |----------------------------------------------------------------------|
  15447. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15448. * |----------------------------------------------------------------------|
  15449. * | Sync time stamp lo in us |
  15450. * |----------------------------------------------------------------------|
  15451. * | Sync time stamp hi in us |
  15452. * |----------------------------------------------------------------------|
  15453. * | mlo time stamp offset lo in us |
  15454. * |----------------------------------------------------------------------|
  15455. * | mlo time stamp offset hi in us |
  15456. * |----------------------------------------------------------------------|
  15457. * | mlo time stamp offset clocks in clock ticks |
  15458. * |----------------------------------------------------------------------|
  15459. * |31 26|25 16|15 0 |
  15460. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15461. * | | compensation in clks | |
  15462. * |----------------------------------------------------------------------|
  15463. * |31 22|21 0 |
  15464. * | rsvd 3 | mlo time stamp comp timer period |
  15465. * |----------------------------------------------------------------------|
  15466. * The message is interpreted as follows:
  15467. *
  15468. * dword0 - b'0:7 - msg_type: This will be set to
  15469. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15470. * value: 0x28
  15471. *
  15472. * dword0 - b'9:8 - pdev_id
  15473. *
  15474. * dword0 - b'11:10 - chip_id
  15475. *
  15476. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15477. *
  15478. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15479. *
  15480. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15481. * which last sync interrupt was received
  15482. *
  15483. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15484. * which last sync interrupt was received
  15485. *
  15486. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15487. *
  15488. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15489. *
  15490. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15491. *
  15492. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15493. *
  15494. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15495. * for sub us resolution
  15496. *
  15497. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15498. *
  15499. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15500. * is applied, in us
  15501. *
  15502. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15503. */
  15504. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15505. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15506. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15507. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15508. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15509. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15510. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15511. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15512. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15513. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15514. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15515. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15516. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15517. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15518. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15519. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15520. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15521. do { \
  15522. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15523. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15524. } while (0)
  15525. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15526. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15527. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15528. do { \
  15529. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15530. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15531. } while (0)
  15532. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15533. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15534. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15535. do { \
  15536. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15537. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15538. } while (0)
  15539. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15540. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15541. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15542. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15543. do { \
  15544. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15545. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15546. } while (0)
  15547. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15548. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15549. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15550. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15551. do { \
  15552. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15553. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15554. } while (0)
  15555. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15556. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15557. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15558. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15559. do { \
  15560. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15561. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15562. } while (0)
  15563. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15564. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15565. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15566. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15567. do { \
  15568. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15569. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15570. } while (0)
  15571. typedef struct {
  15572. A_UINT32 msg_type: 8, /* bits 7:0 */
  15573. pdev_id: 2, /* bits 9:8 */
  15574. chip_id: 2, /* bits 11:10 */
  15575. reserved1: 4, /* bits 15:12 */
  15576. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15577. A_UINT32 sync_timestamp_lo_us;
  15578. A_UINT32 sync_timestamp_hi_us;
  15579. A_UINT32 mlo_timestamp_offset_lo_us;
  15580. A_UINT32 mlo_timestamp_offset_hi_us;
  15581. A_UINT32 mlo_timestamp_offset_clks;
  15582. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15583. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15584. reserved2: 6; /* bits 31:26 */
  15585. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15586. reserved3: 10; /* bits 31:22 */
  15587. } htt_t2h_mlo_offset_ind_t;
  15588. /*
  15589. * @brief target -> host VDEV TX RX STATS
  15590. *
  15591. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15592. *
  15593. * @details
  15594. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15595. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15596. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15597. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15598. * periodically by target even in the absence of any further HTT request
  15599. * messages from host.
  15600. *
  15601. * The message is formatted as follows:
  15602. *
  15603. * |31 16|15 8|7 0|
  15604. * |---------------------------------+----------------+----------------|
  15605. * | payload_size | pdev_id | msg_type |
  15606. * |---------------------------------+----------------+----------------|
  15607. * | reserved0 |
  15608. * |-------------------------------------------------------------------|
  15609. * | reserved1 |
  15610. * |-------------------------------------------------------------------|
  15611. * | reserved2 |
  15612. * |-------------------------------------------------------------------|
  15613. * | |
  15614. * | VDEV specific Tx Rx stats info |
  15615. * | |
  15616. * |-------------------------------------------------------------------|
  15617. *
  15618. * The message is interpreted as follows:
  15619. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15620. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15621. * b'8:15 - pdev_id
  15622. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15623. * message header fields (msg_type through reserved2)
  15624. * dword1 - b'0:31 - reserved0.
  15625. * dword2 - b'0:31 - reserved1.
  15626. * dword3 - b'0:31 - reserved2.
  15627. */
  15628. typedef struct {
  15629. A_UINT32 msg_type: 8,
  15630. pdev_id: 8,
  15631. payload_size: 16;
  15632. A_UINT32 reserved0;
  15633. A_UINT32 reserved1;
  15634. A_UINT32 reserved2;
  15635. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15636. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15637. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15638. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15639. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15640. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15641. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15642. do { \
  15643. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15644. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15645. } while (0)
  15646. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15647. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15648. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15649. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15650. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15651. do { \
  15652. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15653. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15654. } while (0)
  15655. /* SOC related stats */
  15656. typedef struct {
  15657. htt_tlv_hdr_t tlv_hdr;
  15658. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15659. * This can be due to either the peer is deleted or deletion is ongoing
  15660. * */
  15661. A_UINT32 inv_peers_msdu_drop_count_lo;
  15662. A_UINT32 inv_peers_msdu_drop_count_hi;
  15663. } htt_t2h_soc_txrx_stats_common_tlv;
  15664. /* VDEV HW Tx/Rx stats */
  15665. typedef struct {
  15666. htt_tlv_hdr_t tlv_hdr;
  15667. A_UINT32 vdev_id;
  15668. /* Rx msdu byte cnt */
  15669. A_UINT32 rx_msdu_byte_cnt_lo;
  15670. A_UINT32 rx_msdu_byte_cnt_hi;
  15671. /* Rx msdu cnt */
  15672. A_UINT32 rx_msdu_cnt_lo;
  15673. A_UINT32 rx_msdu_cnt_hi;
  15674. /* tx msdu byte cnt */
  15675. A_UINT32 tx_msdu_byte_cnt_lo;
  15676. A_UINT32 tx_msdu_byte_cnt_hi;
  15677. /* tx msdu cnt */
  15678. A_UINT32 tx_msdu_cnt_lo;
  15679. A_UINT32 tx_msdu_cnt_hi;
  15680. /* tx excessive retry discarded msdu cnt */
  15681. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15682. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15683. /* TX congestion ctrl msdu drop cnt */
  15684. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15685. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15686. /* discarded tx msdus cnt coz of time to live expiry */
  15687. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15688. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15689. /* tx excessive retry discarded msdu byte cnt */
  15690. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15691. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15692. /* TX congestion ctrl msdu drop byte cnt */
  15693. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15694. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15695. /* discarded tx msdus byte cnt coz of time to live expiry */
  15696. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15697. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15698. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15699. /*
  15700. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15701. *
  15702. * @details
  15703. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  15704. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  15705. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  15706. * the default MSDU queues of the peer-TID specified in the
  15707. * SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  15708. * If the default MSDU queues of the specified peer-TID are not linked to
  15709. * a service class, the status field of the SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15710. * will specify that no such mapping exists of the default MSDU queues to a
  15711. * service class.
  15712. *
  15713. * |31 16|15 12|11 8|7 0|
  15714. * |------------------------------+------+-------+--------------|
  15715. * | peer ID | rsvd | TID | msg type |
  15716. * |------------------------------+--------------+--------------|
  15717. * | reserved | svc class ID | status |
  15718. * |------------------------------------------------------------|
  15719. * Header fields:
  15720. * dword0 - b'7:0 - msg_type: This will be set to
  15721. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  15722. * b'11:8 - TID
  15723. * b'31:16 - peer ID
  15724. * dword1 - b'7:0 - status (htt_t2h_sawf_def_queues_map_report_status)
  15725. * b'15:8 - svc class ID (only valid if status == MAPPED)
  15726. */
  15727. enum htt_t2h_sawf_def_queues_map_report_status {
  15728. /* MAPPED:
  15729. * The default MSDU queues for the peer-TID are linked to a service class.
  15730. * The svc_class_id field shows which service class the default MSDU queues
  15731. * are associated with.
  15732. */
  15733. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_MAPPED = 0,
  15734. /* UNMAPPED:
  15735. * The default MSDU queues for the peer-TID are not linked to any
  15736. * service class.
  15737. */
  15738. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_UNMAPPED = 1,
  15739. /* INVALID_IDS:
  15740. * One or more of pdev_id, vdev_id, peer_id, and TID were invalid.
  15741. */
  15742. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_INVALID_IDS = 2,
  15743. };
  15744. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  15745. A_UINT32 msg_type :8,
  15746. tid :4,
  15747. reserved0 :4,
  15748. peer_id :16;
  15749. A_UINT32 status :8,
  15750. svc_class_id :8,
  15751. reserved1 :16;
  15752. } POSTPACK;
  15753. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_BYTES 8
  15754. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x00000F00
  15755. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 8
  15756. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  15757. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  15758. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  15759. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  15760. do { \
  15761. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  15762. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S));\
  15763. } while (0)
  15764. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  15765. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  15766. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  15767. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  15768. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  15769. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  15770. do { \
  15771. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  15772. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  15773. } while (0)
  15774. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M 0x000000FF
  15775. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S 0
  15776. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_GET(_var) \
  15777. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M) >> \
  15778. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)
  15779. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_SET(_var, _val) \
  15780. do { \
  15781. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS, _val); \
  15782. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)); \
  15783. } while (0)
  15784. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  15785. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  15786. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  15787. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  15788. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  15789. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  15790. do { \
  15791. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  15792. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  15793. } while (0)
  15794. #endif