htt.h 801 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478
  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_MAX,
  2429. } htt_tx_fw2wbm_reinject_reason_t;
  2430. /**
  2431. * @brief HTT TX WBM Completion from firmware to host
  2432. * @details
  2433. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2434. * DWORD 3 and 4 for software based completions (Exception frames and
  2435. * TQM bypass frames)
  2436. * For software based completions, wbm_release_ring->release_source_module will
  2437. * be set to release_source_fw
  2438. */
  2439. PREPACK struct htt_tx_wbm_completion {
  2440. A_UINT32
  2441. sch_cmd_id: 24,
  2442. exception_frame: 1, /* If set, this packet was queued via exception path */
  2443. rsvd0_31_25: 7;
  2444. A_UINT32
  2445. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2446. * reception of an ACK or BA, this field indicates
  2447. * the RSSI of the received ACK or BA frame.
  2448. * When the frame is removed as result of a direct
  2449. * remove command from the SW, this field is set
  2450. * to 0x0 (which is never a valid value when real
  2451. * RSSI is available).
  2452. * Units: dB w.r.t noise floor
  2453. */
  2454. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2455. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2456. rsvd1_31_16: 16;
  2457. } POSTPACK;
  2458. /* DWORD 0 */
  2459. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2460. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2461. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2462. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2463. /* DWORD 1 */
  2464. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2465. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2466. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2467. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2468. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2469. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2470. /* DWORD 0 */
  2471. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2472. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2473. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2474. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2475. do { \
  2476. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2477. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2478. } while (0)
  2479. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2480. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2481. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2482. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2483. do { \
  2484. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2485. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2486. } while (0)
  2487. /* DWORD 1 */
  2488. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2489. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2490. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2491. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2492. do { \
  2493. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2494. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2495. } while (0)
  2496. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2497. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2498. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2499. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2500. do { \
  2501. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2502. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2503. } while (0)
  2504. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2505. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2506. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2507. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2508. do { \
  2509. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2510. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2511. } while (0)
  2512. /**
  2513. * @brief HTT TX WBM Completion from firmware to host
  2514. * @details
  2515. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2516. * (WBM) offload HW.
  2517. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2518. * For software based completions, release_source_module will
  2519. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2520. * struct wbm_release_ring and then switch to this after looking at
  2521. * release_source_module.
  2522. */
  2523. PREPACK struct htt_tx_wbm_completion_v2 {
  2524. A_UINT32
  2525. used_by_hw0; /* Refer to struct wbm_release_ring */
  2526. A_UINT32
  2527. used_by_hw1; /* Refer to struct wbm_release_ring */
  2528. A_UINT32
  2529. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2530. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2531. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2532. exception_frame: 1,
  2533. rsvd0: 12, /* For future use */
  2534. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2535. rsvd1: 1; /* For future use */
  2536. A_UINT32
  2537. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2538. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2539. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2540. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2541. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2542. */
  2543. A_UINT32
  2544. data1: 32;
  2545. A_UINT32
  2546. data2: 32;
  2547. A_UINT32
  2548. used_by_hw3; /* Refer to struct wbm_release_ring */
  2549. } POSTPACK;
  2550. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2551. /* DWORD 3 */
  2552. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2553. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2554. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2555. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2556. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2557. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2558. /* DWORD 3 */
  2559. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2560. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2561. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2562. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2563. do { \
  2564. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2565. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2566. } while (0)
  2567. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2568. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2569. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2570. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2571. do { \
  2572. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2573. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2574. } while (0)
  2575. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2576. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2577. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2578. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2579. do { \
  2580. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2581. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2582. } while (0)
  2583. typedef enum {
  2584. TX_FRAME_TYPE_UNDEFINED = 0,
  2585. TX_FRAME_TYPE_EAPOL = 1,
  2586. } htt_tx_wbm_status_frame_type;
  2587. /**
  2588. * @brief HTT TX WBM transmit status from firmware to host
  2589. * @details
  2590. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2591. * (WBM) offload HW.
  2592. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2593. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2594. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2595. */
  2596. PREPACK struct htt_tx_wbm_transmit_status {
  2597. A_UINT32
  2598. sch_cmd_id: 24,
  2599. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2600. * reception of an ACK or BA, this field indicates
  2601. * the RSSI of the received ACK or BA frame.
  2602. * When the frame is removed as result of a direct
  2603. * remove command from the SW, this field is set
  2604. * to 0x0 (which is never a valid value when real
  2605. * RSSI is available).
  2606. * Units: dB w.r.t noise floor
  2607. */
  2608. A_UINT32
  2609. sw_peer_id: 16,
  2610. tid_num: 5,
  2611. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2612. * and tid_num fields contain valid data.
  2613. * If this "valid" flag is not set, the
  2614. * sw_peer_id and tid_num fields must be ignored.
  2615. */
  2616. mcast: 1,
  2617. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2618. * contains valid data.
  2619. */
  2620. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2621. reserved: 4;
  2622. A_UINT32
  2623. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2624. * packets in the wbm completion path
  2625. */
  2626. } POSTPACK;
  2627. /* DWORD 4 */
  2628. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2629. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2630. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2631. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2632. /* DWORD 5 */
  2633. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2634. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2635. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2636. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2637. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2638. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2639. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2640. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2641. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2642. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2643. /* DWORD 4 */
  2644. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2645. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2646. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2647. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2650. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2651. } while (0)
  2652. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2653. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2654. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2655. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2658. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2659. } while (0)
  2660. /* DWORD 5 */
  2661. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2662. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2663. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2664. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2665. do { \
  2666. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2667. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2668. } while (0)
  2669. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2670. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2671. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2672. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2673. do { \
  2674. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2675. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2676. } while (0)
  2677. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2678. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2679. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2680. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2681. do { \
  2682. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2683. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2684. } while (0)
  2685. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2686. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2687. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2688. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2689. do { \
  2690. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2691. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2692. } while (0)
  2693. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2694. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2695. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2696. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2697. do { \
  2698. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2699. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2700. } while (0)
  2701. /**
  2702. * @brief HTT TX WBM reinject status from firmware to host
  2703. * @details
  2704. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2705. * (WBM) offload HW.
  2706. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2707. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2708. */
  2709. PREPACK struct htt_tx_wbm_reinject_status {
  2710. A_UINT32
  2711. reserved0: 32;
  2712. A_UINT32
  2713. reserved1: 32;
  2714. A_UINT32
  2715. reserved2: 32;
  2716. } POSTPACK;
  2717. /**
  2718. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2719. * @details
  2720. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2721. * (WBM) offload HW.
  2722. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2723. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2724. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2725. * STA side.
  2726. */
  2727. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2728. A_UINT32
  2729. mec_sa_addr_31_0;
  2730. A_UINT32
  2731. mec_sa_addr_47_32: 16,
  2732. sa_ast_index: 16;
  2733. A_UINT32
  2734. vdev_id: 8,
  2735. reserved0: 24;
  2736. } POSTPACK;
  2737. /* DWORD 4 - mec_sa_addr_31_0 */
  2738. /* DWORD 5 */
  2739. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2740. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2741. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2742. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2743. /* DWORD 6 */
  2744. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2745. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2746. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2747. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2748. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2749. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2752. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2753. } while (0)
  2754. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2755. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2756. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2757. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2760. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2761. } while (0)
  2762. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2763. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2764. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2765. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2768. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2769. } while (0)
  2770. typedef enum {
  2771. TX_FLOW_PRIORITY_BE,
  2772. TX_FLOW_PRIORITY_HIGH,
  2773. TX_FLOW_PRIORITY_LOW,
  2774. } htt_tx_flow_priority_t;
  2775. typedef enum {
  2776. TX_FLOW_LATENCY_SENSITIVE,
  2777. TX_FLOW_LATENCY_INSENSITIVE,
  2778. } htt_tx_flow_latency_t;
  2779. typedef enum {
  2780. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2781. TX_FLOW_INTERACTIVE_TRAFFIC,
  2782. TX_FLOW_PERIODIC_TRAFFIC,
  2783. TX_FLOW_BURSTY_TRAFFIC,
  2784. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2785. } htt_tx_flow_traffic_pattern_t;
  2786. /**
  2787. * @brief HTT TX Flow search metadata format
  2788. * @details
  2789. * Host will set this metadata in flow table's flow search entry along with
  2790. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2791. * firmware and TQM ring if the flow search entry wins.
  2792. * This metadata is available to firmware in that first MSDU's
  2793. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2794. * to one of the available flows for specific tid and returns the tqm flow
  2795. * pointer as part of htt_tx_map_flow_info message.
  2796. */
  2797. PREPACK struct htt_tx_flow_metadata {
  2798. A_UINT32
  2799. rsvd0_1_0: 2,
  2800. tid: 4,
  2801. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2802. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2803. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2804. * Else choose final tid based on latency, priority.
  2805. */
  2806. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2807. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2808. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2809. } POSTPACK;
  2810. /* DWORD 0 */
  2811. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2812. #define HTT_TX_FLOW_METADATA_TID_S 2
  2813. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2814. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2815. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2816. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2817. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2818. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2819. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2820. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2821. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2822. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2823. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2824. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2825. /* DWORD 0 */
  2826. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2827. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2828. HTT_TX_FLOW_METADATA_TID_S)
  2829. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2830. do { \
  2831. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2832. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2833. } while (0)
  2834. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2835. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2836. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2837. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2838. do { \
  2839. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2840. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2841. } while (0)
  2842. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2843. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2844. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2845. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2846. do { \
  2847. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2848. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2849. } while (0)
  2850. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2851. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2852. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2853. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2854. do { \
  2855. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2856. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2857. } while (0)
  2858. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2859. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2860. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2861. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2862. do { \
  2863. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2864. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2865. } while (0)
  2866. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2867. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2868. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2869. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2870. do { \
  2871. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2872. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2873. } while (0)
  2874. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2875. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2876. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2877. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2878. do { \
  2879. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2880. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2881. } while (0)
  2882. /**
  2883. * @brief host -> target ADD WDS Entry
  2884. *
  2885. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2886. *
  2887. * @brief host -> target DELETE WDS Entry
  2888. *
  2889. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2890. *
  2891. * @details
  2892. * HTT wds entry from source port learning
  2893. * Host will learn wds entries from rx and send this message to firmware
  2894. * to enable firmware to configure/delete AST entries for wds clients.
  2895. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2896. * and when SA's entry is deleted, firmware removes this AST entry
  2897. *
  2898. * The message would appear as follows:
  2899. *
  2900. * |31 30|29 |17 16|15 8|7 0|
  2901. * |----------------+----------------+----------------+----------------|
  2902. * | rsvd0 |PDVID| vdev_id | msg_type |
  2903. * |-------------------------------------------------------------------|
  2904. * | sa_addr_31_0 |
  2905. * |-------------------------------------------------------------------|
  2906. * | | ta_peer_id | sa_addr_47_32 |
  2907. * |-------------------------------------------------------------------|
  2908. * Where PDVID = pdev_id
  2909. *
  2910. * The message is interpreted as follows:
  2911. *
  2912. * dword0 - b'0:7 - msg_type: This will be set to
  2913. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2914. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2915. *
  2916. * dword0 - b'8:15 - vdev_id
  2917. *
  2918. * dword0 - b'16:17 - pdev_id
  2919. *
  2920. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2921. *
  2922. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2923. *
  2924. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2925. *
  2926. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2927. */
  2928. PREPACK struct htt_wds_entry {
  2929. A_UINT32
  2930. msg_type: 8,
  2931. vdev_id: 8,
  2932. pdev_id: 2,
  2933. rsvd0: 14;
  2934. A_UINT32 sa_addr_31_0;
  2935. A_UINT32
  2936. sa_addr_47_32: 16,
  2937. ta_peer_id: 14,
  2938. rsvd2: 2;
  2939. } POSTPACK;
  2940. /* DWORD 0 */
  2941. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2942. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2943. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2944. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2945. /* DWORD 2 */
  2946. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2947. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2948. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2949. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2950. /* DWORD 0 */
  2951. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2952. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2953. HTT_WDS_ENTRY_VDEV_ID_S)
  2954. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2957. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2958. } while (0)
  2959. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2960. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2961. HTT_WDS_ENTRY_PDEV_ID_S)
  2962. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2965. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2966. } while (0)
  2967. /* DWORD 2 */
  2968. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2969. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2970. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2971. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2974. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2975. } while (0)
  2976. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2977. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2978. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2979. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2982. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2983. } while (0)
  2984. /**
  2985. * @brief MAC DMA rx ring setup specification
  2986. *
  2987. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2988. *
  2989. * @details
  2990. * To allow for dynamic rx ring reconfiguration and to avoid race
  2991. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2992. * it uses. Instead, it sends this message to the target, indicating how
  2993. * the rx ring used by the host should be set up and maintained.
  2994. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2995. * specifications.
  2996. *
  2997. * |31 16|15 8|7 0|
  2998. * |---------------------------------------------------------------|
  2999. * header: | reserved | num rings | msg type |
  3000. * |---------------------------------------------------------------|
  3001. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3002. #if HTT_PADDR64
  3003. * | FW_IDX shadow register physical address (bits 63:32) |
  3004. #endif
  3005. * |---------------------------------------------------------------|
  3006. * | rx ring base physical address (bits 31:0) |
  3007. #if HTT_PADDR64
  3008. * | rx ring base physical address (bits 63:32) |
  3009. #endif
  3010. * |---------------------------------------------------------------|
  3011. * | rx ring buffer size | rx ring length |
  3012. * |---------------------------------------------------------------|
  3013. * | FW_IDX initial value | enabled flags |
  3014. * |---------------------------------------------------------------|
  3015. * | MSDU payload offset | 802.11 header offset |
  3016. * |---------------------------------------------------------------|
  3017. * | PPDU end offset | PPDU start offset |
  3018. * |---------------------------------------------------------------|
  3019. * | MPDU end offset | MPDU start offset |
  3020. * |---------------------------------------------------------------|
  3021. * | MSDU end offset | MSDU start offset |
  3022. * |---------------------------------------------------------------|
  3023. * | frag info offset | rx attention offset |
  3024. * |---------------------------------------------------------------|
  3025. * payload 2, if present, has the same format as payload 1
  3026. * Header fields:
  3027. * - MSG_TYPE
  3028. * Bits 7:0
  3029. * Purpose: identifies this as an rx ring configuration message
  3030. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3031. * - NUM_RINGS
  3032. * Bits 15:8
  3033. * Purpose: indicates whether the host is setting up one rx ring or two
  3034. * Value: 1 or 2
  3035. * Payload:
  3036. * for systems using 64-bit format for bus addresses:
  3037. * - IDX_SHADOW_REG_PADDR_LO
  3038. * Bits 31:0
  3039. * Value: lower 4 bytes of physical address of the host's
  3040. * FW_IDX shadow register
  3041. * - IDX_SHADOW_REG_PADDR_HI
  3042. * Bits 31:0
  3043. * Value: upper 4 bytes of physical address of the host's
  3044. * FW_IDX shadow register
  3045. * - RING_BASE_PADDR_LO
  3046. * Bits 31:0
  3047. * Value: lower 4 bytes of physical address of the host's rx ring
  3048. * - RING_BASE_PADDR_HI
  3049. * Bits 31:0
  3050. * Value: uppper 4 bytes of physical address of the host's rx ring
  3051. * for systems using 32-bit format for bus addresses:
  3052. * - IDX_SHADOW_REG_PADDR
  3053. * Bits 31:0
  3054. * Value: physical address of the host's FW_IDX shadow register
  3055. * - RING_BASE_PADDR
  3056. * Bits 31:0
  3057. * Value: physical address of the host's rx ring
  3058. * - RING_LEN
  3059. * Bits 15:0
  3060. * Value: number of elements in the rx ring
  3061. * - RING_BUF_SZ
  3062. * Bits 31:16
  3063. * Value: size of the buffers referenced by the rx ring, in byte units
  3064. * - ENABLED_FLAGS
  3065. * Bits 15:0
  3066. * Value: 1-bit flags to show whether different rx fields are enabled
  3067. * bit 0: 802.11 header enabled (1) or disabled (0)
  3068. * bit 1: MSDU payload enabled (1) or disabled (0)
  3069. * bit 2: PPDU start enabled (1) or disabled (0)
  3070. * bit 3: PPDU end enabled (1) or disabled (0)
  3071. * bit 4: MPDU start enabled (1) or disabled (0)
  3072. * bit 5: MPDU end enabled (1) or disabled (0)
  3073. * bit 6: MSDU start enabled (1) or disabled (0)
  3074. * bit 7: MSDU end enabled (1) or disabled (0)
  3075. * bit 8: rx attention enabled (1) or disabled (0)
  3076. * bit 9: frag info enabled (1) or disabled (0)
  3077. * bit 10: unicast rx enabled (1) or disabled (0)
  3078. * bit 11: multicast rx enabled (1) or disabled (0)
  3079. * bit 12: ctrl rx enabled (1) or disabled (0)
  3080. * bit 13: mgmt rx enabled (1) or disabled (0)
  3081. * bit 14: null rx enabled (1) or disabled (0)
  3082. * bit 15: phy data rx enabled (1) or disabled (0)
  3083. * - IDX_INIT_VAL
  3084. * Bits 31:16
  3085. * Purpose: Specify the initial value for the FW_IDX.
  3086. * Value: the number of buffers initially present in the host's rx ring
  3087. * - OFFSET_802_11_HDR
  3088. * Bits 15:0
  3089. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3090. * - OFFSET_MSDU_PAYLOAD
  3091. * Bits 31:16
  3092. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3093. * - OFFSET_PPDU_START
  3094. * Bits 15:0
  3095. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3096. * - OFFSET_PPDU_END
  3097. * Bits 31:16
  3098. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3099. * - OFFSET_MPDU_START
  3100. * Bits 15:0
  3101. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3102. * - OFFSET_MPDU_END
  3103. * Bits 31:16
  3104. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3105. * - OFFSET_MSDU_START
  3106. * Bits 15:0
  3107. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3108. * - OFFSET_MSDU_END
  3109. * Bits 31:16
  3110. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3111. * - OFFSET_RX_ATTN
  3112. * Bits 15:0
  3113. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3114. * - OFFSET_FRAG_INFO
  3115. * Bits 31:16
  3116. * Value: offset in QUAD-bytes of frag info table
  3117. */
  3118. /* header fields */
  3119. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3120. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3121. /* payload fields */
  3122. /* for systems using a 64-bit format for bus addresses */
  3123. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3124. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3125. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3126. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3127. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3128. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3129. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3130. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3131. /* for systems using a 32-bit format for bus addresses */
  3132. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3133. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3134. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3135. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3136. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3137. #define HTT_RX_RING_CFG_LEN_S 0
  3138. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3139. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3140. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3141. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3142. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3143. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3144. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3145. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3146. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3147. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3148. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3149. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3150. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3151. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3152. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3153. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3154. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3155. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3156. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3157. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3158. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3159. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3160. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3161. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3162. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3163. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3164. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3165. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3166. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3167. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3168. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3169. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3170. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3171. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3172. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3173. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3174. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3175. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3176. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3177. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3178. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3179. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3180. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3181. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3182. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3183. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3184. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3185. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3186. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3187. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3188. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3189. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3190. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3191. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3192. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3193. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3194. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3195. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3196. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3197. #if HTT_PADDR64
  3198. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3199. #else
  3200. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3201. #endif
  3202. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3203. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3204. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3205. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3206. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3207. do { \
  3208. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3209. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3210. } while (0)
  3211. /* degenerate case for 32-bit fields */
  3212. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3213. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3214. ((_var) = (_val))
  3215. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3216. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3217. ((_var) = (_val))
  3218. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3219. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3220. ((_var) = (_val))
  3221. /* degenerate case for 32-bit fields */
  3222. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3223. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3224. ((_var) = (_val))
  3225. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3226. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3227. ((_var) = (_val))
  3228. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3229. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3230. ((_var) = (_val))
  3231. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3232. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3233. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3234. do { \
  3235. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3236. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3237. } while (0)
  3238. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3239. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3240. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3241. do { \
  3242. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3243. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3244. } while (0)
  3245. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3246. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3247. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3248. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3249. do { \
  3250. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3251. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3252. } while (0)
  3253. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3254. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3255. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3256. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3257. do { \
  3258. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3259. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3260. } while (0)
  3261. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3262. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3263. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3264. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3265. do { \
  3266. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3267. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3268. } while (0)
  3269. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3270. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3271. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3272. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3273. do { \
  3274. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3275. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3276. } while (0)
  3277. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3278. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3279. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3280. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3281. do { \
  3282. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3283. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3284. } while (0)
  3285. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3286. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3287. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3288. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3289. do { \
  3290. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3291. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3292. } while (0)
  3293. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3294. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3295. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3296. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3297. do { \
  3298. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3299. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3300. } while (0)
  3301. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3302. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3303. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3304. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3305. do { \
  3306. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3307. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3308. } while (0)
  3309. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3310. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3311. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3312. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3313. do { \
  3314. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3315. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3316. } while (0)
  3317. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3318. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3319. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3320. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3321. do { \
  3322. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3323. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3324. } while (0)
  3325. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3326. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3327. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3328. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3329. do { \
  3330. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3331. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3332. } while (0)
  3333. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3334. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3335. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3336. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3337. do { \
  3338. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3339. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3340. } while (0)
  3341. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3342. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3343. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3344. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3345. do { \
  3346. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3347. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3348. } while (0)
  3349. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3350. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3351. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3352. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3353. do { \
  3354. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3355. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3356. } while (0)
  3357. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3358. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3359. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3360. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3361. do { \
  3362. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3363. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3364. } while (0)
  3365. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3366. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3367. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3368. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3369. do { \
  3370. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3371. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3372. } while (0)
  3373. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3374. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3375. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3376. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3377. do { \
  3378. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3379. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3380. } while (0)
  3381. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3382. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3383. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3384. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3385. do { \
  3386. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3387. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3388. } while (0)
  3389. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3390. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3391. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3392. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3395. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3396. } while (0)
  3397. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3398. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3399. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3400. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3403. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3404. } while (0)
  3405. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3406. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3407. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3408. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3411. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3412. } while (0)
  3413. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3414. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3415. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3416. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3419. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3420. } while (0)
  3421. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3422. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3423. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3424. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3427. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3428. } while (0)
  3429. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3430. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3431. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3432. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3435. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3436. } while (0)
  3437. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3438. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3439. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3440. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3443. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3444. } while (0)
  3445. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3446. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3447. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3448. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3451. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3452. } while (0)
  3453. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3454. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3455. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3456. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3459. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3460. } while (0)
  3461. /**
  3462. * @brief host -> target FW statistics retrieve
  3463. *
  3464. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3465. *
  3466. * @details
  3467. * The following field definitions describe the format of the HTT host
  3468. * to target FW stats retrieve message. The message specifies the type of
  3469. * stats host wants to retrieve.
  3470. *
  3471. * |31 24|23 16|15 8|7 0|
  3472. * |-----------------------------------------------------------|
  3473. * | stats types request bitmask | msg type |
  3474. * |-----------------------------------------------------------|
  3475. * | stats types reset bitmask | reserved |
  3476. * |-----------------------------------------------------------|
  3477. * | stats type | config value |
  3478. * |-----------------------------------------------------------|
  3479. * | cookie LSBs |
  3480. * |-----------------------------------------------------------|
  3481. * | cookie MSBs |
  3482. * |-----------------------------------------------------------|
  3483. * Header fields:
  3484. * - MSG_TYPE
  3485. * Bits 7:0
  3486. * Purpose: identifies this is a stats upload request message
  3487. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3488. * - UPLOAD_TYPES
  3489. * Bits 31:8
  3490. * Purpose: identifies which types of FW statistics to upload
  3491. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3492. * - RESET_TYPES
  3493. * Bits 31:8
  3494. * Purpose: identifies which types of FW statistics to reset
  3495. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3496. * - CFG_VAL
  3497. * Bits 23:0
  3498. * Purpose: give an opaque configuration value to the specified stats type
  3499. * Value: stats-type specific configuration value
  3500. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3501. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3502. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3503. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3504. * - CFG_STAT_TYPE
  3505. * Bits 31:24
  3506. * Purpose: specify which stats type (if any) the config value applies to
  3507. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3508. * a valid configuration specification
  3509. * - COOKIE_LSBS
  3510. * Bits 31:0
  3511. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3512. * message with its preceding host->target stats request message.
  3513. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3514. * - COOKIE_MSBS
  3515. * Bits 31:0
  3516. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3517. * message with its preceding host->target stats request message.
  3518. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3519. */
  3520. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3521. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3522. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3523. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3524. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3525. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3526. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3527. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3528. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3529. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3530. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3531. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3532. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3533. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3536. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3537. } while (0)
  3538. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3539. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3540. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3541. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3544. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3545. } while (0)
  3546. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3547. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3548. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3549. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3552. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3553. } while (0)
  3554. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3555. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3556. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3557. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3560. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3561. } while (0)
  3562. /**
  3563. * @brief host -> target HTT out-of-band sync request
  3564. *
  3565. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3566. *
  3567. * @details
  3568. * The HTT SYNC tells the target to suspend processing of subsequent
  3569. * HTT host-to-target messages until some other target agent locally
  3570. * informs the target HTT FW that the current sync counter is equal to
  3571. * or greater than (in a modulo sense) the sync counter specified in
  3572. * the SYNC message.
  3573. * This allows other host-target components to synchronize their operation
  3574. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3575. * security key has been downloaded to and activated by the target.
  3576. * In the absence of any explicit synchronization counter value
  3577. * specification, the target HTT FW will use zero as the default current
  3578. * sync value.
  3579. *
  3580. * |31 24|23 16|15 8|7 0|
  3581. * |-----------------------------------------------------------|
  3582. * | reserved | sync count | msg type |
  3583. * |-----------------------------------------------------------|
  3584. * Header fields:
  3585. * - MSG_TYPE
  3586. * Bits 7:0
  3587. * Purpose: identifies this as a sync message
  3588. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3589. * - SYNC_COUNT
  3590. * Bits 15:8
  3591. * Purpose: specifies what sync value the HTT FW will wait for from
  3592. * an out-of-band specification to resume its operation
  3593. * Value: in-band sync counter value to compare against the out-of-band
  3594. * counter spec.
  3595. * The HTT target FW will suspend its host->target message processing
  3596. * as long as
  3597. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3598. */
  3599. #define HTT_H2T_SYNC_MSG_SZ 4
  3600. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3601. #define HTT_H2T_SYNC_COUNT_S 8
  3602. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3603. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3604. HTT_H2T_SYNC_COUNT_S)
  3605. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3606. do { \
  3607. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3608. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3609. } while (0)
  3610. /**
  3611. * @brief host -> target HTT aggregation configuration
  3612. *
  3613. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3614. */
  3615. #define HTT_AGGR_CFG_MSG_SZ 4
  3616. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3617. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3618. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3619. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3620. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3621. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3622. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3623. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3624. do { \
  3625. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3626. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3627. } while (0)
  3628. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3629. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3630. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3631. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3632. do { \
  3633. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3634. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3635. } while (0)
  3636. /**
  3637. * @brief host -> target HTT configure max amsdu info per vdev
  3638. *
  3639. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3640. *
  3641. * @details
  3642. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3643. *
  3644. * |31 21|20 16|15 8|7 0|
  3645. * |-----------------------------------------------------------|
  3646. * | reserved | vdev id | max amsdu | msg type |
  3647. * |-----------------------------------------------------------|
  3648. * Header fields:
  3649. * - MSG_TYPE
  3650. * Bits 7:0
  3651. * Purpose: identifies this as a aggr cfg ex message
  3652. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3653. * - MAX_NUM_AMSDU_SUBFRM
  3654. * Bits 15:8
  3655. * Purpose: max MSDUs per A-MSDU
  3656. * - VDEV_ID
  3657. * Bits 20:16
  3658. * Purpose: ID of the vdev to which this limit is applied
  3659. */
  3660. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3661. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3662. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3663. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3664. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3665. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3666. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3667. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3668. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3669. do { \
  3670. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3671. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3672. } while (0)
  3673. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3674. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3675. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3676. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3677. do { \
  3678. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3679. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3680. } while (0)
  3681. /**
  3682. * @brief HTT WDI_IPA Config Message
  3683. *
  3684. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3685. *
  3686. * @details
  3687. * The HTT WDI_IPA config message is created/sent by host at driver
  3688. * init time. It contains information about data structures used on
  3689. * WDI_IPA TX and RX path.
  3690. * TX CE ring is used for pushing packet metadata from IPA uC
  3691. * to WLAN FW
  3692. * TX Completion ring is used for generating TX completions from
  3693. * WLAN FW to IPA uC
  3694. * RX Indication ring is used for indicating RX packets from FW
  3695. * to IPA uC
  3696. * RX Ring2 is used as either completion ring or as second
  3697. * indication ring. when Ring2 is used as completion ring, IPA uC
  3698. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3699. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3700. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3701. * indicated in RX Indication ring. Please see WDI_IPA specification
  3702. * for more details.
  3703. * |31 24|23 16|15 8|7 0|
  3704. * |----------------+----------------+----------------+----------------|
  3705. * | tx pkt pool size | Rsvd | msg_type |
  3706. * |-------------------------------------------------------------------|
  3707. * | tx comp ring base (bits 31:0) |
  3708. #if HTT_PADDR64
  3709. * | tx comp ring base (bits 63:32) |
  3710. #endif
  3711. * |-------------------------------------------------------------------|
  3712. * | tx comp ring size |
  3713. * |-------------------------------------------------------------------|
  3714. * | tx comp WR_IDX physical address (bits 31:0) |
  3715. #if HTT_PADDR64
  3716. * | tx comp WR_IDX physical address (bits 63:32) |
  3717. #endif
  3718. * |-------------------------------------------------------------------|
  3719. * | tx CE WR_IDX physical address (bits 31:0) |
  3720. #if HTT_PADDR64
  3721. * | tx CE WR_IDX physical address (bits 63:32) |
  3722. #endif
  3723. * |-------------------------------------------------------------------|
  3724. * | rx indication ring base (bits 31:0) |
  3725. #if HTT_PADDR64
  3726. * | rx indication ring base (bits 63:32) |
  3727. #endif
  3728. * |-------------------------------------------------------------------|
  3729. * | rx indication ring size |
  3730. * |-------------------------------------------------------------------|
  3731. * | rx ind RD_IDX physical address (bits 31:0) |
  3732. #if HTT_PADDR64
  3733. * | rx ind RD_IDX physical address (bits 63:32) |
  3734. #endif
  3735. * |-------------------------------------------------------------------|
  3736. * | rx ind WR_IDX physical address (bits 31:0) |
  3737. #if HTT_PADDR64
  3738. * | rx ind WR_IDX physical address (bits 63:32) |
  3739. #endif
  3740. * |-------------------------------------------------------------------|
  3741. * |-------------------------------------------------------------------|
  3742. * | rx ring2 base (bits 31:0) |
  3743. #if HTT_PADDR64
  3744. * | rx ring2 base (bits 63:32) |
  3745. #endif
  3746. * |-------------------------------------------------------------------|
  3747. * | rx ring2 size |
  3748. * |-------------------------------------------------------------------|
  3749. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3750. #if HTT_PADDR64
  3751. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3752. #endif
  3753. * |-------------------------------------------------------------------|
  3754. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3755. #if HTT_PADDR64
  3756. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3757. #endif
  3758. * |-------------------------------------------------------------------|
  3759. *
  3760. * Header fields:
  3761. * Header fields:
  3762. * - MSG_TYPE
  3763. * Bits 7:0
  3764. * Purpose: Identifies this as WDI_IPA config message
  3765. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3766. * - TX_PKT_POOL_SIZE
  3767. * Bits 15:0
  3768. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3769. * WDI_IPA TX path
  3770. * For systems using 32-bit format for bus addresses:
  3771. * - TX_COMP_RING_BASE_ADDR
  3772. * Bits 31:0
  3773. * Purpose: TX Completion Ring base address in DDR
  3774. * - TX_COMP_RING_SIZE
  3775. * Bits 31:0
  3776. * Purpose: TX Completion Ring size (must be power of 2)
  3777. * - TX_COMP_WR_IDX_ADDR
  3778. * Bits 31:0
  3779. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3780. * updates the Write Index for WDI_IPA TX completion ring
  3781. * - TX_CE_WR_IDX_ADDR
  3782. * Bits 31:0
  3783. * Purpose: DDR address where IPA uC
  3784. * updates the WR Index for TX CE ring
  3785. * (needed for fusion platforms)
  3786. * - RX_IND_RING_BASE_ADDR
  3787. * Bits 31:0
  3788. * Purpose: RX Indication Ring base address in DDR
  3789. * - RX_IND_RING_SIZE
  3790. * Bits 31:0
  3791. * Purpose: RX Indication Ring size
  3792. * - RX_IND_RD_IDX_ADDR
  3793. * Bits 31:0
  3794. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3795. * RX indication ring
  3796. * - RX_IND_WR_IDX_ADDR
  3797. * Bits 31:0
  3798. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3799. * updates the Write Index for WDI_IPA RX indication ring
  3800. * - RX_RING2_BASE_ADDR
  3801. * Bits 31:0
  3802. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3803. * - RX_RING2_SIZE
  3804. * Bits 31:0
  3805. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3806. * - RX_RING2_RD_IDX_ADDR
  3807. * Bits 31:0
  3808. * Purpose: If Second RX ring is Indication ring, DDR address where
  3809. * IPA uC updates the Read Index for Ring2.
  3810. * If Second RX ring is completion ring, this is NOT used
  3811. * - RX_RING2_WR_IDX_ADDR
  3812. * Bits 31:0
  3813. * Purpose: If Second RX ring is Indication ring, DDR address where
  3814. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3815. * If second RX ring is completion ring, DDR address where
  3816. * IPA uC updates the Write Index for Ring 2.
  3817. * For systems using 64-bit format for bus addresses:
  3818. * - TX_COMP_RING_BASE_ADDR_LO
  3819. * Bits 31:0
  3820. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3821. * - TX_COMP_RING_BASE_ADDR_HI
  3822. * Bits 31:0
  3823. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3824. * - TX_COMP_RING_SIZE
  3825. * Bits 31:0
  3826. * Purpose: TX Completion Ring size (must be power of 2)
  3827. * - TX_COMP_WR_IDX_ADDR_LO
  3828. * Bits 31:0
  3829. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3830. * Lower 4 bytes of DDR address where WIFI FW
  3831. * updates the Write Index for WDI_IPA TX completion ring
  3832. * - TX_COMP_WR_IDX_ADDR_HI
  3833. * Bits 31:0
  3834. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3835. * Higher 4 bytes of DDR address where WIFI FW
  3836. * updates the Write Index for WDI_IPA TX completion ring
  3837. * - TX_CE_WR_IDX_ADDR_LO
  3838. * Bits 31:0
  3839. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3840. * updates the WR Index for TX CE ring
  3841. * (needed for fusion platforms)
  3842. * - TX_CE_WR_IDX_ADDR_HI
  3843. * Bits 31:0
  3844. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3845. * updates the WR Index for TX CE ring
  3846. * (needed for fusion platforms)
  3847. * - RX_IND_RING_BASE_ADDR_LO
  3848. * Bits 31:0
  3849. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3850. * - RX_IND_RING_BASE_ADDR_HI
  3851. * Bits 31:0
  3852. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3853. * - RX_IND_RING_SIZE
  3854. * Bits 31:0
  3855. * Purpose: RX Indication Ring size
  3856. * - RX_IND_RD_IDX_ADDR_LO
  3857. * Bits 31:0
  3858. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3859. * for WDI_IPA RX indication ring
  3860. * - RX_IND_RD_IDX_ADDR_HI
  3861. * Bits 31:0
  3862. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3863. * for WDI_IPA RX indication ring
  3864. * - RX_IND_WR_IDX_ADDR_LO
  3865. * Bits 31:0
  3866. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3867. * Lower 4 bytes of DDR address where WIFI FW
  3868. * updates the Write Index for WDI_IPA RX indication ring
  3869. * - RX_IND_WR_IDX_ADDR_HI
  3870. * Bits 31:0
  3871. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3872. * Higher 4 bytes of DDR address where WIFI FW
  3873. * updates the Write Index for WDI_IPA RX indication ring
  3874. * - RX_RING2_BASE_ADDR_LO
  3875. * Bits 31:0
  3876. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3877. * - RX_RING2_BASE_ADDR_HI
  3878. * Bits 31:0
  3879. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3880. * - RX_RING2_SIZE
  3881. * Bits 31:0
  3882. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3883. * - RX_RING2_RD_IDX_ADDR_LO
  3884. * Bits 31:0
  3885. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3886. * DDR address where IPA uC updates the Read Index for Ring2.
  3887. * If Second RX ring is completion ring, this is NOT used
  3888. * - RX_RING2_RD_IDX_ADDR_HI
  3889. * Bits 31:0
  3890. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3891. * DDR address where IPA uC updates the Read Index for Ring2.
  3892. * If Second RX ring is completion ring, this is NOT used
  3893. * - RX_RING2_WR_IDX_ADDR_LO
  3894. * Bits 31:0
  3895. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3896. * DDR address where WIFI FW updates the Write Index
  3897. * for WDI_IPA RX ring2
  3898. * If second RX ring is completion ring, lower 4 bytes of
  3899. * DDR address where IPA uC updates the Write Index for Ring 2.
  3900. * - RX_RING2_WR_IDX_ADDR_HI
  3901. * Bits 31:0
  3902. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3903. * DDR address where WIFI FW updates the Write Index
  3904. * for WDI_IPA RX ring2
  3905. * If second RX ring is completion ring, higher 4 bytes of
  3906. * DDR address where IPA uC updates the Write Index for Ring 2.
  3907. */
  3908. #if HTT_PADDR64
  3909. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3910. #else
  3911. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3912. #endif
  3913. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3914. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3915. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3916. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3917. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3918. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3919. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3920. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3921. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3922. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3923. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3924. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3925. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3926. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3927. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3928. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3929. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3930. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3931. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3932. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3933. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3934. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3935. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3936. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3937. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3938. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3939. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3940. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3941. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3942. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3943. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3944. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3945. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3946. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3947. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3948. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3949. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3950. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3951. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3952. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3953. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3954. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3955. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3956. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3957. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3958. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3962. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3963. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3964. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3965. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3966. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3970. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3971. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3972. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3973. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3974. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3975. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3976. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3977. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3978. do { \
  3979. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3980. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3981. } while (0)
  3982. /* for systems using 32-bit format for bus addr */
  3983. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3984. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3985. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3986. do { \
  3987. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3988. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3989. } while (0)
  3990. /* for systems using 64-bit format for bus addr */
  3991. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3992. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3993. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3994. do { \
  3995. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3996. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3997. } while (0)
  3998. /* for systems using 64-bit format for bus addr */
  3999. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4000. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4002. do { \
  4003. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4004. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4005. } while (0)
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4007. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4008. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4009. do { \
  4010. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4011. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4012. } while (0)
  4013. /* for systems using 32-bit format for bus addr */
  4014. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4015. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4016. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4017. do { \
  4018. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4019. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4020. } while (0)
  4021. /* for systems using 64-bit format for bus addr */
  4022. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4023. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4024. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4025. do { \
  4026. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4027. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4028. } while (0)
  4029. /* for systems using 64-bit format for bus addr */
  4030. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4031. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4032. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4033. do { \
  4034. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4035. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4036. } while (0)
  4037. /* for systems using 32-bit format for bus addr */
  4038. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4039. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4040. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4041. do { \
  4042. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4043. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4044. } while (0)
  4045. /* for systems using 64-bit format for bus addr */
  4046. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4047. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4048. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4049. do { \
  4050. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4051. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4052. } while (0)
  4053. /* for systems using 64-bit format for bus addr */
  4054. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4055. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4056. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4057. do { \
  4058. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4059. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4060. } while (0)
  4061. /* for systems using 32-bit format for bus addr */
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4063. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4065. do { \
  4066. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4067. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4068. } while (0)
  4069. /* for systems using 64-bit format for bus addr */
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4071. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4073. do { \
  4074. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4075. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4076. } while (0)
  4077. /* for systems using 64-bit format for bus addr */
  4078. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4079. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4081. do { \
  4082. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4083. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4084. } while (0)
  4085. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4086. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4087. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4090. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4091. } while (0)
  4092. /* for systems using 32-bit format for bus addr */
  4093. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4094. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4095. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4096. do { \
  4097. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4098. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4099. } while (0)
  4100. /* for systems using 64-bit format for bus addr */
  4101. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4102. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4103. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4106. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4107. } while (0)
  4108. /* for systems using 64-bit format for bus addr */
  4109. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4110. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4111. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4112. do { \
  4113. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4114. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4115. } while (0)
  4116. /* for systems using 32-bit format for bus addr */
  4117. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4118. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4119. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4120. do { \
  4121. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4122. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4123. } while (0)
  4124. /* for systems using 64-bit format for bus addr */
  4125. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4126. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4127. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4128. do { \
  4129. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4130. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4131. } while (0)
  4132. /* for systems using 64-bit format for bus addr */
  4133. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4134. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4135. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4136. do { \
  4137. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4138. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4139. } while (0)
  4140. /* for systems using 32-bit format for bus addr */
  4141. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4142. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4143. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4144. do { \
  4145. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4146. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4147. } while (0)
  4148. /* for systems using 64-bit format for bus addr */
  4149. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4150. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4151. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4152. do { \
  4153. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4154. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4155. } while (0)
  4156. /* for systems using 64-bit format for bus addr */
  4157. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4158. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4159. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4160. do { \
  4161. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4162. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4163. } while (0)
  4164. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4165. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4166. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4169. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4170. } while (0)
  4171. /* for systems using 32-bit format for bus addr */
  4172. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4173. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4174. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4177. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4178. } while (0)
  4179. /* for systems using 64-bit format for bus addr */
  4180. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4181. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4182. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4185. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4186. } while (0)
  4187. /* for systems using 64-bit format for bus addr */
  4188. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4189. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4190. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4191. do { \
  4192. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4193. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4194. } while (0)
  4195. /* for systems using 32-bit format for bus addr */
  4196. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4197. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4198. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4199. do { \
  4200. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4201. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4202. } while (0)
  4203. /* for systems using 64-bit format for bus addr */
  4204. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4205. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4206. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4207. do { \
  4208. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4209. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4210. } while (0)
  4211. /* for systems using 64-bit format for bus addr */
  4212. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4213. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4214. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4215. do { \
  4216. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4217. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4218. } while (0)
  4219. /*
  4220. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4221. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4222. * addresses are stored in a XXX-bit field.
  4223. * This macro is used to define both htt_wdi_ipa_config32_t and
  4224. * htt_wdi_ipa_config64_t structs.
  4225. */
  4226. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4227. _paddr__tx_comp_ring_base_addr_, \
  4228. _paddr__tx_comp_wr_idx_addr_, \
  4229. _paddr__tx_ce_wr_idx_addr_, \
  4230. _paddr__rx_ind_ring_base_addr_, \
  4231. _paddr__rx_ind_rd_idx_addr_, \
  4232. _paddr__rx_ind_wr_idx_addr_, \
  4233. _paddr__rx_ring2_base_addr_,\
  4234. _paddr__rx_ring2_rd_idx_addr_,\
  4235. _paddr__rx_ring2_wr_idx_addr_) \
  4236. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4237. { \
  4238. /* DWORD 0: flags and meta-data */ \
  4239. A_UINT32 \
  4240. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4241. reserved: 8, \
  4242. tx_pkt_pool_size: 16;\
  4243. /* DWORD 1 */\
  4244. _paddr__tx_comp_ring_base_addr_;\
  4245. /* DWORD 2 (or 3)*/\
  4246. A_UINT32 tx_comp_ring_size;\
  4247. /* DWORD 3 (or 4)*/\
  4248. _paddr__tx_comp_wr_idx_addr_;\
  4249. /* DWORD 4 (or 6)*/\
  4250. _paddr__tx_ce_wr_idx_addr_;\
  4251. /* DWORD 5 (or 8)*/\
  4252. _paddr__rx_ind_ring_base_addr_;\
  4253. /* DWORD 6 (or 10)*/\
  4254. A_UINT32 rx_ind_ring_size;\
  4255. /* DWORD 7 (or 11)*/\
  4256. _paddr__rx_ind_rd_idx_addr_;\
  4257. /* DWORD 8 (or 13)*/\
  4258. _paddr__rx_ind_wr_idx_addr_;\
  4259. /* DWORD 9 (or 15)*/\
  4260. _paddr__rx_ring2_base_addr_;\
  4261. /* DWORD 10 (or 17) */\
  4262. A_UINT32 rx_ring2_size;\
  4263. /* DWORD 11 (or 18) */\
  4264. _paddr__rx_ring2_rd_idx_addr_;\
  4265. /* DWORD 12 (or 20) */\
  4266. _paddr__rx_ring2_wr_idx_addr_;\
  4267. } POSTPACK
  4268. /* define a htt_wdi_ipa_config32_t type */
  4269. 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));
  4270. /* define a htt_wdi_ipa_config64_t type */
  4271. 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));
  4272. #if HTT_PADDR64
  4273. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4274. #else
  4275. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4276. #endif
  4277. enum htt_wdi_ipa_op_code {
  4278. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4279. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4280. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4281. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4282. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4283. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4284. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4285. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4286. /* keep this last */
  4287. HTT_WDI_IPA_OPCODE_MAX
  4288. };
  4289. /**
  4290. * @brief HTT WDI_IPA Operation Request Message
  4291. *
  4292. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4293. *
  4294. * @details
  4295. * HTT WDI_IPA Operation Request message is sent by host
  4296. * to either suspend or resume WDI_IPA TX or RX path.
  4297. * |31 24|23 16|15 8|7 0|
  4298. * |----------------+----------------+----------------+----------------|
  4299. * | op_code | Rsvd | msg_type |
  4300. * |-------------------------------------------------------------------|
  4301. *
  4302. * Header fields:
  4303. * - MSG_TYPE
  4304. * Bits 7:0
  4305. * Purpose: Identifies this as WDI_IPA Operation Request message
  4306. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4307. * - OP_CODE
  4308. * Bits 31:16
  4309. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4310. * value: = enum htt_wdi_ipa_op_code
  4311. */
  4312. PREPACK struct htt_wdi_ipa_op_request_t
  4313. {
  4314. /* DWORD 0: flags and meta-data */
  4315. A_UINT32
  4316. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4317. reserved: 8,
  4318. op_code: 16;
  4319. } POSTPACK;
  4320. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4321. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4322. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4323. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4324. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4325. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4326. do { \
  4327. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4328. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4329. } while (0)
  4330. /*
  4331. * @brief host -> target HTT_SRING_SETUP message
  4332. *
  4333. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4334. *
  4335. * @details
  4336. * After target is booted up, Host can send SRING setup message for
  4337. * each host facing LMAC SRING. Target setups up HW registers based
  4338. * on setup message and confirms back to Host if response_required is set.
  4339. * Host should wait for confirmation message before sending new SRING
  4340. * setup message
  4341. *
  4342. * The message would appear as follows:
  4343. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4344. * |--------------- +-----------------+-----------------+-----------------|
  4345. * | ring_type | ring_id | pdev_id | msg_type |
  4346. * |----------------------------------------------------------------------|
  4347. * | ring_base_addr_lo |
  4348. * |----------------------------------------------------------------------|
  4349. * | ring_base_addr_hi |
  4350. * |----------------------------------------------------------------------|
  4351. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4352. * |----------------------------------------------------------------------|
  4353. * | ring_head_offset32_remote_addr_lo |
  4354. * |----------------------------------------------------------------------|
  4355. * | ring_head_offset32_remote_addr_hi |
  4356. * |----------------------------------------------------------------------|
  4357. * | ring_tail_offset32_remote_addr_lo |
  4358. * |----------------------------------------------------------------------|
  4359. * | ring_tail_offset32_remote_addr_hi |
  4360. * |----------------------------------------------------------------------|
  4361. * | ring_msi_addr_lo |
  4362. * |----------------------------------------------------------------------|
  4363. * | ring_msi_addr_hi |
  4364. * |----------------------------------------------------------------------|
  4365. * | ring_msi_data |
  4366. * |----------------------------------------------------------------------|
  4367. * | intr_timer_th |IM| intr_batch_counter_th |
  4368. * |----------------------------------------------------------------------|
  4369. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4370. * |----------------------------------------------------------------------|
  4371. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4372. * |----------------------------------------------------------------------|
  4373. * Where
  4374. * IM = sw_intr_mode
  4375. * RR = response_required
  4376. * PTCF = prefetch_timer_cfg
  4377. * IP = IPA drop flag
  4378. *
  4379. * The message is interpreted as follows:
  4380. * dword0 - b'0:7 - msg_type: This will be set to
  4381. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4382. * b'8:15 - pdev_id:
  4383. * 0 (for rings at SOC/UMAC level),
  4384. * 1/2/3 mac id (for rings at LMAC level)
  4385. * b'16:23 - ring_id: identify which ring is to setup,
  4386. * more details can be got from enum htt_srng_ring_id
  4387. * b'24:31 - ring_type: identify type of host rings,
  4388. * more details can be got from enum htt_srng_ring_type
  4389. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4390. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4391. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4392. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4393. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4394. * SW_TO_HW_RING.
  4395. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4396. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4397. * Lower 32 bits of memory address of the remote variable
  4398. * storing the 4-byte word offset that identifies the head
  4399. * element within the ring.
  4400. * (The head offset variable has type A_UINT32.)
  4401. * Valid for HW_TO_SW and SW_TO_SW rings.
  4402. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4403. * Upper 32 bits of memory address of the remote variable
  4404. * storing the 4-byte word offset that identifies the head
  4405. * element within the ring.
  4406. * (The head offset variable has type A_UINT32.)
  4407. * Valid for HW_TO_SW and SW_TO_SW rings.
  4408. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4409. * Lower 32 bits of memory address of the remote variable
  4410. * storing the 4-byte word offset that identifies the tail
  4411. * element within the ring.
  4412. * (The tail offset variable has type A_UINT32.)
  4413. * Valid for HW_TO_SW and SW_TO_SW rings.
  4414. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4415. * Upper 32 bits of memory address of the remote variable
  4416. * storing the 4-byte word offset that identifies the tail
  4417. * element within the ring.
  4418. * (The tail offset variable has type A_UINT32.)
  4419. * Valid for HW_TO_SW and SW_TO_SW rings.
  4420. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4421. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4422. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4423. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4424. * dword10 - b'0:31 - ring_msi_data: MSI data
  4425. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4426. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4427. * dword11 - b'0:14 - intr_batch_counter_th:
  4428. * batch counter threshold is in units of 4-byte words.
  4429. * HW internally maintains and increments batch count.
  4430. * (see SRING spec for detail description).
  4431. * When batch count reaches threshold value, an interrupt
  4432. * is generated by HW.
  4433. * b'15 - sw_intr_mode:
  4434. * This configuration shall be static.
  4435. * Only programmed at power up.
  4436. * 0: generate pulse style sw interrupts
  4437. * 1: generate level style sw interrupts
  4438. * b'16:31 - intr_timer_th:
  4439. * The timer init value when timer is idle or is
  4440. * initialized to start downcounting.
  4441. * In 8us units (to cover a range of 0 to 524 ms)
  4442. * dword12 - b'0:15 - intr_low_threshold:
  4443. * Used only by Consumer ring to generate ring_sw_int_p.
  4444. * Ring entries low threshold water mark, that is used
  4445. * in combination with the interrupt timer as well as
  4446. * the the clearing of the level interrupt.
  4447. * b'16:18 - prefetch_timer_cfg:
  4448. * Used only by Consumer ring to set timer mode to
  4449. * support Application prefetch handling.
  4450. * The external tail offset/pointer will be updated
  4451. * at following intervals:
  4452. * 3'b000: (Prefetch feature disabled; used only for debug)
  4453. * 3'b001: 1 usec
  4454. * 3'b010: 4 usec
  4455. * 3'b011: 8 usec (default)
  4456. * 3'b100: 16 usec
  4457. * Others: Reserverd
  4458. * b'19 - response_required:
  4459. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4460. * b'20 - ipa_drop_flag:
  4461. Indicates that host will config ipa drop threshold percentage
  4462. * b'21:31 - reserved: reserved for future use
  4463. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4464. * b'8:15 - ipa drop high threshold percentage:
  4465. * b'16:31 - Reserved
  4466. */
  4467. PREPACK struct htt_sring_setup_t {
  4468. A_UINT32 msg_type: 8,
  4469. pdev_id: 8,
  4470. ring_id: 8,
  4471. ring_type: 8;
  4472. A_UINT32 ring_base_addr_lo;
  4473. A_UINT32 ring_base_addr_hi;
  4474. A_UINT32 ring_size: 16,
  4475. ring_entry_size: 8,
  4476. ring_misc_cfg_flag: 8;
  4477. A_UINT32 ring_head_offset32_remote_addr_lo;
  4478. A_UINT32 ring_head_offset32_remote_addr_hi;
  4479. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4480. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4481. A_UINT32 ring_msi_addr_lo;
  4482. A_UINT32 ring_msi_addr_hi;
  4483. A_UINT32 ring_msi_data;
  4484. A_UINT32 intr_batch_counter_th: 15,
  4485. sw_intr_mode: 1,
  4486. intr_timer_th: 16;
  4487. A_UINT32 intr_low_threshold: 16,
  4488. prefetch_timer_cfg: 3,
  4489. response_required: 1,
  4490. ipa_drop_flag: 1,
  4491. reserved1: 11;
  4492. A_UINT32 ipa_drop_low_threshold: 8,
  4493. ipa_drop_high_threshold: 8,
  4494. reserved: 16;
  4495. } POSTPACK;
  4496. enum htt_srng_ring_type {
  4497. HTT_HW_TO_SW_RING = 0,
  4498. HTT_SW_TO_HW_RING,
  4499. HTT_SW_TO_SW_RING,
  4500. /* Insert new ring types above this line */
  4501. };
  4502. enum htt_srng_ring_id {
  4503. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4504. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4505. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4506. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4507. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4508. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4509. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4510. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4511. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4512. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4513. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4514. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4515. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4516. /* Add Other SRING which can't be directly configured by host software above this line */
  4517. };
  4518. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4519. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4520. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4521. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4522. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4523. HTT_SRING_SETUP_PDEV_ID_S)
  4524. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4527. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4528. } while (0)
  4529. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4530. #define HTT_SRING_SETUP_RING_ID_S 16
  4531. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4532. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4533. HTT_SRING_SETUP_RING_ID_S)
  4534. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4537. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4538. } while (0)
  4539. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4540. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4541. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4542. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4543. HTT_SRING_SETUP_RING_TYPE_S)
  4544. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4547. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4548. } while (0)
  4549. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4550. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4551. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4552. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4553. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4554. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4555. do { \
  4556. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4557. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4558. } while (0)
  4559. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4560. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4561. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4562. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4563. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4564. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4565. do { \
  4566. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4567. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4568. } while (0)
  4569. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4570. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4571. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4572. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4573. HTT_SRING_SETUP_RING_SIZE_S)
  4574. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4575. do { \
  4576. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4577. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4578. } while (0)
  4579. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4580. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4581. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4582. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4583. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4584. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4585. do { \
  4586. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4587. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4588. } while (0)
  4589. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4590. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4591. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4592. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4593. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4594. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4595. do { \
  4596. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4597. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4598. } while (0)
  4599. /* This control bit is applicable to only Producer, which updates Ring ID field
  4600. * of each descriptor before pushing into the ring.
  4601. * 0: updates ring_id(default)
  4602. * 1: ring_id updating disabled */
  4603. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4604. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4605. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4606. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4607. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4608. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4609. do { \
  4610. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4611. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4612. } while (0)
  4613. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4614. * of each descriptor before pushing into the ring.
  4615. * 0: updates Loopcnt(default)
  4616. * 1: Loopcnt updating disabled */
  4617. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4618. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4619. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4620. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4621. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4622. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4623. do { \
  4624. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4625. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4626. } while (0)
  4627. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4628. * into security_id port of GXI/AXI. */
  4629. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4630. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4631. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4632. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4633. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4634. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4635. do { \
  4636. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4637. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4638. } while (0)
  4639. /* During MSI write operation, SRNG drives value of this register bit into
  4640. * swap bit of GXI/AXI. */
  4641. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4642. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4643. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4644. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4645. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4646. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4647. do { \
  4648. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4649. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4650. } while (0)
  4651. /* During Pointer write operation, SRNG drives value of this register bit into
  4652. * swap bit of GXI/AXI. */
  4653. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4654. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4655. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4656. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4657. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4658. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4659. do { \
  4660. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4661. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4662. } while (0)
  4663. /* During any data or TLV write operation, SRNG drives value of this register
  4664. * bit into swap bit of GXI/AXI. */
  4665. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4666. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4667. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4668. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4669. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4670. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4671. do { \
  4672. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4673. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4674. } while (0)
  4675. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4676. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4677. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4678. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4679. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4680. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4681. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4682. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4683. do { \
  4684. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4685. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4686. } while (0)
  4687. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4688. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4689. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4690. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4691. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4692. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4693. do { \
  4694. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4695. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4696. } while (0)
  4697. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4698. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4699. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4700. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4701. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4702. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4703. do { \
  4704. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4705. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4706. } while (0)
  4707. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4708. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4709. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4710. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4711. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4712. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4713. do { \
  4714. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4715. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4716. } while (0)
  4717. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4718. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4719. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4720. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4721. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4722. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4723. do { \
  4724. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4725. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4726. } while (0)
  4727. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4728. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4729. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4730. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4731. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4732. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4733. do { \
  4734. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4735. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4736. } while (0)
  4737. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4738. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4739. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4740. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4741. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4742. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4743. do { \
  4744. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4745. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4746. } while (0)
  4747. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4748. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4749. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4750. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4751. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4752. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4753. do { \
  4754. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4755. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4756. } while (0)
  4757. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4758. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4759. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4760. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4761. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4762. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4765. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4766. } while (0)
  4767. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4768. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4769. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4770. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4771. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4772. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4775. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4776. } while (0)
  4777. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4778. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4779. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4780. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4781. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4782. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4783. do { \
  4784. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4785. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4786. } while (0)
  4787. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4788. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4789. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4790. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4791. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4792. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4795. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4796. } while (0)
  4797. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4798. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4799. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4800. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4801. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4802. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4803. do { \
  4804. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4805. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4806. } while (0)
  4807. /**
  4808. * @brief host -> target RX ring selection config message
  4809. *
  4810. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4811. *
  4812. * @details
  4813. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4814. * configure RXDMA rings.
  4815. * The configuration is per ring based and includes both packet subtypes
  4816. * and PPDU/MPDU TLVs.
  4817. *
  4818. * The message would appear as follows:
  4819. *
  4820. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4821. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4822. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4823. * |-------------------------------------------------------------------|
  4824. * | rsvd2 | ring_buffer_size |
  4825. * |-------------------------------------------------------------------|
  4826. * | packet_type_enable_flags_0 |
  4827. * |-------------------------------------------------------------------|
  4828. * | packet_type_enable_flags_1 |
  4829. * |-------------------------------------------------------------------|
  4830. * | packet_type_enable_flags_2 |
  4831. * |-------------------------------------------------------------------|
  4832. * | packet_type_enable_flags_3 |
  4833. * |-------------------------------------------------------------------|
  4834. * | tlv_filter_in_flags |
  4835. * |-------------------------------------------------------------------|
  4836. * | rx_header_offset | rx_packet_offset |
  4837. * |-------------------------------------------------------------------|
  4838. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4839. * |-------------------------------------------------------------------|
  4840. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4841. * |-------------------------------------------------------------------|
  4842. * | rsvd3 | rx_attention_offset |
  4843. * |-------------------------------------------------------------------|
  4844. * | rsvd4 | mo| fp| rx_drop_threshold |
  4845. * | |ndp|ndp| |
  4846. * |-------------------------------------------------------------------|
  4847. * Where:
  4848. * PS = pkt_swap
  4849. * SS = status_swap
  4850. * OV = rx_offsets_valid
  4851. * DT = drop_thresh_valid
  4852. * The message is interpreted as follows:
  4853. * dword0 - b'0:7 - msg_type: This will be set to
  4854. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4855. * b'8:15 - pdev_id:
  4856. * 0 (for rings at SOC/UMAC level),
  4857. * 1/2/3 mac id (for rings at LMAC level)
  4858. * b'16:23 - ring_id : Identify the ring to configure.
  4859. * More details can be got from enum htt_srng_ring_id
  4860. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4861. * BUF_RING_CFG_0 defs within HW .h files,
  4862. * e.g. wmac_top_reg_seq_hwioreg.h
  4863. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4864. * BUF_RING_CFG_0 defs within HW .h files,
  4865. * e.g. wmac_top_reg_seq_hwioreg.h
  4866. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4867. * configuration fields are valid
  4868. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4869. * rx_drop_threshold field is valid
  4870. * b'28:31 - rsvd1: reserved for future use
  4871. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4872. * in byte units.
  4873. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4874. * - b'16:31 - rsvd2: Reserved for future use
  4875. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4876. * Enable MGMT packet from 0b0000 to 0b1001
  4877. * bits from low to high: FP, MD, MO - 3 bits
  4878. * FP: Filter_Pass
  4879. * MD: Monitor_Direct
  4880. * MO: Monitor_Other
  4881. * 10 mgmt subtypes * 3 bits -> 30 bits
  4882. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4883. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4884. * Enable MGMT packet from 0b1010 to 0b1111
  4885. * bits from low to high: FP, MD, MO - 3 bits
  4886. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4887. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4888. * Enable CTRL packet from 0b0000 to 0b1001
  4889. * bits from low to high: FP, MD, MO - 3 bits
  4890. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4891. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4892. * Enable CTRL packet from 0b1010 to 0b1111,
  4893. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4894. * bits from low to high: FP, MD, MO - 3 bits
  4895. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4896. * dword6 - b'0:31 - tlv_filter_in_flags:
  4897. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4898. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4899. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4900. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4901. * A value of 0 will be considered as ignore this config.
  4902. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4903. * e.g. wmac_top_reg_seq_hwioreg.h
  4904. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4905. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4906. * A value of 0 will be considered as ignore this config.
  4907. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4908. * e.g. wmac_top_reg_seq_hwioreg.h
  4909. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4910. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4911. * A value of 0 will be considered as ignore this config.
  4912. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4913. * e.g. wmac_top_reg_seq_hwioreg.h
  4914. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4915. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4916. * A value of 0 will be considered as ignore this config.
  4917. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4918. * e.g. wmac_top_reg_seq_hwioreg.h
  4919. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4920. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4921. * A value of 0 will be considered as ignore this config.
  4922. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4923. * e.g. wmac_top_reg_seq_hwioreg.h
  4924. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4925. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4926. * A value of 0 will be considered as ignore this config.
  4927. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4928. * e.g. wmac_top_reg_seq_hwioreg.h
  4929. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4930. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4931. * A value of 0 will be considered as ignore this config.
  4932. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4933. * e.g. wmac_top_reg_seq_hwioreg.h
  4934. * - b'16:31 - rsvd3 for future use
  4935. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4936. * to source rings. Consumer drops packets if the available
  4937. * words in the ring falls below the configured threshold
  4938. * value.
  4939. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4940. * by host. 1 -> subscribed
  4941. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4942. * by host. 1 -> subscribed
  4943. */
  4944. PREPACK struct htt_rx_ring_selection_cfg_t {
  4945. A_UINT32 msg_type: 8,
  4946. pdev_id: 8,
  4947. ring_id: 8,
  4948. status_swap: 1,
  4949. pkt_swap: 1,
  4950. rx_offsets_valid: 1,
  4951. drop_thresh_valid: 1,
  4952. rsvd1: 4;
  4953. A_UINT32 ring_buffer_size: 16,
  4954. rsvd2: 16;
  4955. A_UINT32 packet_type_enable_flags_0;
  4956. A_UINT32 packet_type_enable_flags_1;
  4957. A_UINT32 packet_type_enable_flags_2;
  4958. A_UINT32 packet_type_enable_flags_3;
  4959. A_UINT32 tlv_filter_in_flags;
  4960. A_UINT32 rx_packet_offset: 16,
  4961. rx_header_offset: 16;
  4962. A_UINT32 rx_mpdu_end_offset: 16,
  4963. rx_mpdu_start_offset: 16;
  4964. A_UINT32 rx_msdu_end_offset: 16,
  4965. rx_msdu_start_offset: 16;
  4966. A_UINT32 rx_attn_offset: 16,
  4967. rsvd3: 16;
  4968. A_UINT32 rx_drop_threshold: 10,
  4969. fp_ndp: 1,
  4970. mo_ndp: 1,
  4971. rsvd4: 20;
  4972. } POSTPACK;
  4973. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4974. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4975. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4976. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4977. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4978. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4979. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4980. do { \
  4981. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4982. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4983. } while (0)
  4984. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4985. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4986. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4987. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4988. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4989. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4990. do { \
  4991. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4992. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4993. } while (0)
  4994. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4995. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4996. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4997. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4998. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4999. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5002. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5003. } while (0)
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5007. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5008. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5010. do { \
  5011. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5012. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5013. } while (0)
  5014. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5015. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5016. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5017. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5018. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5019. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5020. do { \
  5021. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5022. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5023. } while (0)
  5024. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5025. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5026. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5027. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5028. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5029. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5030. do { \
  5031. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5032. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5033. } while (0)
  5034. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5035. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5036. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5037. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5038. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5039. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5040. do { \
  5041. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5042. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5043. } while (0)
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5047. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5048. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5050. do { \
  5051. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5052. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5053. } while (0)
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5057. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5058. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5060. do { \
  5061. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5062. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5063. } while (0)
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5067. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5068. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5070. do { \
  5071. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5072. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5073. } while (0)
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5077. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5078. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5080. do { \
  5081. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5082. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5083. } while (0)
  5084. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5085. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5086. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5087. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5088. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5089. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5090. do { \
  5091. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5092. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5093. } while (0)
  5094. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5095. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5096. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5097. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5098. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5099. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5100. do { \
  5101. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5102. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5103. } while (0)
  5104. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5105. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5106. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5107. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5108. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5109. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5110. do { \
  5111. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5112. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5113. } while (0)
  5114. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5115. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5116. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5117. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5118. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5119. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5120. do { \
  5121. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5122. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5123. } while (0)
  5124. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5125. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5126. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5127. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5128. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5129. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5130. do { \
  5131. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5132. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5133. } while (0)
  5134. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5135. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5136. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5137. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5138. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5139. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5140. do { \
  5141. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5142. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5143. } while (0)
  5144. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5145. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5146. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5147. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5148. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5149. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5150. do { \
  5151. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5152. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5153. } while (0)
  5154. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5155. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5156. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5157. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5158. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5159. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5160. do { \
  5161. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5162. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5163. } while (0)
  5164. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5165. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5166. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5167. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5168. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5169. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5170. do { \
  5171. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5172. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5173. } while (0)
  5174. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5175. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5176. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5177. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5178. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5179. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5180. do { \
  5181. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5182. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5183. } while (0)
  5184. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5185. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5186. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5187. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5188. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5189. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5190. do { \
  5191. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5192. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5193. } while (0)
  5194. /*
  5195. * Subtype based MGMT frames enable bits.
  5196. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5197. */
  5198. /* association request */
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5205. /* association response */
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5212. /* Reassociation request */
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5219. /* Reassociation response */
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5226. /* Probe request */
  5227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5228. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5233. /* Probe response */
  5234. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5236. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5237. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5238. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5240. /* Timing Advertisement */
  5241. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5242. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5243. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5244. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5245. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5246. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5247. /* Reserved */
  5248. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5249. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5254. /* Beacon */
  5255. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5256. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5257. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5258. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5259. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5260. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5261. /* ATIM */
  5262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5263. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5265. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5266. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5268. /* Disassociation */
  5269. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5270. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5271. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5274. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5275. /* Authentication */
  5276. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5277. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5278. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5279. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5280. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5281. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5282. /* Deauthentication */
  5283. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5284. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5285. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5286. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5287. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5288. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5289. /* Action */
  5290. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5291. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5292. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5293. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5294. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5295. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5296. /* Action No Ack */
  5297. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5298. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5299. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5300. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5301. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5302. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5303. /* Reserved */
  5304. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5305. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5306. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5307. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5308. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5309. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5310. /*
  5311. * Subtype based CTRL frames enable bits.
  5312. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5313. */
  5314. /* Reserved */
  5315. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5316. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5317. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5318. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5319. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5320. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5321. /* Reserved */
  5322. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5323. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5324. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5325. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5326. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5327. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5328. /* Reserved */
  5329. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5330. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5331. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5332. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5334. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5335. /* Reserved */
  5336. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5337. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5338. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5340. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5342. /* Reserved */
  5343. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5344. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5345. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5346. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5347. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5349. /* Reserved */
  5350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5351. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5354. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5356. /* Reserved */
  5357. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5358. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5363. /* Control Wrapper */
  5364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5365. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5366. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5370. /* Block Ack Request */
  5371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5372. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5377. /* Block Ack*/
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5382. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5384. /* PS-POLL */
  5385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5391. /* RTS */
  5392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5398. /* CTS */
  5399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5405. /* ACK */
  5406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5412. /* CF-END */
  5413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5419. /* CF-END + CF-ACK */
  5420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5426. /* Multicast data */
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5433. /* Unicast data */
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5440. /* NULL data */
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5444. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5448. do { \
  5449. HTT_CHECK_SET_VAL(httsym, value); \
  5450. (word) |= (value) << httsym##_S; \
  5451. } while (0)
  5452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5453. (((word) & httsym##_M) >> httsym##_S)
  5454. #define htt_rx_ring_pkt_enable_subtype_set( \
  5455. word, flag, mode, type, subtype, val) \
  5456. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5457. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5458. #define htt_rx_ring_pkt_enable_subtype_get( \
  5459. word, flag, mode, type, subtype) \
  5460. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5461. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5462. /* Definition to filter in TLVs */
  5463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5467. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5469. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5470. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5471. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5472. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5473. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5474. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5475. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5476. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5477. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5478. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5479. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5480. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5481. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5482. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5483. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5484. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5485. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5486. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5487. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5488. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5489. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(httsym, enable); \
  5492. (word) |= (enable) << httsym##_S; \
  5493. } while (0)
  5494. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5495. (((word) & httsym##_M) >> httsym##_S)
  5496. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5497. HTT_RX_RING_TLV_ENABLE_SET( \
  5498. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5499. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5500. HTT_RX_RING_TLV_ENABLE_GET( \
  5501. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5502. /**
  5503. * @brief host -> target TX monitor config message
  5504. *
  5505. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5506. *
  5507. * @details
  5508. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5509. * configure RXDMA rings.
  5510. * The configuration is per ring based and includes both packet types
  5511. * and PPDU/MPDU TLVs.
  5512. *
  5513. * The message would appear as follows:
  5514. *
  5515. * |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|
  5516. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5517. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5518. * |-----------+--------+--------+-----+------------------------------------|
  5519. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5520. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5521. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5522. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5523. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5524. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5525. * |------------------------------------------------------------------------|
  5526. * | tlv_filter_mask_in0 |
  5527. * |------------------------------------------------------------------------|
  5528. * | tlv_filter_mask_in1 |
  5529. * |------------------------------------------------------------------------|
  5530. * | tlv_filter_mask_in2 |
  5531. * |------------------------------------------------------------------------|
  5532. * | tlv_filter_mask_in3 |
  5533. * |-----------------+-----------------+---------------------+--------------|
  5534. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5535. * |------------------------------------------------------------------------|
  5536. * | pcu_ppdu_setup_word_mask |
  5537. * |--------------------+--+--+--+-----+---------------------+--------------|
  5538. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5539. * |------------------------------------------------------------------------|
  5540. *
  5541. * Where:
  5542. * PS = pkt_swap
  5543. * SS = status_swap
  5544. * The message is interpreted as follows:
  5545. * dword0 - b'0:7 - msg_type: This will be set to
  5546. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5547. * b'8:15 - pdev_id:
  5548. * 0 (for rings at SOC level),
  5549. * 1/2/3 mac id (for rings at LMAC level)
  5550. * b'16:23 - ring_id : Identify the ring to configure.
  5551. * More details can be got from enum htt_srng_ring_id
  5552. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5553. * BUF_RING_CFG_0 defs within HW .h files,
  5554. * e.g. wmac_top_reg_seq_hwioreg.h
  5555. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5556. * BUF_RING_CFG_0 defs within HW .h files,
  5557. * e.g. wmac_top_reg_seq_hwioreg.h
  5558. * b'26:31 - rsvd1: reserved for future use
  5559. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5560. * in byte units.
  5561. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5562. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5563. * 64, 128, 256.
  5564. * If all 3 bits are set config length is > 256.
  5565. * if val is '0', then ignore this field.
  5566. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5567. * 64, 128, 256.
  5568. * If all 3 bits are set config length is > 256.
  5569. * if val is '0', then ignore this field.
  5570. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5571. * 64, 128, 256.
  5572. * If all 3 bits are set config length is > 256.
  5573. * If val is '0', then ignore this field.
  5574. * - b'25:31 - rsvd2: Reserved for future use
  5575. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5576. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5577. * If packet_type_enable_flags is '1' for MGMT type,
  5578. * monitor will ignore this bit and allow this TLV.
  5579. * If packet_type_enable_flags is '0' for MGMT type,
  5580. * monitor will use this bit to enable/disable logging
  5581. * of this TLV.
  5582. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5583. * If packet_type_enable_flags is '1' for CTRL type,
  5584. * monitor will ignore this bit and allow this TLV.
  5585. * If packet_type_enable_flags is '0' for CTRL type,
  5586. * monitor will use this bit to enable/disable logging
  5587. * of this TLV.
  5588. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5589. * If packet_type_enable_flags is '1' for DATA type,
  5590. * monitor will ignore this bit and allow this TLV.
  5591. * If packet_type_enable_flags is '0' for DATA type,
  5592. * monitor will use this bit to enable/disable logging
  5593. * of this TLV.
  5594. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5595. * If packet_type_enable_flags is '1' for MGMT type,
  5596. * monitor will ignore this bit and allow this TLV.
  5597. * If packet_type_enable_flags is '0' for MGMT type,
  5598. * monitor will use this bit to enable/disable logging
  5599. * of this TLV.
  5600. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5601. * If packet_type_enable_flags is '1' for CTRL type,
  5602. * monitor will ignore this bit and allow this TLV.
  5603. * If packet_type_enable_flags is '0' for CTRL type,
  5604. * monitor will use this bit to enable/disable logging
  5605. * of this TLV.
  5606. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5607. * If packet_type_enable_flags is '1' for DATA type,
  5608. * monitor will ignore this bit and allow this TLV.
  5609. * If packet_type_enable_flags is '0' for DATA type,
  5610. * monitor will use this bit to enable/disable logging
  5611. * of this TLV.
  5612. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5613. * If packet_type_enable_flags is '1' for MGMT type,
  5614. * monitor will ignore this bit and allow this TLV.
  5615. * If packet_type_enable_flags is '0' for MGMT type,
  5616. * monitor will use this bit to enable/disable logging
  5617. * of this TLV.
  5618. * If filter_in_TX_MPDU_START = 1 it is recommended
  5619. * to set this bit.
  5620. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5621. * If packet_type_enable_flags is '1' for CTRL type,
  5622. * monitor will ignore this bit and allow this TLV.
  5623. * If packet_type_enable_flags is '0' for CTRL type,
  5624. * monitor will use this bit to enable/disable logging
  5625. * of this TLV.
  5626. * If filter_in_TX_MPDU_START = 1 it is recommended
  5627. * to set this bit.
  5628. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5629. * If packet_type_enable_flags is '1' for DATA type,
  5630. * monitor will ignore this bit and allow this TLV.
  5631. * If packet_type_enable_flags is '0' for DATA type,
  5632. * monitor will use this bit to enable/disable logging
  5633. * of this TLV.
  5634. * If filter_in_TX_MPDU_START = 1 it is recommended
  5635. * to set this bit.
  5636. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5637. * If packet_type_enable_flags is '1' for MGMT type,
  5638. * monitor will ignore this bit and allow this TLV.
  5639. * If packet_type_enable_flags is '0' for MGMT type,
  5640. * monitor will use this bit to enable/disable logging
  5641. * of this TLV.
  5642. * If filter_in_TX_MSDU_START = 1 it is recommended
  5643. * to set this bit.
  5644. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5645. * If packet_type_enable_flags is '1' for CTRL type,
  5646. * monitor will ignore this bit and allow this TLV.
  5647. * If packet_type_enable_flags is '0' for CTRL type,
  5648. * monitor will use this bit to enable/disable logging
  5649. * of this TLV.
  5650. * If filter_in_TX_MSDU_START = 1 it is recommended
  5651. * to set this bit.
  5652. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5653. * If packet_type_enable_flags is '1' for DATA type,
  5654. * monitor will ignore this bit and allow this TLV.
  5655. * If packet_type_enable_flags is '0' for DATA type,
  5656. * monitor will use this bit to enable/disable logging
  5657. * of this TLV.
  5658. * If filter_in_TX_MSDU_START = 1 it is recommended
  5659. * to set this bit.
  5660. * b'15:31 - rsvd3: Reserved for future use
  5661. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5662. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5663. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5664. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5665. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5666. * - b'8:15 - tx_peer_entry_word_mask:
  5667. * - b'16:23 - tx_queue_ext_word_mask:
  5668. * - b'24:31 - tx_msdu_start_word_mask:
  5669. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5670. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5671. * - b'8:15 - rxpcu_user_setup_word_mask:
  5672. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5673. * MGMT, CTRL, DATA
  5674. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5675. * 0 -> MSDU level logging is enabled
  5676. * (valid only if bit is set in
  5677. * pkt_type_enable_msdu_or_mpdu_logging)
  5678. * 1 -> MPDU level logging is enabled
  5679. * (valid only if bit is set in
  5680. * pkt_type_enable_msdu_or_mpdu_logging)
  5681. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5682. * 0 -> MSDU level logging is enabled
  5683. * (valid only if bit is set in
  5684. * pkt_type_enable_msdu_or_mpdu_logging)
  5685. * 1 -> MPDU level logging is enabled
  5686. * (valid only if bit is set in
  5687. * pkt_type_enable_msdu_or_mpdu_logging)
  5688. * - b'21 - dma_mpdu_data(D) : For DATA
  5689. * 0 -> MSDU level logging is enabled
  5690. * (valid only if bit is set in
  5691. * pkt_type_enable_msdu_or_mpdu_logging)
  5692. * 1 -> MPDU level logging is enabled
  5693. * (valid only if bit is set in
  5694. * pkt_type_enable_msdu_or_mpdu_logging)
  5695. * - b'22:31 - rsvd4 for future use
  5696. */
  5697. PREPACK struct htt_tx_monitor_cfg_t {
  5698. A_UINT32 msg_type: 8,
  5699. pdev_id: 8,
  5700. ring_id: 8,
  5701. status_swap: 1,
  5702. pkt_swap: 1,
  5703. rsvd1: 6;
  5704. A_UINT32 ring_buffer_size: 16,
  5705. config_length_mgmt: 3,
  5706. config_length_ctrl: 3,
  5707. config_length_data: 3,
  5708. rsvd2: 7;
  5709. A_UINT32 pkt_type_enable_flags: 3,
  5710. filter_in_tx_mpdu_start_mgmt: 1,
  5711. filter_in_tx_mpdu_start_ctrl: 1,
  5712. filter_in_tx_mpdu_start_data: 1,
  5713. filter_in_tx_msdu_start_mgmt: 1,
  5714. filter_in_tx_msdu_start_ctrl: 1,
  5715. filter_in_tx_msdu_start_data: 1,
  5716. filter_in_tx_mpdu_end_mgmt: 1,
  5717. filter_in_tx_mpdu_end_ctrl: 1,
  5718. filter_in_tx_mpdu_end_data: 1,
  5719. filter_in_tx_msdu_end_mgmt: 1,
  5720. filter_in_tx_msdu_end_ctrl: 1,
  5721. filter_in_tx_msdu_end_data: 1,
  5722. rsvd3: 17;
  5723. A_UINT32 tlv_filter_mask_in0;
  5724. A_UINT32 tlv_filter_mask_in1;
  5725. A_UINT32 tlv_filter_mask_in2;
  5726. A_UINT32 tlv_filter_mask_in3;
  5727. A_UINT32 tx_fes_setup_word_mask: 8,
  5728. tx_peer_entry_word_mask: 8,
  5729. tx_queue_ext_word_mask: 8,
  5730. tx_msdu_start_word_mask: 8;
  5731. A_UINT32 pcu_ppdu_setup_word_mask;
  5732. A_UINT32 tx_mpdu_start_word_mask: 8,
  5733. rxpcu_user_setup_word_mask: 8,
  5734. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5735. dma_mpdu_mgmt: 1,
  5736. dma_mpdu_ctrl: 1,
  5737. dma_mpdu_data: 1,
  5738. rsvd4: 10;
  5739. } POSTPACK;
  5740. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5741. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5742. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5743. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5744. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5745. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5746. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5747. do { \
  5748. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5749. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5750. } while (0)
  5751. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5752. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5753. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5754. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5755. HTT_TX_MONITOR_CFG_RING_ID_S)
  5756. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5757. do { \
  5758. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5759. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5760. } while (0)
  5761. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5762. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5763. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5764. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5765. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5766. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5767. do { \
  5768. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5769. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5770. } while (0)
  5771. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5772. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5773. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5774. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5775. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5776. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5777. do { \
  5778. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5779. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5780. } while (0)
  5781. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5782. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5783. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5784. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5785. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5786. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5787. do { \
  5788. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5789. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5790. } while (0)
  5791. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5792. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  5793. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5794. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5795. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5796. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5797. do { \
  5798. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5799. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5800. } while (0)
  5801. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5802. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  5803. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5804. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5805. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5806. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5807. do { \
  5808. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5809. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5810. } while (0)
  5811. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5812. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  5813. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5814. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5815. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5816. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5817. do { \
  5818. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5819. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5820. } while (0)
  5821. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5822. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5823. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5824. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5825. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5826. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5827. do { \
  5828. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5829. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5830. } while (0)
  5831. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  5832. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  5833. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  5834. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  5835. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  5836. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  5837. do { \
  5838. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  5839. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  5840. } while (0)
  5841. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  5842. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  5843. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  5844. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  5845. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  5846. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  5847. do { \
  5848. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  5849. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  5850. } while (0
  5851. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  5852. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  5853. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  5854. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  5855. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  5856. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  5857. do { \
  5858. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  5859. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  5860. } while (0)
  5861. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  5862. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  5863. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  5864. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  5865. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  5866. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  5867. do { \
  5868. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  5869. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  5870. } while (0)
  5871. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  5872. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  5873. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  5874. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  5875. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  5876. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  5877. do { \
  5878. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  5879. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  5880. } while (0
  5881. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  5882. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  5883. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  5884. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  5885. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  5886. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  5887. do { \
  5888. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  5889. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  5890. } while (0)
  5891. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  5892. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  5893. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  5894. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  5895. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  5896. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  5897. do { \
  5898. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  5899. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  5900. } while (0)
  5901. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  5902. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  5903. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  5904. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  5905. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  5906. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  5907. do { \
  5908. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  5909. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  5910. } while (0
  5911. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  5912. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  5913. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  5914. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  5915. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  5916. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  5917. do { \
  5918. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  5919. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  5920. } while (0)
  5921. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  5922. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  5923. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  5924. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  5925. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  5926. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  5927. do { \
  5928. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  5929. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  5930. } while (0)
  5931. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  5932. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  5933. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  5934. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  5935. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  5936. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  5937. do { \
  5938. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  5939. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  5940. } while (0
  5941. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  5942. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  5943. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  5944. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  5945. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  5946. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  5947. do { \
  5948. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  5949. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  5950. } while (0)
  5951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5954. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5955. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5957. do { \
  5958. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5959. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5960. } while (0)
  5961. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  5962. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5963. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5964. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5965. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5966. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5967. do { \
  5968. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5969. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5970. } while (0)
  5971. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  5972. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  5973. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5974. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5975. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5976. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5979. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5980. } while (0)
  5981. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  5982. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  5983. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5984. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5985. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5986. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5987. do { \
  5988. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5989. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5990. } while (0)
  5991. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  5992. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  5993. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5994. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5995. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5996. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5997. do { \
  5998. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5999. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6000. } while (0)
  6001. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6002. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6003. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6004. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6005. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6006. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6007. do { \
  6008. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6009. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6010. } while (0)
  6011. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6012. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6013. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6014. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6015. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6016. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6017. do { \
  6018. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6019. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6020. } while (0)
  6021. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6022. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6023. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6024. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6025. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6026. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6027. do { \
  6028. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6029. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6030. } while (0)
  6031. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6032. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6033. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6034. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6035. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6036. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6037. do { \
  6038. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6039. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6040. } while (0)
  6041. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6042. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6043. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6044. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6045. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6046. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6047. do { \
  6048. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6049. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6050. } while (0)
  6051. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6052. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6053. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6054. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6055. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6056. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6057. do { \
  6058. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6059. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6060. } while (0)
  6061. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6062. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6063. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6064. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6065. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6066. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6067. do { \
  6068. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6069. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6070. } while (0)
  6071. /*
  6072. * pkt_type_enable_flags
  6073. */
  6074. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6075. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6076. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6077. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6078. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6079. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6080. /*
  6081. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6082. */
  6083. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6084. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6085. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6086. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6087. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6088. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6089. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6090. do { \
  6091. HTT_CHECK_SET_VAL(httsym, value); \
  6092. (word) |= (value) << httsym##_S; \
  6093. } while (0)
  6094. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6095. (((word) & httsym##_M) >> httsym##_S)
  6096. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6097. * type -> MGMT, CTRL, DATA*/
  6098. #define htt_tx_ring_pkt_type_set( \
  6099. word, mode, type, val) \
  6100. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6101. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6102. #define htt_tx_ring_pkt_type_get( \
  6103. word, mode, type) \
  6104. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6105. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6106. /* Definition to filter in TLVs */
  6107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6166. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6167. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6168. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6169. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6170. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6171. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6172. do { \
  6173. HTT_CHECK_SET_VAL(httsym, enable); \
  6174. (word) |= (enable) << httsym##_S; \
  6175. } while (0)
  6176. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6177. (((word) & httsym##_M) >> httsym##_S)
  6178. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6179. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6180. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6181. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6182. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6183. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6211. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6212. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6213. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6214. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6215. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6216. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6217. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6218. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6219. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6220. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6221. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6222. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6223. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6224. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6225. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6226. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6227. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6228. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6229. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6230. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6231. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6232. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6233. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6234. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6235. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6236. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6237. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6238. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6239. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6240. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6241. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6242. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6243. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6244. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6245. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6246. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6247. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6248. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6249. do { \
  6250. HTT_CHECK_SET_VAL(httsym, enable); \
  6251. (word) |= (enable) << httsym##_S; \
  6252. } while (0)
  6253. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6254. (((word) & httsym##_M) >> httsym##_S)
  6255. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6256. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6257. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6258. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6259. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6260. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6261. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6262. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6263. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6264. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6265. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6266. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6267. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6268. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6269. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6270. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6271. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6272. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6273. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6274. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6275. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6276. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6277. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6278. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6279. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6280. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6281. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6282. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6283. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6284. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6285. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6286. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6287. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6288. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6289. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6290. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6291. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6292. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6293. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6294. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6295. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6296. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6297. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6298. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6299. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6300. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6301. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6302. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6303. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6304. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6305. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6306. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6307. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6308. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6309. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6310. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6311. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6312. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6313. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6314. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6315. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6316. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6317. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6318. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6319. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6320. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6321. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6322. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6323. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6324. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6325. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(httsym, enable); \
  6328. (word) |= (enable) << httsym##_S; \
  6329. } while (0)
  6330. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6331. (((word) & httsym##_M) >> httsym##_S)
  6332. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6333. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6334. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6335. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6336. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6337. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6338. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6339. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6340. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6341. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6342. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6343. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6344. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6345. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6346. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6347. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6348. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6349. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6350. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6351. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6352. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6353. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6354. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6355. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6356. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6357. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6358. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6359. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6360. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6361. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6362. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6363. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6364. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6365. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6366. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6367. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6368. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6369. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6370. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6371. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6372. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6373. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6374. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6375. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6376. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6377. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6378. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6379. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6380. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6381. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6382. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(httsym, enable); \
  6385. (word) |= (enable) << httsym##_S; \
  6386. } while (0)
  6387. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6388. (((word) & httsym##_M) >> httsym##_S)
  6389. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6390. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6391. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6392. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6393. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6394. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6395. /**
  6396. * @brief host --> target Receive Flow Steering configuration message definition
  6397. *
  6398. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6399. *
  6400. * host --> target Receive Flow Steering configuration message definition.
  6401. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6402. * The reason for this is we want RFS to be configured and ready before MAC
  6403. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6404. *
  6405. * |31 24|23 16|15 9|8|7 0|
  6406. * |----------------+----------------+----------------+----------------|
  6407. * | reserved |E| msg type |
  6408. * |-------------------------------------------------------------------|
  6409. * Where E = RFS enable flag
  6410. *
  6411. * The RFS_CONFIG message consists of a single 4-byte word.
  6412. *
  6413. * Header fields:
  6414. * - MSG_TYPE
  6415. * Bits 7:0
  6416. * Purpose: identifies this as a RFS config msg
  6417. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6418. * - RFS_CONFIG
  6419. * Bit 8
  6420. * Purpose: Tells target whether to enable (1) or disable (0)
  6421. * flow steering feature when sending rx indication messages to host
  6422. */
  6423. #define HTT_H2T_RFS_CONFIG_M 0x100
  6424. #define HTT_H2T_RFS_CONFIG_S 8
  6425. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6426. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6427. HTT_H2T_RFS_CONFIG_S)
  6428. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6429. do { \
  6430. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6431. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6432. } while (0)
  6433. #define HTT_RFS_CFG_REQ_BYTES 4
  6434. /**
  6435. * @brief host -> target FW extended statistics retrieve
  6436. *
  6437. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6438. *
  6439. * @details
  6440. * The following field definitions describe the format of the HTT host
  6441. * to target FW extended stats retrieve message.
  6442. * The message specifies the type of stats the host wants to retrieve.
  6443. *
  6444. * |31 24|23 16|15 8|7 0|
  6445. * |-----------------------------------------------------------|
  6446. * | reserved | stats type | pdev_mask | msg type |
  6447. * |-----------------------------------------------------------|
  6448. * | config param [0] |
  6449. * |-----------------------------------------------------------|
  6450. * | config param [1] |
  6451. * |-----------------------------------------------------------|
  6452. * | config param [2] |
  6453. * |-----------------------------------------------------------|
  6454. * | config param [3] |
  6455. * |-----------------------------------------------------------|
  6456. * | reserved |
  6457. * |-----------------------------------------------------------|
  6458. * | cookie LSBs |
  6459. * |-----------------------------------------------------------|
  6460. * | cookie MSBs |
  6461. * |-----------------------------------------------------------|
  6462. * Header fields:
  6463. * - MSG_TYPE
  6464. * Bits 7:0
  6465. * Purpose: identifies this is a extended stats upload request message
  6466. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6467. * - PDEV_MASK
  6468. * Bits 8:15
  6469. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6470. * Value: This is a overloaded field, refer to usage and interpretation of
  6471. * PDEV in interface document.
  6472. * Bit 8 : Reserved for SOC stats
  6473. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6474. * Indicates MACID_MASK in DBS
  6475. * - STATS_TYPE
  6476. * Bits 23:16
  6477. * Purpose: identifies which FW statistics to upload
  6478. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6479. * - Reserved
  6480. * Bits 31:24
  6481. * - CONFIG_PARAM [0]
  6482. * Bits 31:0
  6483. * Purpose: give an opaque configuration value to the specified stats type
  6484. * Value: stats-type specific configuration value
  6485. * Refer to htt_stats.h for interpretation for each stats sub_type
  6486. * - CONFIG_PARAM [1]
  6487. * Bits 31:0
  6488. * Purpose: give an opaque configuration value to the specified stats type
  6489. * Value: stats-type specific configuration value
  6490. * Refer to htt_stats.h for interpretation for each stats sub_type
  6491. * - CONFIG_PARAM [2]
  6492. * Bits 31:0
  6493. * Purpose: give an opaque configuration value to the specified stats type
  6494. * Value: stats-type specific configuration value
  6495. * Refer to htt_stats.h for interpretation for each stats sub_type
  6496. * - CONFIG_PARAM [3]
  6497. * Bits 31:0
  6498. * Purpose: give an opaque configuration value to the specified stats type
  6499. * Value: stats-type specific configuration value
  6500. * Refer to htt_stats.h for interpretation for each stats sub_type
  6501. * - Reserved [31:0] for future use.
  6502. * - COOKIE_LSBS
  6503. * Bits 31:0
  6504. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6505. * message with its preceding host->target stats request message.
  6506. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6507. * - COOKIE_MSBS
  6508. * Bits 31:0
  6509. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6510. * message with its preceding host->target stats request message.
  6511. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6512. */
  6513. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6514. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6515. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6516. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6517. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6518. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6519. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6520. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6521. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6522. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6523. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6526. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6527. } while (0)
  6528. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6529. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6530. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6531. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6534. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6535. } while (0)
  6536. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6537. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6538. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6539. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6540. do { \
  6541. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6542. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6543. } while (0)
  6544. /**
  6545. * @brief host -> target FW PPDU_STATS request message
  6546. *
  6547. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6548. *
  6549. * @details
  6550. * The following field definitions describe the format of the HTT host
  6551. * to target FW for PPDU_STATS_CFG msg.
  6552. * The message allows the host to configure the PPDU_STATS_IND messages
  6553. * produced by the target.
  6554. *
  6555. * |31 24|23 16|15 8|7 0|
  6556. * |-----------------------------------------------------------|
  6557. * | REQ bit mask | pdev_mask | msg type |
  6558. * |-----------------------------------------------------------|
  6559. * Header fields:
  6560. * - MSG_TYPE
  6561. * Bits 7:0
  6562. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6563. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6564. * - PDEV_MASK
  6565. * Bits 8:15
  6566. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6567. * Value: This is a overloaded field, refer to usage and interpretation of
  6568. * PDEV in interface document.
  6569. * Bit 8 : Reserved for SOC stats
  6570. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6571. * Indicates MACID_MASK in DBS
  6572. * - REQ_TLV_BIT_MASK
  6573. * Bits 16:31
  6574. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6575. * needs to be included in the target's PPDU_STATS_IND messages.
  6576. * Value: refer htt_ppdu_stats_tlv_tag_t
  6577. *
  6578. */
  6579. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6580. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6581. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6582. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6583. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6584. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6585. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6586. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6587. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6588. do { \
  6589. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6590. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6591. } while (0)
  6592. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6593. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6594. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6595. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6596. do { \
  6597. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6598. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6599. } while (0)
  6600. /**
  6601. * @brief Host-->target HTT RX FSE setup message
  6602. *
  6603. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6604. *
  6605. * @details
  6606. * Through this message, the host will provide details of the flow tables
  6607. * in host DDR along with hash keys.
  6608. * This message can be sent per SOC or per PDEV, which is differentiated
  6609. * by pdev id values.
  6610. * The host will allocate flow search table and sends table size,
  6611. * physical DMA address of flow table, and hash keys to firmware to
  6612. * program into the RXOLE FSE HW block.
  6613. *
  6614. * The following field definitions describe the format of the RX FSE setup
  6615. * message sent from the host to target
  6616. *
  6617. * Header fields:
  6618. * dword0 - b'7:0 - msg_type: This will be set to
  6619. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6620. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6621. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6622. * pdev's LMAC ring.
  6623. * b'31:16 - reserved : Reserved for future use
  6624. * dword1 - b'19:0 - number of records: This field indicates the number of
  6625. * entries in the flow table. For example: 8k number of
  6626. * records is equivalent to
  6627. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6628. * b'27:20 - max search: This field specifies the skid length to FSE
  6629. * parser HW module whenever match is not found at the
  6630. * exact index pointed by hash.
  6631. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6632. * Refer htt_ip_da_sa_prefix below for more details.
  6633. * b'31:30 - reserved: Reserved for future use
  6634. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6635. * table allocated by host in DDR
  6636. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6637. * table allocated by host in DDR
  6638. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6639. * entry hashing
  6640. *
  6641. *
  6642. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6643. * |---------------------------------------------------------------|
  6644. * | reserved | pdev_id | MSG_TYPE |
  6645. * |---------------------------------------------------------------|
  6646. * |resvd|IPDSA| max_search | Number of records |
  6647. * |---------------------------------------------------------------|
  6648. * | base address lo |
  6649. * |---------------------------------------------------------------|
  6650. * | base address high |
  6651. * |---------------------------------------------------------------|
  6652. * | toeplitz key 31_0 |
  6653. * |---------------------------------------------------------------|
  6654. * | toeplitz key 63_32 |
  6655. * |---------------------------------------------------------------|
  6656. * | toeplitz key 95_64 |
  6657. * |---------------------------------------------------------------|
  6658. * | toeplitz key 127_96 |
  6659. * |---------------------------------------------------------------|
  6660. * | toeplitz key 159_128 |
  6661. * |---------------------------------------------------------------|
  6662. * | toeplitz key 191_160 |
  6663. * |---------------------------------------------------------------|
  6664. * | toeplitz key 223_192 |
  6665. * |---------------------------------------------------------------|
  6666. * | toeplitz key 255_224 |
  6667. * |---------------------------------------------------------------|
  6668. * | toeplitz key 287_256 |
  6669. * |---------------------------------------------------------------|
  6670. * | reserved | toeplitz key 314_288(26:0 bits) |
  6671. * |---------------------------------------------------------------|
  6672. * where:
  6673. * IPDSA = ip_da_sa
  6674. */
  6675. /**
  6676. * @brief: htt_ip_da_sa_prefix
  6677. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6678. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6679. * documentation per RFC3849
  6680. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6681. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6682. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6683. */
  6684. enum htt_ip_da_sa_prefix {
  6685. HTT_RX_IPV6_20010db8,
  6686. HTT_RX_IPV4_MAPPED_IPV6,
  6687. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6688. HTT_RX_IPV6_64FF9B,
  6689. };
  6690. /**
  6691. * @brief Host-->target HTT RX FISA configure and enable
  6692. *
  6693. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6694. *
  6695. * @details
  6696. * The host will send this command down to configure and enable the FISA
  6697. * operational params.
  6698. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6699. * register.
  6700. * Should configure both the MACs.
  6701. *
  6702. * dword0 - b'7:0 - msg_type:
  6703. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6704. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6705. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6706. * pdev's LMAC ring.
  6707. * b'31:16 - reserved : Reserved for future use
  6708. *
  6709. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6710. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6711. * packets. 1 flow search will be skipped
  6712. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6713. * tcp,udp packets
  6714. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6715. * calculation
  6716. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6717. * calculation
  6718. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6719. * calculation
  6720. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6721. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6722. * length
  6723. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6724. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6725. * length
  6726. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6727. * num jump
  6728. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6729. * num jump
  6730. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6731. * data type switch has happend for MPDU Sequence num jump
  6732. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6733. * for MPDU Sequence num jump
  6734. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6735. * for decrypt errors
  6736. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6737. * while aggregating a msdu
  6738. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6739. * The aggregation is done until (number of MSDUs aggregated
  6740. * < LIMIT + 1)
  6741. * b'31:18 - Reserved
  6742. *
  6743. * fisa_control_value - 32bit value FW can write to register
  6744. *
  6745. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6746. * Threshold value for FISA timeout (units are microseconds).
  6747. * When the global timestamp exceeds this threshold, FISA
  6748. * aggregation will be restarted.
  6749. * A value of 0 means timeout is disabled.
  6750. * Compare the threshold register with timestamp field in
  6751. * flow entry to generate timeout for the flow.
  6752. *
  6753. * |31 18 |17 16|15 8|7 0|
  6754. * |-------------------------------------------------------------|
  6755. * | reserved | pdev_mask | msg type |
  6756. * |-------------------------------------------------------------|
  6757. * | reserved | FISA_CTRL |
  6758. * |-------------------------------------------------------------|
  6759. * | FISA_TIMEOUT_THRESH |
  6760. * |-------------------------------------------------------------|
  6761. */
  6762. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6763. A_UINT32 msg_type:8,
  6764. pdev_id:8,
  6765. reserved0:16;
  6766. /**
  6767. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6768. * [17:0]
  6769. */
  6770. union {
  6771. /*
  6772. * fisa_control_bits structure is deprecated.
  6773. * Please use fisa_control_bits_v2 going forward.
  6774. */
  6775. struct {
  6776. A_UINT32 fisa_enable: 1,
  6777. ipsec_skip_search: 1,
  6778. nontcp_skip_search: 1,
  6779. add_ipv4_fixed_hdr_len: 1,
  6780. add_ipv6_fixed_hdr_len: 1,
  6781. add_tcp_fixed_hdr_len: 1,
  6782. add_udp_hdr_len: 1,
  6783. chksum_cum_ip_len_en: 1,
  6784. disable_tid_check: 1,
  6785. disable_ta_check: 1,
  6786. disable_qos_check: 1,
  6787. disable_raw_check: 1,
  6788. disable_decrypt_err_check: 1,
  6789. disable_msdu_drop_check: 1,
  6790. fisa_aggr_limit: 4,
  6791. reserved: 14;
  6792. } fisa_control_bits;
  6793. struct {
  6794. A_UINT32 fisa_enable: 1,
  6795. fisa_aggr_limit: 4,
  6796. reserved: 27;
  6797. } fisa_control_bits_v2;
  6798. A_UINT32 fisa_control_value;
  6799. } u_fisa_control;
  6800. /**
  6801. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6802. * timeout threshold for aggregation. Unit in usec.
  6803. * [31:0]
  6804. */
  6805. A_UINT32 fisa_timeout_threshold;
  6806. } POSTPACK;
  6807. /* DWord 0: pdev-ID */
  6808. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6809. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6810. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6811. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6812. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6813. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6814. do { \
  6815. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6816. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6817. } while (0)
  6818. /* Dword 1: fisa_control_value fisa config */
  6819. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6820. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6821. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6822. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6823. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6824. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6825. do { \
  6826. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6827. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6828. } while (0)
  6829. /* Dword 1: fisa_control_value ipsec_skip_search */
  6830. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6831. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6832. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6833. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6834. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6835. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6836. do { \
  6837. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6838. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6839. } while (0)
  6840. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6841. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6842. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6843. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6844. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6845. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6846. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6847. do { \
  6848. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6849. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6850. } while (0)
  6851. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6852. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6853. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6854. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6855. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6856. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6857. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6858. do { \
  6859. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6860. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6861. } while (0)
  6862. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6863. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6864. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6865. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6866. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6867. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6868. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6869. do { \
  6870. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6871. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6872. } while (0)
  6873. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6874. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6875. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6876. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6877. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6878. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6879. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6880. do { \
  6881. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6882. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6883. } while (0)
  6884. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6885. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6886. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6887. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6888. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6889. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6890. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6891. do { \
  6892. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6893. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6894. } while (0)
  6895. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6896. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6897. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6898. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6899. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6900. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6901. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6902. do { \
  6903. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6904. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6905. } while (0)
  6906. /* Dword 1: fisa_control_value disable_tid_check */
  6907. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6908. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6909. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6910. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6911. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6912. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6913. do { \
  6914. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6915. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6916. } while (0)
  6917. /* Dword 1: fisa_control_value disable_ta_check */
  6918. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6919. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6920. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6921. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6922. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6923. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6924. do { \
  6925. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6926. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6927. } while (0)
  6928. /* Dword 1: fisa_control_value disable_qos_check */
  6929. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6930. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6931. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6932. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6933. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6934. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6935. do { \
  6936. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6937. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6938. } while (0)
  6939. /* Dword 1: fisa_control_value disable_raw_check */
  6940. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6941. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6942. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6943. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6944. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6945. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6946. do { \
  6947. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6948. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6949. } while (0)
  6950. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6951. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6952. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6953. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6954. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6955. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6956. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6957. do { \
  6958. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6959. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6960. } while (0)
  6961. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6962. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6963. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6964. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6965. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6966. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6967. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6968. do { \
  6969. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6970. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6971. } while (0)
  6972. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6973. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6974. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6975. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6976. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6977. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6978. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6979. do { \
  6980. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6981. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6982. } while (0)
  6983. /* Dword 1: fisa_control_value fisa config */
  6984. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6985. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6986. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6987. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6988. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6989. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6990. do { \
  6991. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6992. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6993. } while (0)
  6994. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6995. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6996. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6997. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6998. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6999. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7000. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7001. do { \
  7002. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7003. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7004. } while (0)
  7005. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7006. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7007. pdev_id:8,
  7008. reserved0:16;
  7009. A_UINT32 num_records:20,
  7010. max_search:8,
  7011. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7012. reserved1:2;
  7013. A_UINT32 base_addr_lo;
  7014. A_UINT32 base_addr_hi;
  7015. A_UINT32 toeplitz31_0;
  7016. A_UINT32 toeplitz63_32;
  7017. A_UINT32 toeplitz95_64;
  7018. A_UINT32 toeplitz127_96;
  7019. A_UINT32 toeplitz159_128;
  7020. A_UINT32 toeplitz191_160;
  7021. A_UINT32 toeplitz223_192;
  7022. A_UINT32 toeplitz255_224;
  7023. A_UINT32 toeplitz287_256;
  7024. A_UINT32 toeplitz314_288:27,
  7025. reserved2:5;
  7026. } POSTPACK;
  7027. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7028. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7029. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7030. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7031. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7032. /* DWORD 0: Pdev ID */
  7033. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7034. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7035. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7036. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7037. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7038. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7039. do { \
  7040. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7041. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7042. } while (0)
  7043. /* DWORD 1:num of records */
  7044. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7045. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7046. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7047. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7048. HTT_RX_FSE_SETUP_NUM_REC_S)
  7049. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7050. do { \
  7051. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7052. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7053. } while (0)
  7054. /* DWORD 1:max_search */
  7055. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7056. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7057. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7058. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7059. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7060. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7061. do { \
  7062. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7063. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7064. } while (0)
  7065. /* DWORD 1:ip_da_sa prefix */
  7066. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7067. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7068. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7069. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7070. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7071. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7072. do { \
  7073. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7074. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7075. } while (0)
  7076. /* DWORD 2: Base Address LO */
  7077. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7078. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7079. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7080. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7081. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7082. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7083. do { \
  7084. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7085. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7086. } while (0)
  7087. /* DWORD 3: Base Address High */
  7088. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7089. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7090. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7091. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7092. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7093. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7094. do { \
  7095. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7096. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7097. } while (0)
  7098. /* DWORD 4-12: Hash Value */
  7099. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7100. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7101. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7102. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7103. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7104. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7105. do { \
  7106. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7107. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7108. } while (0)
  7109. /* DWORD 13: Hash Value 314:288 bits */
  7110. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7111. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7112. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7113. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7114. do { \
  7115. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7116. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7117. } while (0)
  7118. /**
  7119. * @brief Host-->target HTT RX FSE operation message
  7120. *
  7121. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7122. *
  7123. * @details
  7124. * The host will send this Flow Search Engine (FSE) operation message for
  7125. * every flow add/delete operation.
  7126. * The FSE operation includes FSE full cache invalidation or individual entry
  7127. * invalidation.
  7128. * This message can be sent per SOC or per PDEV which is differentiated
  7129. * by pdev id values.
  7130. *
  7131. * |31 16|15 8|7 1|0|
  7132. * |-------------------------------------------------------------|
  7133. * | reserved | pdev_id | MSG_TYPE |
  7134. * |-------------------------------------------------------------|
  7135. * | reserved | operation |I|
  7136. * |-------------------------------------------------------------|
  7137. * | ip_src_addr_31_0 |
  7138. * |-------------------------------------------------------------|
  7139. * | ip_src_addr_63_32 |
  7140. * |-------------------------------------------------------------|
  7141. * | ip_src_addr_95_64 |
  7142. * |-------------------------------------------------------------|
  7143. * | ip_src_addr_127_96 |
  7144. * |-------------------------------------------------------------|
  7145. * | ip_dst_addr_31_0 |
  7146. * |-------------------------------------------------------------|
  7147. * | ip_dst_addr_63_32 |
  7148. * |-------------------------------------------------------------|
  7149. * | ip_dst_addr_95_64 |
  7150. * |-------------------------------------------------------------|
  7151. * | ip_dst_addr_127_96 |
  7152. * |-------------------------------------------------------------|
  7153. * | l4_dst_port | l4_src_port |
  7154. * | (32-bit SPI incase of IPsec) |
  7155. * |-------------------------------------------------------------|
  7156. * | reserved | l4_proto |
  7157. * |-------------------------------------------------------------|
  7158. *
  7159. * where I is 1-bit ipsec_valid.
  7160. *
  7161. * The following field definitions describe the format of the RX FSE operation
  7162. * message sent from the host to target for every add/delete flow entry to flow
  7163. * table.
  7164. *
  7165. * Header fields:
  7166. * dword0 - b'7:0 - msg_type: This will be set to
  7167. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7168. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7169. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7170. * specified pdev's LMAC ring.
  7171. * b'31:16 - reserved : Reserved for future use
  7172. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7173. * (Internet Protocol Security).
  7174. * IPsec describes the framework for providing security at
  7175. * IP layer. IPsec is defined for both versions of IP:
  7176. * IPV4 and IPV6.
  7177. * Please refer to htt_rx_flow_proto enumeration below for
  7178. * more info.
  7179. * ipsec_valid = 1 for IPSEC packets
  7180. * ipsec_valid = 0 for IP Packets
  7181. * b'7:1 - operation: This indicates types of FSE operation.
  7182. * Refer to htt_rx_fse_operation enumeration:
  7183. * 0 - No Cache Invalidation required
  7184. * 1 - Cache invalidate only one entry given by IP
  7185. * src/dest address at DWORD[2:9]
  7186. * 2 - Complete FSE Cache Invalidation
  7187. * 3 - FSE Disable
  7188. * 4 - FSE Enable
  7189. * b'31:8 - reserved: Reserved for future use
  7190. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7191. * for per flow addition/deletion
  7192. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7193. * and the subsequent 3 A_UINT32 will be padding bytes.
  7194. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7195. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7196. * from 0 to 65535 but only 0 to 1023 are designated as
  7197. * well-known ports. Refer to [RFC1700] for more details.
  7198. * This field is valid only if
  7199. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7200. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7201. * range from 0 to 65535 but only 0 to 1023 are designated
  7202. * as well-known ports. Refer to [RFC1700] for more details.
  7203. * This field is valid only if
  7204. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7205. * - SPI (31:0): Security Parameters Index is an
  7206. * identification tag added to the header while using IPsec
  7207. * for tunneling the IP traffici.
  7208. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7209. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7210. * Assigned Internet Protocol Numbers.
  7211. * l4_proto numbers for standard protocol like UDP/TCP
  7212. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7213. * l4_proto = 17 for UDP etc.
  7214. * b'31:8 - reserved: Reserved for future use.
  7215. *
  7216. */
  7217. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7218. A_UINT32 msg_type:8,
  7219. pdev_id:8,
  7220. reserved0:16;
  7221. A_UINT32 ipsec_valid:1,
  7222. operation:7,
  7223. reserved1:24;
  7224. A_UINT32 ip_src_addr_31_0;
  7225. A_UINT32 ip_src_addr_63_32;
  7226. A_UINT32 ip_src_addr_95_64;
  7227. A_UINT32 ip_src_addr_127_96;
  7228. A_UINT32 ip_dest_addr_31_0;
  7229. A_UINT32 ip_dest_addr_63_32;
  7230. A_UINT32 ip_dest_addr_95_64;
  7231. A_UINT32 ip_dest_addr_127_96;
  7232. union {
  7233. A_UINT32 spi;
  7234. struct {
  7235. A_UINT32 l4_src_port:16,
  7236. l4_dest_port:16;
  7237. } ip;
  7238. } u;
  7239. A_UINT32 l4_proto:8,
  7240. reserved:24;
  7241. } POSTPACK;
  7242. /**
  7243. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7244. *
  7245. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7246. *
  7247. * @details
  7248. * The host will send this Full monitor mode register configuration message.
  7249. * This message can be sent per SOC or per PDEV which is differentiated
  7250. * by pdev id values.
  7251. *
  7252. * |31 16|15 11|10 8|7 3|2|1|0|
  7253. * |-------------------------------------------------------------|
  7254. * | reserved | pdev_id | MSG_TYPE |
  7255. * |-------------------------------------------------------------|
  7256. * | reserved |Release Ring |N|Z|E|
  7257. * |-------------------------------------------------------------|
  7258. *
  7259. * where E is 1-bit full monitor mode enable/disable.
  7260. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7261. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7262. *
  7263. * The following field definitions describe the format of the full monitor
  7264. * mode configuration message sent from the host to target for each pdev.
  7265. *
  7266. * Header fields:
  7267. * dword0 - b'7:0 - msg_type: This will be set to
  7268. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7269. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7270. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7271. * specified pdev's LMAC ring.
  7272. * b'31:16 - reserved : Reserved for future use.
  7273. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7274. * monitor mode rxdma register is to be enabled or disabled.
  7275. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7276. * additional descriptors at ppdu end for zero mpdus
  7277. * enabled or disabled.
  7278. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7279. * additional descriptors at ppdu end for non zero mpdus
  7280. * enabled or disabled.
  7281. * b'10:3 - release_ring: This indicates the destination ring
  7282. * selection for the descriptor at the end of PPDU
  7283. * 0 - REO ring select
  7284. * 1 - FW ring select
  7285. * 2 - SW ring select
  7286. * 3 - Release ring select
  7287. * Refer to htt_rx_full_mon_release_ring.
  7288. * b'31:11 - reserved for future use
  7289. */
  7290. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7291. A_UINT32 msg_type:8,
  7292. pdev_id:8,
  7293. reserved0:16;
  7294. A_UINT32 full_monitor_mode_enable:1,
  7295. addnl_descs_zero_mpdus_end:1,
  7296. addnl_descs_non_zero_mpdus_end:1,
  7297. release_ring:8,
  7298. reserved1:21;
  7299. } POSTPACK;
  7300. /**
  7301. * Enumeration for full monitor mode destination ring select
  7302. * 0 - REO destination ring select
  7303. * 1 - FW destination ring select
  7304. * 2 - SW destination ring select
  7305. * 3 - Release destination ring select
  7306. */
  7307. enum htt_rx_full_mon_release_ring {
  7308. HTT_RX_MON_RING_REO,
  7309. HTT_RX_MON_RING_FW,
  7310. HTT_RX_MON_RING_SW,
  7311. HTT_RX_MON_RING_RELEASE,
  7312. };
  7313. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7314. /* DWORD 0: Pdev ID */
  7315. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7316. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7317. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7318. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7319. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7320. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7321. do { \
  7322. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7323. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7324. } while (0)
  7325. /* DWORD 1:ENABLE */
  7326. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7327. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7328. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7329. do { \
  7330. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7331. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7332. } while (0)
  7333. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7334. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7335. /* DWORD 1:ZERO_MPDU */
  7336. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7337. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7338. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7339. do { \
  7340. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7341. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7342. } while (0)
  7343. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7344. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7345. /* DWORD 1:NON_ZERO_MPDU */
  7346. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7347. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7348. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7349. do { \
  7350. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7351. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7352. } while (0)
  7353. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7354. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7355. /* DWORD 1:RELEASE_RINGS */
  7356. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7357. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7358. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7359. do { \
  7360. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7361. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7362. } while (0)
  7363. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7364. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7365. /**
  7366. * Enumeration for IP Protocol or IPSEC Protocol
  7367. * IPsec describes the framework for providing security at IP layer.
  7368. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7369. */
  7370. enum htt_rx_flow_proto {
  7371. HTT_RX_FLOW_IP_PROTO,
  7372. HTT_RX_FLOW_IPSEC_PROTO,
  7373. };
  7374. /**
  7375. * Enumeration for FSE Cache Invalidation
  7376. * 0 - No Cache Invalidation required
  7377. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7378. * 2 - Complete FSE Cache Invalidation
  7379. * 3 - FSE Disable
  7380. * 4 - FSE Enable
  7381. */
  7382. enum htt_rx_fse_operation {
  7383. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7384. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7385. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7386. HTT_RX_FSE_DISABLE,
  7387. HTT_RX_FSE_ENABLE,
  7388. };
  7389. /* DWORD 0: Pdev ID */
  7390. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7391. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7392. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7393. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7394. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7395. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7396. do { \
  7397. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7398. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7399. } while (0)
  7400. /* DWORD 1:IP PROTO or IPSEC */
  7401. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7402. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7403. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7404. do { \
  7405. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7406. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7407. } while (0)
  7408. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7409. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7410. /* DWORD 1:FSE Operation */
  7411. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7412. #define HTT_RX_FSE_OPERATION_S 1
  7413. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7414. do { \
  7415. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7416. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7417. } while (0)
  7418. #define HTT_RX_FSE_OPERATION_GET(word) \
  7419. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7420. /* DWORD 2-9:IP Address */
  7421. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7422. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7423. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7424. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7425. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7426. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7427. do { \
  7428. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7429. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7430. } while (0)
  7431. /* DWORD 10:Source Port Number */
  7432. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7433. #define HTT_RX_FSE_SOURCEPORT_S 0
  7434. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7435. do { \
  7436. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7437. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7438. } while (0)
  7439. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7440. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7441. /* DWORD 11:Destination Port Number */
  7442. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7443. #define HTT_RX_FSE_DESTPORT_S 16
  7444. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7445. do { \
  7446. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7447. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7448. } while (0)
  7449. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7450. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7451. /* DWORD 10-11:SPI (In case of IPSEC) */
  7452. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7453. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7454. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7455. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7456. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7457. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7458. do { \
  7459. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7460. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7461. } while (0)
  7462. /* DWORD 12:L4 PROTO */
  7463. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7464. #define HTT_RX_FSE_L4_PROTO_S 0
  7465. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7466. do { \
  7467. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7468. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7469. } while (0)
  7470. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7471. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7472. /**
  7473. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7474. *
  7475. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7476. *
  7477. * |31 24|23 |15 8|7 2|1|0|
  7478. * |----------------+----------------+----------------+----------------|
  7479. * | reserved | pdev_id | msg_type |
  7480. * |---------------------------------+----------------+----------------|
  7481. * | reserved |E|F|
  7482. * |---------------------------------+----------------+----------------|
  7483. * Where E = Configure the target to provide the 3-tuple hash value in
  7484. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7485. * F = Configure the target to provide the 3-tuple hash value in
  7486. * flow_id_toeplitz field of rx_msdu_start tlv
  7487. *
  7488. * The following field definitions describe the format of the 3 tuple hash value
  7489. * message sent from the host to target as part of initialization sequence.
  7490. *
  7491. * Header fields:
  7492. * dword0 - b'7:0 - msg_type: This will be set to
  7493. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7494. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7495. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7496. * specified pdev's LMAC ring.
  7497. * b'31:16 - reserved : Reserved for future use
  7498. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7499. * b'1 - toeplitz_hash_2_or_4_field_enable
  7500. * b'31:2 - reserved : Reserved for future use
  7501. * ---------+------+----------------------------------------------------------
  7502. * bit1 | bit0 | Functionality
  7503. * ---------+------+----------------------------------------------------------
  7504. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7505. * | | in flow_id_toeplitz field
  7506. * ---------+------+----------------------------------------------------------
  7507. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7508. * | | in toeplitz_hash_2_or_4 field
  7509. * ---------+------+----------------------------------------------------------
  7510. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7511. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7512. * ---------+------+----------------------------------------------------------
  7513. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7514. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7515. * | | toeplitz_hash_2_or_4 field
  7516. *----------------------------------------------------------------------------
  7517. */
  7518. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7519. A_UINT32 msg_type :8,
  7520. pdev_id :8,
  7521. reserved0 :16;
  7522. A_UINT32 flow_id_toeplitz_field_enable :1,
  7523. toeplitz_hash_2_or_4_field_enable :1,
  7524. reserved1 :30;
  7525. } POSTPACK;
  7526. /* DWORD0 : pdev_id configuration Macros */
  7527. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7528. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7529. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7530. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7531. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7532. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7533. do { \
  7534. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7535. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7536. } while (0)
  7537. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7538. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7539. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7540. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7541. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7542. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7543. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7544. do { \
  7545. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7546. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7547. } while (0)
  7548. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7549. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7550. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7551. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7552. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7553. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7554. do { \
  7555. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7556. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7557. } while (0)
  7558. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7559. /**
  7560. * @brief host --> target Host PA Address Size
  7561. *
  7562. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7563. *
  7564. * @details
  7565. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7566. * provide the physical start address and size of each of the memory
  7567. * areas within host DDR that the target FW may need to access.
  7568. *
  7569. * For example, the host can use this message to allow the target FW
  7570. * to set up access to the host's pools of TQM link descriptors.
  7571. * The message would appear as follows:
  7572. *
  7573. * |31 24|23 16|15 8|7 0|
  7574. * |----------------+----------------+----------------+----------------|
  7575. * | reserved | num_entries | msg_type |
  7576. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7577. * | mem area 0 size |
  7578. * |----------------+----------------+----------------+----------------|
  7579. * | mem area 0 physical_address_lo |
  7580. * |----------------+----------------+----------------+----------------|
  7581. * | mem area 0 physical_address_hi |
  7582. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7583. * | mem area 1 size |
  7584. * |----------------+----------------+----------------+----------------|
  7585. * | mem area 1 physical_address_lo |
  7586. * |----------------+----------------+----------------+----------------|
  7587. * | mem area 1 physical_address_hi |
  7588. * |----------------+----------------+----------------+----------------|
  7589. * ...
  7590. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7591. * | mem area N size |
  7592. * |----------------+----------------+----------------+----------------|
  7593. * | mem area N physical_address_lo |
  7594. * |----------------+----------------+----------------+----------------|
  7595. * | mem area N physical_address_hi |
  7596. * |----------------+----------------+----------------+----------------|
  7597. *
  7598. * The message is interpreted as follows:
  7599. * dword0 - b'0:7 - msg_type: This will be set to
  7600. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7601. * b'8:15 - number_entries: Indicated the number of host memory
  7602. * areas specified within the remainder of the message
  7603. * b'16:31 - reserved.
  7604. * dword1 - b'0:31 - memory area 0 size in bytes
  7605. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7606. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7607. * and similar for memory area 1 through memory area N.
  7608. */
  7609. PREPACK struct htt_h2t_host_paddr_size {
  7610. A_UINT32 msg_type: 8,
  7611. num_entries: 8,
  7612. reserved: 16;
  7613. } POSTPACK;
  7614. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7615. A_UINT32 size;
  7616. A_UINT32 physical_address_lo;
  7617. A_UINT32 physical_address_hi;
  7618. } POSTPACK;
  7619. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7620. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7621. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7622. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7623. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7624. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7625. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7626. do { \
  7627. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7628. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7629. } while (0)
  7630. /**
  7631. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7632. *
  7633. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7634. *
  7635. * @details
  7636. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7637. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7638. *
  7639. * The message would appear as follows:
  7640. *
  7641. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7642. * |---------------------------------+---+---+----------+-+-----------|
  7643. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7644. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7645. *
  7646. *
  7647. * The message is interpreted as follows:
  7648. * dword0 - b'0:7 - msg_type: This will be set to
  7649. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7650. * b'8 - override bit to drive MSDUs to PPE ring
  7651. * b'9:13 - REO destination ring indication
  7652. * b'14 - Multi buffer msdu override enable bit
  7653. * b'15 - Intra BSS override
  7654. * b'16 - Decap raw override
  7655. * b'17 - Decap Native wifi override
  7656. * b'18 - IP frag override
  7657. * b'19:31 - reserved
  7658. */
  7659. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7660. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7661. override: 1,
  7662. reo_destination_indication: 5,
  7663. multi_buffer_msdu_override_en: 1,
  7664. intra_bss_override: 1,
  7665. decap_raw_override: 1,
  7666. decap_nwifi_override: 1,
  7667. ip_frag_override: 1,
  7668. reserved: 13;
  7669. } POSTPACK;
  7670. /* DWORD 0: Override */
  7671. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7672. #define HTT_PPE_CFG_OVERRIDE_S 8
  7673. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7674. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7675. HTT_PPE_CFG_OVERRIDE_S)
  7676. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7677. do { \
  7678. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7679. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7680. } while (0)
  7681. /* DWORD 0: REO Destination Indication*/
  7682. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7683. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7684. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7685. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7686. HTT_PPE_CFG_REO_DEST_IND_S)
  7687. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7690. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7691. } while (0)
  7692. /* DWORD 0: Multi buffer MSDU override */
  7693. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7694. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7695. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7696. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7697. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7698. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7699. do { \
  7700. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7701. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7702. } while (0)
  7703. /* DWORD 0: Intra BSS override */
  7704. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7705. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7706. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7707. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7708. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7709. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7712. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7713. } while (0)
  7714. /* DWORD 0: Decap RAW override */
  7715. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7716. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7717. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7718. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7719. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7720. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7721. do { \
  7722. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7723. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7724. } while (0)
  7725. /* DWORD 0: Decap NWIFI override */
  7726. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7727. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7728. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7729. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7730. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7731. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7734. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7735. } while (0)
  7736. /* DWORD 0: IP frag override */
  7737. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7738. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7739. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7740. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7741. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7742. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7745. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7746. } while (0)
  7747. /*
  7748. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7749. *
  7750. * @details
  7751. * The following field definitions describe the format of the HTT host
  7752. * to target FW VDEV TX RX stats retrieve message.
  7753. * The message specifies the type of stats the host wants to retrieve.
  7754. *
  7755. * |31 27|26 25|24 17|16|15 8|7 0|
  7756. * |-----------------------------------------------------------|
  7757. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7758. * |-----------------------------------------------------------|
  7759. * | vdev_id lower bitmask |
  7760. * |-----------------------------------------------------------|
  7761. * | vdev_id upper bitmask |
  7762. * |-----------------------------------------------------------|
  7763. * Header fields:
  7764. * Where:
  7765. * dword0 - b'7:0 - msg_type: This will be set to
  7766. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7767. * b'15:8 - pdev id
  7768. * b'16(E) - Enable/Disable the vdev HW stats
  7769. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7770. * b'25:26(R) - Reset stats bits
  7771. * 0: don't reset stats
  7772. * 1: reset stats once
  7773. * 2: reset stats at the start of each periodic interval
  7774. * b'27:31 - reserved for future use
  7775. * dword1 - b'0:31 - vdev_id lower bitmask
  7776. * dword2 - b'0:31 - vdev_id upper bitmask
  7777. */
  7778. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7779. A_UINT32 msg_type :8,
  7780. pdev_id :8,
  7781. enable :1,
  7782. periodic_interval :8,
  7783. reset_stats_bits :2,
  7784. reserved0 :5;
  7785. A_UINT32 vdev_id_lower_bitmask;
  7786. A_UINT32 vdev_id_upper_bitmask;
  7787. } POSTPACK;
  7788. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7789. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7790. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7791. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7792. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7793. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7794. do { \
  7795. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7796. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7797. } while (0)
  7798. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7799. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7800. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7801. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7802. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7803. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7804. do { \
  7805. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7806. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7807. } while (0)
  7808. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7809. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7810. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7811. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7812. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7813. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7814. do { \
  7815. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7816. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7817. } while (0)
  7818. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7819. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7820. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7821. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7822. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7823. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7824. do { \
  7825. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7826. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7827. } while (0)
  7828. /*
  7829. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  7830. *
  7831. * @details
  7832. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  7833. * the default MSDU queues for one of the TIDs within the specified peer
  7834. * to the specified service class.
  7835. * The TID is indirectly specified - each service class is associated
  7836. * with a TID. All default MSDU queues for this peer-TID will be
  7837. * linked to the service class in question.
  7838. *
  7839. * |31 16|15 8|7 0|
  7840. * |------------------------------+--------------+--------------|
  7841. * | peer ID | svc class ID | msg type |
  7842. * |------------------------------------------------------------|
  7843. * Header fields:
  7844. * dword0 - b'7:0 - msg_type: This will be set to
  7845. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  7846. * b'15:8 - service class ID
  7847. * b'31:16 - peer ID
  7848. */
  7849. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  7850. A_UINT32 msg_type :8,
  7851. svc_class_id :8,
  7852. peer_id :16;
  7853. } POSTPACK;
  7854. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  7855. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  7856. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  7857. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  7858. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  7859. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  7860. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  7861. do { \
  7862. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  7863. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  7864. } while (0)
  7865. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  7866. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  7867. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  7868. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  7869. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  7870. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  7871. do { \
  7872. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  7873. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  7874. } while (0)
  7875. /*
  7876. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  7877. *
  7878. * @details
  7879. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  7880. * remove the linkage of the specified peer-TID's MSDU queues to
  7881. * service classes.
  7882. *
  7883. * |31 16|15 12|11 8|7 0|
  7884. * |------------------------------+------+-------+--------------|
  7885. * | peer ID | rsvd | TID | msg type |
  7886. * |------------------------------------------------------------|
  7887. * Header fields:
  7888. * dword0 - b'7:0 - msg_type: This will be set to
  7889. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  7890. * b'11:8 - TID
  7891. * dword1 - b'31:16 - peer ID
  7892. */
  7893. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  7894. A_UINT32 msg_type :8,
  7895. tid :4,
  7896. reserved :4,
  7897. peer_id :16;
  7898. } POSTPACK;
  7899. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  7900. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M 0x00000F00
  7901. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S 8
  7902. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_GET(_var) \
  7903. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M) >> \
  7904. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S)
  7905. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_TID_SET(_var, _val) \
  7906. do { \
  7907. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID, _val); \
  7908. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S));\
  7909. } while (0)
  7910. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  7911. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  7912. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  7913. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  7914. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  7915. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  7916. do { \
  7917. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  7918. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  7919. } while (0)
  7920. /*
  7921. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  7922. *
  7923. * @details
  7924. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  7925. * request the target to report what service class the default MSDU queues
  7926. * of the specified peer-TID are linked to.
  7927. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  7928. * to report what service class (if any) the peer-TID's default MSDU queues
  7929. * are linked to.
  7930. *
  7931. * |31 16|15 12|11 8|7 0|
  7932. * |------------------------------+------+-------+--------------|
  7933. * | peer ID | rsvd | TID | msg type |
  7934. * |------------------------------------------------------------|
  7935. * Header fields:
  7936. * dword0 - b'7:0 - msg_type: This will be set to
  7937. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  7938. * b'11:8 - TID
  7939. * dword1 - b'31:16 - peer ID
  7940. */
  7941. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  7942. A_UINT32 msg_type :8,
  7943. tid :4,
  7944. reserved :4,
  7945. peer_id :16;
  7946. } POSTPACK;
  7947. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  7948. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M 0x00000F00
  7949. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S 8
  7950. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_GET(_var) \
  7951. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M) >> \
  7952. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S)
  7953. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_SET(_var, _val) \
  7954. do { \
  7955. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID, _val); \
  7956. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S));\
  7957. } while (0)
  7958. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  7959. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  7960. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  7961. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  7962. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  7963. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  7964. do { \
  7965. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  7966. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  7967. } while (0)
  7968. /*=== target -> host messages ===============================================*/
  7969. enum htt_t2h_msg_type {
  7970. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7971. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7972. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7973. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7974. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7975. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7976. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7977. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7978. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7979. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7980. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7981. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7982. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7983. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7984. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7985. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7986. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7987. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7988. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7989. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7990. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7991. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7992. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7993. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7994. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7995. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7996. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7997. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7998. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7999. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8000. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8001. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8002. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8003. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8004. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8005. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8006. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8007. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8008. /* TX_OFFLOAD_DELIVER_IND:
  8009. * Forward the target's locally-generated packets to the host,
  8010. * to provide to the monitor mode interface.
  8011. */
  8012. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8013. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8014. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8015. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8016. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8017. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8018. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8019. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8020. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8021. HTT_T2H_MSG_TYPE_TEST,
  8022. /* keep this last */
  8023. HTT_T2H_NUM_MSGS
  8024. };
  8025. /*
  8026. * HTT target to host message type -
  8027. * stored in bits 7:0 of the first word of the message
  8028. */
  8029. #define HTT_T2H_MSG_TYPE_M 0xff
  8030. #define HTT_T2H_MSG_TYPE_S 0
  8031. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8032. do { \
  8033. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8034. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8035. } while (0)
  8036. #define HTT_T2H_MSG_TYPE_GET(word) \
  8037. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8038. /**
  8039. * @brief target -> host version number confirmation message definition
  8040. *
  8041. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8042. *
  8043. * |31 24|23 16|15 8|7 0|
  8044. * |----------------+----------------+----------------+----------------|
  8045. * | reserved | major number | minor number | msg type |
  8046. * |-------------------------------------------------------------------|
  8047. * : option request TLV (optional) |
  8048. * :...................................................................:
  8049. *
  8050. * The VER_CONF message may consist of a single 4-byte word, or may be
  8051. * extended with TLVs that specify HTT options selected by the target.
  8052. * The following option TLVs may be appended to the VER_CONF message:
  8053. * - LL_BUS_ADDR_SIZE
  8054. * - HL_SUPPRESS_TX_COMPL_IND
  8055. * - MAX_TX_QUEUE_GROUPS
  8056. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8057. * may be appended to the VER_CONF message (but only one TLV of each type).
  8058. *
  8059. * Header fields:
  8060. * - MSG_TYPE
  8061. * Bits 7:0
  8062. * Purpose: identifies this as a version number confirmation message
  8063. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8064. * - VER_MINOR
  8065. * Bits 15:8
  8066. * Purpose: Specify the minor number of the HTT message library version
  8067. * in use by the target firmware.
  8068. * The minor number specifies the specific revision within a range
  8069. * of fundamentally compatible HTT message definition revisions.
  8070. * Compatible revisions involve adding new messages or perhaps
  8071. * adding new fields to existing messages, in a backwards-compatible
  8072. * manner.
  8073. * Incompatible revisions involve changing the message type values,
  8074. * or redefining existing messages.
  8075. * Value: minor number
  8076. * - VER_MAJOR
  8077. * Bits 15:8
  8078. * Purpose: Specify the major number of the HTT message library version
  8079. * in use by the target firmware.
  8080. * The major number specifies the family of minor revisions that are
  8081. * fundamentally compatible with each other, but not with prior or
  8082. * later families.
  8083. * Value: major number
  8084. */
  8085. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8086. #define HTT_VER_CONF_MINOR_S 8
  8087. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8088. #define HTT_VER_CONF_MAJOR_S 16
  8089. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8090. do { \
  8091. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8092. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8093. } while (0)
  8094. #define HTT_VER_CONF_MINOR_GET(word) \
  8095. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8096. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8097. do { \
  8098. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8099. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8100. } while (0)
  8101. #define HTT_VER_CONF_MAJOR_GET(word) \
  8102. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8103. #define HTT_VER_CONF_BYTES 4
  8104. /**
  8105. * @brief - target -> host HTT Rx In order indication message
  8106. *
  8107. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8108. *
  8109. * @details
  8110. *
  8111. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8112. * |----------------+-------------------+---------------------+---------------|
  8113. * | peer ID | P| F| O| ext TID | msg type |
  8114. * |--------------------------------------------------------------------------|
  8115. * | MSDU count | Reserved | vdev id |
  8116. * |--------------------------------------------------------------------------|
  8117. * | MSDU 0 bus address (bits 31:0) |
  8118. #if HTT_PADDR64
  8119. * | MSDU 0 bus address (bits 63:32) |
  8120. #endif
  8121. * |--------------------------------------------------------------------------|
  8122. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8123. * |--------------------------------------------------------------------------|
  8124. * | MSDU 1 bus address (bits 31:0) |
  8125. #if HTT_PADDR64
  8126. * | MSDU 1 bus address (bits 63:32) |
  8127. #endif
  8128. * |--------------------------------------------------------------------------|
  8129. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8130. * |--------------------------------------------------------------------------|
  8131. */
  8132. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8133. *
  8134. * @details
  8135. * bits
  8136. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8137. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8138. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8139. * | | frag | | | | fail |chksum fail|
  8140. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8141. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8142. */
  8143. struct htt_rx_in_ord_paddr_ind_hdr_t
  8144. {
  8145. A_UINT32 /* word 0 */
  8146. msg_type: 8,
  8147. ext_tid: 5,
  8148. offload: 1,
  8149. frag: 1,
  8150. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8151. peer_id: 16;
  8152. A_UINT32 /* word 1 */
  8153. vap_id: 8,
  8154. /* NOTE:
  8155. * This reserved_1 field is not truly reserved - certain targets use
  8156. * this field internally to store debug information, and do not zero
  8157. * out the contents of the field before uploading the message to the
  8158. * host. Thus, any host-target communication supported by this field
  8159. * is limited to using values that are never used by the debug
  8160. * information stored by certain targets in the reserved_1 field.
  8161. * In particular, the targets in question don't use the value 0x3
  8162. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8163. * so this previously-unused value within these bits is available to
  8164. * use as the host / target PKT_CAPTURE_MODE flag.
  8165. */
  8166. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8167. /* if pkt_capture_mode == 0x3, host should
  8168. * send rx frames to monitor mode interface
  8169. */
  8170. msdu_cnt: 16;
  8171. };
  8172. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8173. {
  8174. A_UINT32 dma_addr;
  8175. A_UINT32
  8176. length: 16,
  8177. fw_desc: 8,
  8178. msdu_info:8;
  8179. };
  8180. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8181. {
  8182. A_UINT32 dma_addr_lo;
  8183. A_UINT32 dma_addr_hi;
  8184. A_UINT32
  8185. length: 16,
  8186. fw_desc: 8,
  8187. msdu_info:8;
  8188. };
  8189. #if HTT_PADDR64
  8190. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8191. #else
  8192. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8193. #endif
  8194. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8195. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8198. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8199. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8200. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8201. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8202. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8203. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8204. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8205. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8206. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8207. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8208. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8209. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8210. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8211. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8212. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8213. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8214. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8215. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8216. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8217. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8218. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8219. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8220. /* for systems using 64-bit format for bus addresses */
  8221. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8222. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8223. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8224. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8225. /* for systems using 32-bit format for bus addresses */
  8226. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8227. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8228. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8229. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8230. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8231. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8232. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8233. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8234. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8235. do { \
  8236. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8237. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8238. } while (0)
  8239. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8240. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8241. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8242. do { \
  8243. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8244. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8245. } while (0)
  8246. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8247. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8248. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8249. do { \
  8250. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8251. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8252. } while (0)
  8253. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8254. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8255. /*
  8256. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8257. * deliver the rx frames to the monitor mode interface.
  8258. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8259. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8260. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8261. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8262. */
  8263. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8264. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8265. do { \
  8266. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8267. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8268. } while (0)
  8269. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8270. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8271. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8272. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8275. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8276. } while (0)
  8277. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8278. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8279. /* for systems using 64-bit format for bus addresses */
  8280. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8281. do { \
  8282. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8283. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8284. } while (0)
  8285. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8286. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8287. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8288. do { \
  8289. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8290. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8291. } while (0)
  8292. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8293. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8294. /* for systems using 32-bit format for bus addresses */
  8295. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8296. do { \
  8297. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8298. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8299. } while (0)
  8300. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8301. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8302. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8303. do { \
  8304. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8305. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8306. } while (0)
  8307. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8308. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8309. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8310. do { \
  8311. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8312. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8313. } while (0)
  8314. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8315. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8316. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8317. do { \
  8318. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8319. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8320. } while (0)
  8321. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8322. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8323. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8324. do { \
  8325. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8326. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8327. } while (0)
  8328. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8329. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8330. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8331. do { \
  8332. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8333. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8334. } while (0)
  8335. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8336. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8337. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8340. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8341. } while (0)
  8342. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8343. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8344. /* definitions used within target -> host rx indication message */
  8345. PREPACK struct htt_rx_ind_hdr_prefix_t
  8346. {
  8347. A_UINT32 /* word 0 */
  8348. msg_type: 8,
  8349. ext_tid: 5,
  8350. release_valid: 1,
  8351. flush_valid: 1,
  8352. reserved0: 1,
  8353. peer_id: 16;
  8354. A_UINT32 /* word 1 */
  8355. flush_start_seq_num: 6,
  8356. flush_end_seq_num: 6,
  8357. release_start_seq_num: 6,
  8358. release_end_seq_num: 6,
  8359. num_mpdu_ranges: 8;
  8360. } POSTPACK;
  8361. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8362. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8363. #define HTT_TGT_RSSI_INVALID 0x80
  8364. PREPACK struct htt_rx_ppdu_desc_t
  8365. {
  8366. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8367. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8368. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8369. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8370. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8371. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8372. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8373. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8374. A_UINT32 /* word 0 */
  8375. rssi_cmb: 8,
  8376. timestamp_submicrosec: 8,
  8377. phy_err_code: 8,
  8378. phy_err: 1,
  8379. legacy_rate: 4,
  8380. legacy_rate_sel: 1,
  8381. end_valid: 1,
  8382. start_valid: 1;
  8383. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8384. union {
  8385. A_UINT32 /* word 1 */
  8386. rssi0_pri20: 8,
  8387. rssi0_ext20: 8,
  8388. rssi0_ext40: 8,
  8389. rssi0_ext80: 8;
  8390. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8391. } u0;
  8392. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8393. union {
  8394. A_UINT32 /* word 2 */
  8395. rssi1_pri20: 8,
  8396. rssi1_ext20: 8,
  8397. rssi1_ext40: 8,
  8398. rssi1_ext80: 8;
  8399. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8400. } u1;
  8401. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8402. union {
  8403. A_UINT32 /* word 3 */
  8404. rssi2_pri20: 8,
  8405. rssi2_ext20: 8,
  8406. rssi2_ext40: 8,
  8407. rssi2_ext80: 8;
  8408. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8409. } u2;
  8410. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8411. union {
  8412. A_UINT32 /* word 4 */
  8413. rssi3_pri20: 8,
  8414. rssi3_ext20: 8,
  8415. rssi3_ext40: 8,
  8416. rssi3_ext80: 8;
  8417. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8418. } u3;
  8419. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8420. A_UINT32 tsf32; /* word 5 */
  8421. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8422. A_UINT32 timestamp_microsec; /* word 6 */
  8423. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8424. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8425. A_UINT32 /* word 7 */
  8426. vht_sig_a1: 24,
  8427. preamble_type: 8;
  8428. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8429. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8430. A_UINT32 /* word 8 */
  8431. vht_sig_a2: 24,
  8432. /* sa_ant_matrix
  8433. * For cases where a single rx chain has options to be connected to
  8434. * different rx antennas, show which rx antennas were in use during
  8435. * receipt of a given PPDU.
  8436. * This sa_ant_matrix provides a bitmask of the antennas used while
  8437. * receiving this frame.
  8438. */
  8439. sa_ant_matrix: 8;
  8440. } POSTPACK;
  8441. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8442. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8443. PREPACK struct htt_rx_ind_hdr_suffix_t
  8444. {
  8445. A_UINT32 /* word 0 */
  8446. fw_rx_desc_bytes: 16,
  8447. reserved0: 16;
  8448. } POSTPACK;
  8449. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8450. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8451. PREPACK struct htt_rx_ind_hdr_t
  8452. {
  8453. struct htt_rx_ind_hdr_prefix_t prefix;
  8454. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8455. struct htt_rx_ind_hdr_suffix_t suffix;
  8456. } POSTPACK;
  8457. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8458. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8459. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8460. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8461. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8462. /*
  8463. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8464. * the offset into the HTT rx indication message at which the
  8465. * FW rx PPDU descriptor resides
  8466. */
  8467. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8468. /*
  8469. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8470. * the offset into the HTT rx indication message at which the
  8471. * header suffix (FW rx MSDU byte count) resides
  8472. */
  8473. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8474. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8475. /*
  8476. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8477. * the offset into the HTT rx indication message at which the per-MSDU
  8478. * information starts
  8479. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8480. * per-MSDU information portion of the message. The per-MSDU info itself
  8481. * starts at byte 12.
  8482. */
  8483. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8484. /**
  8485. * @brief target -> host rx indication message definition
  8486. *
  8487. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8488. *
  8489. * @details
  8490. * The following field definitions describe the format of the rx indication
  8491. * message sent from the target to the host.
  8492. * The message consists of three major sections:
  8493. * 1. a fixed-length header
  8494. * 2. a variable-length list of firmware rx MSDU descriptors
  8495. * 3. one or more 4-octet MPDU range information elements
  8496. * The fixed length header itself has two sub-sections
  8497. * 1. the message meta-information, including identification of the
  8498. * sender and type of the received data, and a 4-octet flush/release IE
  8499. * 2. the firmware rx PPDU descriptor
  8500. *
  8501. * The format of the message is depicted below.
  8502. * in this depiction, the following abbreviations are used for information
  8503. * elements within the message:
  8504. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8505. * elements associated with the PPDU start are valid.
  8506. * Specifically, the following fields are valid only if SV is set:
  8507. * RSSI (all variants), L, legacy rate, preamble type, service,
  8508. * VHT-SIG-A
  8509. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8510. * elements associated with the PPDU end are valid.
  8511. * Specifically, the following fields are valid only if EV is set:
  8512. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8513. * - L - Legacy rate selector - if legacy rates are used, this flag
  8514. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8515. * (L == 0) PHY.
  8516. * - P - PHY error flag - boolean indication of whether the rx frame had
  8517. * a PHY error
  8518. *
  8519. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8520. * |----------------+-------------------+---------------------+---------------|
  8521. * | peer ID | |RV|FV| ext TID | msg type |
  8522. * |--------------------------------------------------------------------------|
  8523. * | num | release | release | flush | flush |
  8524. * | MPDU | end | start | end | start |
  8525. * | ranges | seq num | seq num | seq num | seq num |
  8526. * |==========================================================================|
  8527. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8528. * |V|V| | rate | | | timestamp | RSSI |
  8529. * |--------------------------------------------------------------------------|
  8530. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8531. * |--------------------------------------------------------------------------|
  8532. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8533. * |--------------------------------------------------------------------------|
  8534. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8535. * |--------------------------------------------------------------------------|
  8536. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8537. * |--------------------------------------------------------------------------|
  8538. * | TSF LSBs |
  8539. * |--------------------------------------------------------------------------|
  8540. * | microsec timestamp |
  8541. * |--------------------------------------------------------------------------|
  8542. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8543. * |--------------------------------------------------------------------------|
  8544. * | service | HT-SIG / VHT-SIG-A2 |
  8545. * |==========================================================================|
  8546. * | reserved | FW rx desc bytes |
  8547. * |--------------------------------------------------------------------------|
  8548. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8549. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8550. * |--------------------------------------------------------------------------|
  8551. * : : :
  8552. * |--------------------------------------------------------------------------|
  8553. * | alignment | MSDU Rx |
  8554. * | padding | desc Bn |
  8555. * |--------------------------------------------------------------------------|
  8556. * | reserved | MPDU range status | MPDU count |
  8557. * |--------------------------------------------------------------------------|
  8558. * : reserved : MPDU range status : MPDU count :
  8559. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8560. *
  8561. * Header fields:
  8562. * - MSG_TYPE
  8563. * Bits 7:0
  8564. * Purpose: identifies this as an rx indication message
  8565. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8566. * - EXT_TID
  8567. * Bits 12:8
  8568. * Purpose: identify the traffic ID of the rx data, including
  8569. * special "extended" TID values for multicast, broadcast, and
  8570. * non-QoS data frames
  8571. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8572. * - FLUSH_VALID (FV)
  8573. * Bit 13
  8574. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8575. * is valid
  8576. * Value:
  8577. * 1 -> flush IE is valid and needs to be processed
  8578. * 0 -> flush IE is not valid and should be ignored
  8579. * - REL_VALID (RV)
  8580. * Bit 13
  8581. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8582. * is valid
  8583. * Value:
  8584. * 1 -> release IE is valid and needs to be processed
  8585. * 0 -> release IE is not valid and should be ignored
  8586. * - PEER_ID
  8587. * Bits 31:16
  8588. * Purpose: Identify, by ID, which peer sent the rx data
  8589. * Value: ID of the peer who sent the rx data
  8590. * - FLUSH_SEQ_NUM_START
  8591. * Bits 5:0
  8592. * Purpose: Indicate the start of a series of MPDUs to flush
  8593. * Not all MPDUs within this series are necessarily valid - the host
  8594. * must check each sequence number within this range to see if the
  8595. * corresponding MPDU is actually present.
  8596. * This field is only valid if the FV bit is set.
  8597. * Value:
  8598. * The sequence number for the first MPDUs to check to flush.
  8599. * The sequence number is masked by 0x3f.
  8600. * - FLUSH_SEQ_NUM_END
  8601. * Bits 11:6
  8602. * Purpose: Indicate the end of a series of MPDUs to flush
  8603. * Value:
  8604. * The sequence number one larger than the sequence number of the
  8605. * last MPDU to check to flush.
  8606. * The sequence number is masked by 0x3f.
  8607. * Not all MPDUs within this series are necessarily valid - the host
  8608. * must check each sequence number within this range to see if the
  8609. * corresponding MPDU is actually present.
  8610. * This field is only valid if the FV bit is set.
  8611. * - REL_SEQ_NUM_START
  8612. * Bits 17:12
  8613. * Purpose: Indicate the start of a series of MPDUs to release.
  8614. * All MPDUs within this series are present and valid - the host
  8615. * need not check each sequence number within this range to see if
  8616. * the corresponding MPDU is actually present.
  8617. * This field is only valid if the RV bit is set.
  8618. * Value:
  8619. * The sequence number for the first MPDUs to check to release.
  8620. * The sequence number is masked by 0x3f.
  8621. * - REL_SEQ_NUM_END
  8622. * Bits 23:18
  8623. * Purpose: Indicate the end of a series of MPDUs to release.
  8624. * Value:
  8625. * The sequence number one larger than the sequence number of the
  8626. * last MPDU to check to release.
  8627. * The sequence number is masked by 0x3f.
  8628. * All MPDUs within this series are present and valid - the host
  8629. * need not check each sequence number within this range to see if
  8630. * the corresponding MPDU is actually present.
  8631. * This field is only valid if the RV bit is set.
  8632. * - NUM_MPDU_RANGES
  8633. * Bits 31:24
  8634. * Purpose: Indicate how many ranges of MPDUs are present.
  8635. * Each MPDU range consists of a series of contiguous MPDUs within the
  8636. * rx frame sequence which all have the same MPDU status.
  8637. * Value: 1-63 (typically a small number, like 1-3)
  8638. *
  8639. * Rx PPDU descriptor fields:
  8640. * - RSSI_CMB
  8641. * Bits 7:0
  8642. * Purpose: Combined RSSI from all active rx chains, across the active
  8643. * bandwidth.
  8644. * Value: RSSI dB units w.r.t. noise floor
  8645. * - TIMESTAMP_SUBMICROSEC
  8646. * Bits 15:8
  8647. * Purpose: high-resolution timestamp
  8648. * Value:
  8649. * Sub-microsecond time of PPDU reception.
  8650. * This timestamp ranges from [0,MAC clock MHz).
  8651. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8652. * to form a high-resolution, large range rx timestamp.
  8653. * - PHY_ERR_CODE
  8654. * Bits 23:16
  8655. * Purpose:
  8656. * If the rx frame processing resulted in a PHY error, indicate what
  8657. * type of rx PHY error occurred.
  8658. * Value:
  8659. * This field is valid if the "P" (PHY_ERR) flag is set.
  8660. * TBD: document/specify the values for this field
  8661. * - PHY_ERR
  8662. * Bit 24
  8663. * Purpose: indicate whether the rx PPDU had a PHY error
  8664. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8665. * - LEGACY_RATE
  8666. * Bits 28:25
  8667. * Purpose:
  8668. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8669. * specify which rate was used.
  8670. * Value:
  8671. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8672. * flag.
  8673. * If LEGACY_RATE_SEL is 0:
  8674. * 0x8: OFDM 48 Mbps
  8675. * 0x9: OFDM 24 Mbps
  8676. * 0xA: OFDM 12 Mbps
  8677. * 0xB: OFDM 6 Mbps
  8678. * 0xC: OFDM 54 Mbps
  8679. * 0xD: OFDM 36 Mbps
  8680. * 0xE: OFDM 18 Mbps
  8681. * 0xF: OFDM 9 Mbps
  8682. * If LEGACY_RATE_SEL is 1:
  8683. * 0x8: CCK 11 Mbps long preamble
  8684. * 0x9: CCK 5.5 Mbps long preamble
  8685. * 0xA: CCK 2 Mbps long preamble
  8686. * 0xB: CCK 1 Mbps long preamble
  8687. * 0xC: CCK 11 Mbps short preamble
  8688. * 0xD: CCK 5.5 Mbps short preamble
  8689. * 0xE: CCK 2 Mbps short preamble
  8690. * - LEGACY_RATE_SEL
  8691. * Bit 29
  8692. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8693. * Value:
  8694. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8695. * used a legacy rate.
  8696. * 0 -> OFDM, 1 -> CCK
  8697. * - END_VALID
  8698. * Bit 30
  8699. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8700. * the start of the PPDU are valid. Specifically, the following
  8701. * fields are only valid if END_VALID is set:
  8702. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8703. * TIMESTAMP_SUBMICROSEC
  8704. * Value:
  8705. * 0 -> rx PPDU desc end fields are not valid
  8706. * 1 -> rx PPDU desc end fields are valid
  8707. * - START_VALID
  8708. * Bit 31
  8709. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8710. * the end of the PPDU are valid. Specifically, the following
  8711. * fields are only valid if START_VALID is set:
  8712. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8713. * VHT-SIG-A
  8714. * Value:
  8715. * 0 -> rx PPDU desc start fields are not valid
  8716. * 1 -> rx PPDU desc start fields are valid
  8717. * - RSSI0_PRI20
  8718. * Bits 7:0
  8719. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8720. * Value: RSSI dB units w.r.t. noise floor
  8721. *
  8722. * - RSSI0_EXT20
  8723. * Bits 7:0
  8724. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8725. * (if the rx bandwidth was >= 40 MHz)
  8726. * Value: RSSI dB units w.r.t. noise floor
  8727. * - RSSI0_EXT40
  8728. * Bits 7:0
  8729. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8730. * (if the rx bandwidth was >= 80 MHz)
  8731. * Value: RSSI dB units w.r.t. noise floor
  8732. * - RSSI0_EXT80
  8733. * Bits 7:0
  8734. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8735. * (if the rx bandwidth was >= 160 MHz)
  8736. * Value: RSSI dB units w.r.t. noise floor
  8737. *
  8738. * - RSSI1_PRI20
  8739. * Bits 7:0
  8740. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8741. * Value: RSSI dB units w.r.t. noise floor
  8742. * - RSSI1_EXT20
  8743. * Bits 7:0
  8744. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8745. * (if the rx bandwidth was >= 40 MHz)
  8746. * Value: RSSI dB units w.r.t. noise floor
  8747. * - RSSI1_EXT40
  8748. * Bits 7:0
  8749. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8750. * (if the rx bandwidth was >= 80 MHz)
  8751. * Value: RSSI dB units w.r.t. noise floor
  8752. * - RSSI1_EXT80
  8753. * Bits 7:0
  8754. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8755. * (if the rx bandwidth was >= 160 MHz)
  8756. * Value: RSSI dB units w.r.t. noise floor
  8757. *
  8758. * - RSSI2_PRI20
  8759. * Bits 7:0
  8760. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8761. * Value: RSSI dB units w.r.t. noise floor
  8762. * - RSSI2_EXT20
  8763. * Bits 7:0
  8764. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8765. * (if the rx bandwidth was >= 40 MHz)
  8766. * Value: RSSI dB units w.r.t. noise floor
  8767. * - RSSI2_EXT40
  8768. * Bits 7:0
  8769. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8770. * (if the rx bandwidth was >= 80 MHz)
  8771. * Value: RSSI dB units w.r.t. noise floor
  8772. * - RSSI2_EXT80
  8773. * Bits 7:0
  8774. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8775. * (if the rx bandwidth was >= 160 MHz)
  8776. * Value: RSSI dB units w.r.t. noise floor
  8777. *
  8778. * - RSSI3_PRI20
  8779. * Bits 7:0
  8780. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8781. * Value: RSSI dB units w.r.t. noise floor
  8782. * - RSSI3_EXT20
  8783. * Bits 7:0
  8784. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8785. * (if the rx bandwidth was >= 40 MHz)
  8786. * Value: RSSI dB units w.r.t. noise floor
  8787. * - RSSI3_EXT40
  8788. * Bits 7:0
  8789. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8790. * (if the rx bandwidth was >= 80 MHz)
  8791. * Value: RSSI dB units w.r.t. noise floor
  8792. * - RSSI3_EXT80
  8793. * Bits 7:0
  8794. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8795. * (if the rx bandwidth was >= 160 MHz)
  8796. * Value: RSSI dB units w.r.t. noise floor
  8797. *
  8798. * - TSF32
  8799. * Bits 31:0
  8800. * Purpose: specify the time the rx PPDU was received, in TSF units
  8801. * Value: 32 LSBs of the TSF
  8802. * - TIMESTAMP_MICROSEC
  8803. * Bits 31:0
  8804. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8805. * Value: PPDU rx time, in microseconds
  8806. * - VHT_SIG_A1
  8807. * Bits 23:0
  8808. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8809. * from the rx PPDU
  8810. * Value:
  8811. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8812. * VHT-SIG-A1 data.
  8813. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8814. * first 24 bits of the HT-SIG data.
  8815. * Otherwise, this field is invalid.
  8816. * Refer to the the 802.11 protocol for the definition of the
  8817. * HT-SIG and VHT-SIG-A1 fields
  8818. * - VHT_SIG_A2
  8819. * Bits 23:0
  8820. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8821. * from the rx PPDU
  8822. * Value:
  8823. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8824. * VHT-SIG-A2 data.
  8825. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8826. * last 24 bits of the HT-SIG data.
  8827. * Otherwise, this field is invalid.
  8828. * Refer to the the 802.11 protocol for the definition of the
  8829. * HT-SIG and VHT-SIG-A2 fields
  8830. * - PREAMBLE_TYPE
  8831. * Bits 31:24
  8832. * Purpose: indicate the PHY format of the received burst
  8833. * Value:
  8834. * 0x4: Legacy (OFDM/CCK)
  8835. * 0x8: HT
  8836. * 0x9: HT with TxBF
  8837. * 0xC: VHT
  8838. * 0xD: VHT with TxBF
  8839. * - SERVICE
  8840. * Bits 31:24
  8841. * Purpose: TBD
  8842. * Value: TBD
  8843. *
  8844. * Rx MSDU descriptor fields:
  8845. * - FW_RX_DESC_BYTES
  8846. * Bits 15:0
  8847. * Purpose: Indicate how many bytes in the Rx indication are used for
  8848. * FW Rx descriptors
  8849. *
  8850. * Payload fields:
  8851. * - MPDU_COUNT
  8852. * Bits 7:0
  8853. * Purpose: Indicate how many sequential MPDUs share the same status.
  8854. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8855. * - MPDU_STATUS
  8856. * Bits 15:8
  8857. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8858. * received successfully.
  8859. * Value:
  8860. * 0x1: success
  8861. * 0x2: FCS error
  8862. * 0x3: duplicate error
  8863. * 0x4: replay error
  8864. * 0x5: invalid peer
  8865. */
  8866. /* header fields */
  8867. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8868. #define HTT_RX_IND_EXT_TID_S 8
  8869. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8870. #define HTT_RX_IND_FLUSH_VALID_S 13
  8871. #define HTT_RX_IND_REL_VALID_M 0x4000
  8872. #define HTT_RX_IND_REL_VALID_S 14
  8873. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8874. #define HTT_RX_IND_PEER_ID_S 16
  8875. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8876. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8877. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8878. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8879. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8880. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8881. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8882. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8883. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8884. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8885. /* rx PPDU descriptor fields */
  8886. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8887. #define HTT_RX_IND_RSSI_CMB_S 0
  8888. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8889. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8890. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8891. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8892. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8893. #define HTT_RX_IND_PHY_ERR_S 24
  8894. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8895. #define HTT_RX_IND_LEGACY_RATE_S 25
  8896. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8897. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8898. #define HTT_RX_IND_END_VALID_M 0x40000000
  8899. #define HTT_RX_IND_END_VALID_S 30
  8900. #define HTT_RX_IND_START_VALID_M 0x80000000
  8901. #define HTT_RX_IND_START_VALID_S 31
  8902. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8903. #define HTT_RX_IND_RSSI_PRI20_S 0
  8904. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8905. #define HTT_RX_IND_RSSI_EXT20_S 8
  8906. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8907. #define HTT_RX_IND_RSSI_EXT40_S 16
  8908. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8909. #define HTT_RX_IND_RSSI_EXT80_S 24
  8910. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8911. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8912. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8913. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8914. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8915. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8916. #define HTT_RX_IND_SERVICE_M 0xff000000
  8917. #define HTT_RX_IND_SERVICE_S 24
  8918. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8919. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8920. /* rx MSDU descriptor fields */
  8921. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8922. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8923. /* payload fields */
  8924. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8925. #define HTT_RX_IND_MPDU_COUNT_S 0
  8926. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8927. #define HTT_RX_IND_MPDU_STATUS_S 8
  8928. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8929. do { \
  8930. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8931. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8932. } while (0)
  8933. #define HTT_RX_IND_EXT_TID_GET(word) \
  8934. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8935. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8936. do { \
  8937. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8938. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8939. } while (0)
  8940. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8941. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8942. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8943. do { \
  8944. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8945. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8946. } while (0)
  8947. #define HTT_RX_IND_REL_VALID_GET(word) \
  8948. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8949. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8950. do { \
  8951. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8952. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8953. } while (0)
  8954. #define HTT_RX_IND_PEER_ID_GET(word) \
  8955. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8956. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8957. do { \
  8958. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8959. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8960. } while (0)
  8961. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8962. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8963. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8964. do { \
  8965. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8966. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8967. } while (0)
  8968. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8969. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8970. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8971. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8972. do { \
  8973. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8974. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8975. } while (0)
  8976. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8977. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8978. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8979. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8980. do { \
  8981. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8982. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8983. } while (0)
  8984. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8985. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8986. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8987. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8988. do { \
  8989. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8990. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8991. } while (0)
  8992. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8993. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8994. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8995. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8998. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8999. } while (0)
  9000. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9001. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9002. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9003. /* FW rx PPDU descriptor fields */
  9004. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9005. do { \
  9006. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9007. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9008. } while (0)
  9009. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9010. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9011. HTT_RX_IND_RSSI_CMB_S)
  9012. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9013. do { \
  9014. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9015. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9016. } while (0)
  9017. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9018. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9019. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9020. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9021. do { \
  9022. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9023. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9024. } while (0)
  9025. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9026. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9027. HTT_RX_IND_PHY_ERR_CODE_S)
  9028. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9029. do { \
  9030. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9031. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9032. } while (0)
  9033. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9034. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9035. HTT_RX_IND_PHY_ERR_S)
  9036. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9037. do { \
  9038. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9039. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9040. } while (0)
  9041. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9042. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9043. HTT_RX_IND_LEGACY_RATE_S)
  9044. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9045. do { \
  9046. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9047. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9048. } while (0)
  9049. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9050. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9051. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9052. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9053. do { \
  9054. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9055. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9056. } while (0)
  9057. #define HTT_RX_IND_END_VALID_GET(word) \
  9058. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9059. HTT_RX_IND_END_VALID_S)
  9060. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9061. do { \
  9062. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9063. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9064. } while (0)
  9065. #define HTT_RX_IND_START_VALID_GET(word) \
  9066. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9067. HTT_RX_IND_START_VALID_S)
  9068. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9069. do { \
  9070. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9071. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9072. } while (0)
  9073. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9074. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9075. HTT_RX_IND_RSSI_PRI20_S)
  9076. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9077. do { \
  9078. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9079. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9080. } while (0)
  9081. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9082. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9083. HTT_RX_IND_RSSI_EXT20_S)
  9084. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9085. do { \
  9086. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9087. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9088. } while (0)
  9089. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9090. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9091. HTT_RX_IND_RSSI_EXT40_S)
  9092. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9093. do { \
  9094. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9095. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9096. } while (0)
  9097. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9098. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9099. HTT_RX_IND_RSSI_EXT80_S)
  9100. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9101. do { \
  9102. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9103. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9104. } while (0)
  9105. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9106. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9107. HTT_RX_IND_VHT_SIG_A1_S)
  9108. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9109. do { \
  9110. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9111. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9112. } while (0)
  9113. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9114. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9115. HTT_RX_IND_VHT_SIG_A2_S)
  9116. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9117. do { \
  9118. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9119. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9120. } while (0)
  9121. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9122. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9123. HTT_RX_IND_PREAMBLE_TYPE_S)
  9124. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9125. do { \
  9126. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9127. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9128. } while (0)
  9129. #define HTT_RX_IND_SERVICE_GET(word) \
  9130. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9131. HTT_RX_IND_SERVICE_S)
  9132. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9133. do { \
  9134. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9135. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9136. } while (0)
  9137. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9138. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9139. HTT_RX_IND_SA_ANT_MATRIX_S)
  9140. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9143. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9144. } while (0)
  9145. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9146. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9147. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9150. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9151. } while (0)
  9152. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9153. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9154. #define HTT_RX_IND_HL_BYTES \
  9155. (HTT_RX_IND_HDR_BYTES + \
  9156. 4 /* single FW rx MSDU descriptor */ + \
  9157. 4 /* single MPDU range information element */)
  9158. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9159. /* Could we use one macro entry? */
  9160. #define HTT_WORD_SET(word, field, value) \
  9161. do { \
  9162. HTT_CHECK_SET_VAL(field, value); \
  9163. (word) |= ((value) << field ## _S); \
  9164. } while (0)
  9165. #define HTT_WORD_GET(word, field) \
  9166. (((word) & field ## _M) >> field ## _S)
  9167. PREPACK struct hl_htt_rx_ind_base {
  9168. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9169. } POSTPACK;
  9170. /*
  9171. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9172. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9173. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9174. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9175. * htt_rx_ind_hl_rx_desc_t.
  9176. */
  9177. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9178. struct htt_rx_ind_hl_rx_desc_t {
  9179. A_UINT8 ver;
  9180. A_UINT8 len;
  9181. struct {
  9182. A_UINT8
  9183. first_msdu: 1,
  9184. last_msdu: 1,
  9185. c3_failed: 1,
  9186. c4_failed: 1,
  9187. ipv6: 1,
  9188. tcp: 1,
  9189. udp: 1,
  9190. reserved: 1;
  9191. } flags;
  9192. /* NOTE: no reserved space - don't append any new fields here */
  9193. };
  9194. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9195. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9196. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9197. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9198. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9199. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9200. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9201. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9202. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9203. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9204. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9205. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9206. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9207. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9208. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9209. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9210. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9211. /* This structure is used in HL, the basic descriptor information
  9212. * used by host. the structure is translated by FW from HW desc
  9213. * or generated by FW. But in HL monitor mode, the host would use
  9214. * the same structure with LL.
  9215. */
  9216. PREPACK struct hl_htt_rx_desc_base {
  9217. A_UINT32
  9218. seq_num:12,
  9219. encrypted:1,
  9220. chan_info_present:1,
  9221. resv0:2,
  9222. mcast_bcast:1,
  9223. fragment:1,
  9224. key_id_oct:8,
  9225. resv1:6;
  9226. A_UINT32
  9227. pn_31_0;
  9228. union {
  9229. struct {
  9230. A_UINT16 pn_47_32;
  9231. A_UINT16 pn_63_48;
  9232. } pn16;
  9233. A_UINT32 pn_63_32;
  9234. } u0;
  9235. A_UINT32
  9236. pn_95_64;
  9237. A_UINT32
  9238. pn_127_96;
  9239. } POSTPACK;
  9240. /*
  9241. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9242. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9243. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9244. * Please see htt_chan_change_t for description of the fields.
  9245. */
  9246. PREPACK struct htt_chan_info_t
  9247. {
  9248. A_UINT32 primary_chan_center_freq_mhz: 16,
  9249. contig_chan1_center_freq_mhz: 16;
  9250. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9251. phy_mode: 8,
  9252. reserved: 8;
  9253. } POSTPACK;
  9254. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9255. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9256. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9257. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9258. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9259. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9260. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9261. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9262. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9263. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9264. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9265. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9266. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9267. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9268. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9269. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9270. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9271. /* Channel information */
  9272. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9273. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9274. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9275. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9276. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9277. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9278. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9279. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9280. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9281. do { \
  9282. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9283. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9284. } while (0)
  9285. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9286. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9287. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9288. do { \
  9289. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9290. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9291. } while (0)
  9292. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9293. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9294. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9295. do { \
  9296. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9297. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9298. } while (0)
  9299. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9300. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9301. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9302. do { \
  9303. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9304. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9305. } while (0)
  9306. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9307. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9308. /*
  9309. * @brief target -> host message definition for FW offloaded pkts
  9310. *
  9311. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9312. *
  9313. * @details
  9314. * The following field definitions describe the format of the firmware
  9315. * offload deliver message sent from the target to the host.
  9316. *
  9317. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9318. *
  9319. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9320. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9321. * | reserved_1 | msg type |
  9322. * |--------------------------------------------------------------------------|
  9323. * | phy_timestamp_l32 |
  9324. * |--------------------------------------------------------------------------|
  9325. * | WORD2 (see below) |
  9326. * |--------------------------------------------------------------------------|
  9327. * | seqno | framectrl |
  9328. * |--------------------------------------------------------------------------|
  9329. * | reserved_3 | vdev_id | tid_num|
  9330. * |--------------------------------------------------------------------------|
  9331. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9332. * |--------------------------------------------------------------------------|
  9333. *
  9334. * where:
  9335. * STAT = status
  9336. * F = format (802.3 vs. 802.11)
  9337. *
  9338. * definition for word 2
  9339. *
  9340. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9341. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9342. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9343. * |--------------------------------------------------------------------------|
  9344. *
  9345. * where:
  9346. * PR = preamble
  9347. * BF = beamformed
  9348. */
  9349. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9350. {
  9351. A_UINT32 /* word 0 */
  9352. msg_type:8, /* [ 7: 0] */
  9353. reserved_1:24; /* [31: 8] */
  9354. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9355. A_UINT32 /* word 2 */
  9356. /* preamble:
  9357. * 0-OFDM,
  9358. * 1-CCk,
  9359. * 2-HT,
  9360. * 3-VHT
  9361. */
  9362. preamble: 2, /* [1:0] */
  9363. /* mcs:
  9364. * In case of HT preamble interpret
  9365. * MCS along with NSS.
  9366. * Valid values for HT are 0 to 7.
  9367. * HT mcs 0 with NSS 2 is mcs 8.
  9368. * Valid values for VHT are 0 to 9.
  9369. */
  9370. mcs: 4, /* [5:2] */
  9371. /* rate:
  9372. * This is applicable only for
  9373. * CCK and OFDM preamble type
  9374. * rate 0: OFDM 48 Mbps,
  9375. * 1: OFDM 24 Mbps,
  9376. * 2: OFDM 12 Mbps
  9377. * 3: OFDM 6 Mbps
  9378. * 4: OFDM 54 Mbps
  9379. * 5: OFDM 36 Mbps
  9380. * 6: OFDM 18 Mbps
  9381. * 7: OFDM 9 Mbps
  9382. * rate 0: CCK 11 Mbps Long
  9383. * 1: CCK 5.5 Mbps Long
  9384. * 2: CCK 2 Mbps Long
  9385. * 3: CCK 1 Mbps Long
  9386. * 4: CCK 11 Mbps Short
  9387. * 5: CCK 5.5 Mbps Short
  9388. * 6: CCK 2 Mbps Short
  9389. */
  9390. rate : 3, /* [ 8: 6] */
  9391. rssi : 8, /* [16: 9] units=dBm */
  9392. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9393. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9394. stbc : 1, /* [22] */
  9395. sgi : 1, /* [23] */
  9396. ldpc : 1, /* [24] */
  9397. beamformed: 1, /* [25] */
  9398. reserved_2: 6; /* [31:26] */
  9399. A_UINT32 /* word 3 */
  9400. framectrl:16, /* [15: 0] */
  9401. seqno:16; /* [31:16] */
  9402. A_UINT32 /* word 4 */
  9403. tid_num:5, /* [ 4: 0] actual TID number */
  9404. vdev_id:8, /* [12: 5] */
  9405. reserved_3:19; /* [31:13] */
  9406. A_UINT32 /* word 5 */
  9407. /* status:
  9408. * 0: tx_ok
  9409. * 1: retry
  9410. * 2: drop
  9411. * 3: filtered
  9412. * 4: abort
  9413. * 5: tid delete
  9414. * 6: sw abort
  9415. * 7: dropped by peer migration
  9416. */
  9417. status:3, /* [2:0] */
  9418. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9419. tx_mpdu_bytes:16, /* [19:4] */
  9420. /* Indicates retry count of offloaded/local generated Data tx frames */
  9421. tx_retry_cnt:6, /* [25:20] */
  9422. reserved_4:6; /* [31:26] */
  9423. } POSTPACK;
  9424. /* FW offload deliver ind message header fields */
  9425. /* DWORD one */
  9426. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9427. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9428. /* DWORD two */
  9429. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9430. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9431. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9432. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9433. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9434. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9435. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9436. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9437. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9438. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9439. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9440. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9441. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9442. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9443. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9444. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9445. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9446. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9447. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9448. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9449. /* DWORD three*/
  9450. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9451. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9452. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9453. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9454. /* DWORD four */
  9455. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9456. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9457. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9458. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9459. /* DWORD five */
  9460. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9461. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9462. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9463. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9464. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9465. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9466. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9467. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9468. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9469. do { \
  9470. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9471. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9472. } while (0)
  9473. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9474. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9475. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9476. do { \
  9477. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9478. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9479. } while (0)
  9480. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9481. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9482. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9483. do { \
  9484. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9485. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9486. } while (0)
  9487. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9488. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9489. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9490. do { \
  9491. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9492. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9493. } while (0)
  9494. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9495. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9496. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9497. do { \
  9498. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9499. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9500. } while (0)
  9501. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9502. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9503. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9504. do { \
  9505. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9506. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9507. } while (0)
  9508. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9509. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9510. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9511. do { \
  9512. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9513. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9514. } while (0)
  9515. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9516. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9517. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9518. do { \
  9519. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9520. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9521. } while (0)
  9522. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9523. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9524. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9525. do { \
  9526. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9527. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9528. } while (0)
  9529. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9530. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9531. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9532. do { \
  9533. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9534. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9535. } while (0)
  9536. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9537. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9538. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9539. do { \
  9540. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9541. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9542. } while (0)
  9543. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9544. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9545. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9546. do { \
  9547. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9548. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9549. } while (0)
  9550. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9551. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9552. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9553. do { \
  9554. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9555. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9556. } while (0)
  9557. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9558. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9559. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9560. do { \
  9561. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9562. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9563. } while (0)
  9564. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9565. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9566. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9567. do { \
  9568. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9569. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9570. } while (0)
  9571. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9572. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9573. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9574. do { \
  9575. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9576. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9577. } while (0)
  9578. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9579. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9580. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9581. do { \
  9582. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9583. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9584. } while (0)
  9585. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9586. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9587. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9588. do { \
  9589. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9590. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9591. } while (0)
  9592. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9593. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9594. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9595. do { \
  9596. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9597. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9598. } while (0)
  9599. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9600. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9601. /*
  9602. * @brief target -> host rx reorder flush message definition
  9603. *
  9604. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9605. *
  9606. * @details
  9607. * The following field definitions describe the format of the rx flush
  9608. * message sent from the target to the host.
  9609. * The message consists of a 4-octet header, followed by one or more
  9610. * 4-octet payload information elements.
  9611. *
  9612. * |31 24|23 8|7 0|
  9613. * |--------------------------------------------------------------|
  9614. * | TID | peer ID | msg type |
  9615. * |--------------------------------------------------------------|
  9616. * | seq num end | seq num start | MPDU status | reserved |
  9617. * |--------------------------------------------------------------|
  9618. * First DWORD:
  9619. * - MSG_TYPE
  9620. * Bits 7:0
  9621. * Purpose: identifies this as an rx flush message
  9622. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9623. * - PEER_ID
  9624. * Bits 23:8 (only bits 18:8 actually used)
  9625. * Purpose: identify which peer's rx data is being flushed
  9626. * Value: (rx) peer ID
  9627. * - TID
  9628. * Bits 31:24 (only bits 27:24 actually used)
  9629. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9630. * Value: traffic identifier
  9631. * Second DWORD:
  9632. * - MPDU_STATUS
  9633. * Bits 15:8
  9634. * Purpose:
  9635. * Indicate whether the flushed MPDUs should be discarded or processed.
  9636. * Value:
  9637. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9638. * stages of rx processing
  9639. * other: discard the MPDUs
  9640. * It is anticipated that flush messages will always have
  9641. * MPDU status == 1, but the status flag is included for
  9642. * flexibility.
  9643. * - SEQ_NUM_START
  9644. * Bits 23:16
  9645. * Purpose:
  9646. * Indicate the start of a series of consecutive MPDUs being flushed.
  9647. * Not all MPDUs within this range are necessarily valid - the host
  9648. * must check each sequence number within this range to see if the
  9649. * corresponding MPDU is actually present.
  9650. * Value:
  9651. * The sequence number for the first MPDU in the sequence.
  9652. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9653. * - SEQ_NUM_END
  9654. * Bits 30:24
  9655. * Purpose:
  9656. * Indicate the end of a series of consecutive MPDUs being flushed.
  9657. * Value:
  9658. * The sequence number one larger than the sequence number of the
  9659. * last MPDU being flushed.
  9660. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9661. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9662. * are to be released for further rx processing.
  9663. * Not all MPDUs within this range are necessarily valid - the host
  9664. * must check each sequence number within this range to see if the
  9665. * corresponding MPDU is actually present.
  9666. */
  9667. /* first DWORD */
  9668. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9669. #define HTT_RX_FLUSH_PEER_ID_S 8
  9670. #define HTT_RX_FLUSH_TID_M 0xff000000
  9671. #define HTT_RX_FLUSH_TID_S 24
  9672. /* second DWORD */
  9673. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9674. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9675. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9676. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9677. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9678. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9679. #define HTT_RX_FLUSH_BYTES 8
  9680. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9681. do { \
  9682. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9683. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9684. } while (0)
  9685. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9686. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9687. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9688. do { \
  9689. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9690. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9691. } while (0)
  9692. #define HTT_RX_FLUSH_TID_GET(word) \
  9693. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9694. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9695. do { \
  9696. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9697. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9698. } while (0)
  9699. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9700. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9701. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9702. do { \
  9703. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9704. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9705. } while (0)
  9706. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9707. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9708. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9709. do { \
  9710. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9711. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9712. } while (0)
  9713. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9714. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9715. /*
  9716. * @brief target -> host rx pn check indication message
  9717. *
  9718. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9719. *
  9720. * @details
  9721. * The following field definitions describe the format of the Rx PN check
  9722. * indication message sent from the target to the host.
  9723. * The message consists of a 4-octet header, followed by the start and
  9724. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9725. * IE is one octet containing the sequence number that failed the PN
  9726. * check.
  9727. *
  9728. * |31 24|23 8|7 0|
  9729. * |--------------------------------------------------------------|
  9730. * | TID | peer ID | msg type |
  9731. * |--------------------------------------------------------------|
  9732. * | Reserved | PN IE count | seq num end | seq num start|
  9733. * |--------------------------------------------------------------|
  9734. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9735. * |--------------------------------------------------------------|
  9736. * First DWORD:
  9737. * - MSG_TYPE
  9738. * Bits 7:0
  9739. * Purpose: Identifies this as an rx pn check indication message
  9740. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9741. * - PEER_ID
  9742. * Bits 23:8 (only bits 18:8 actually used)
  9743. * Purpose: identify which peer
  9744. * Value: (rx) peer ID
  9745. * - TID
  9746. * Bits 31:24 (only bits 27:24 actually used)
  9747. * Purpose: identify traffic identifier
  9748. * Value: traffic identifier
  9749. * Second DWORD:
  9750. * - SEQ_NUM_START
  9751. * Bits 7:0
  9752. * Purpose:
  9753. * Indicates the starting sequence number of the MPDU in this
  9754. * series of MPDUs that went though PN check.
  9755. * Value:
  9756. * The sequence number for the first MPDU in the sequence.
  9757. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9758. * - SEQ_NUM_END
  9759. * Bits 15:8
  9760. * Purpose:
  9761. * Indicates the ending sequence number of the MPDU in this
  9762. * series of MPDUs that went though PN check.
  9763. * Value:
  9764. * The sequence number one larger then the sequence number of the last
  9765. * MPDU being flushed.
  9766. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9767. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9768. * for invalid PN numbers and are ready to be released for further processing.
  9769. * Not all MPDUs within this range are necessarily valid - the host
  9770. * must check each sequence number within this range to see if the
  9771. * corresponding MPDU is actually present.
  9772. * - PN_IE_COUNT
  9773. * Bits 23:16
  9774. * Purpose:
  9775. * Used to determine the variable number of PN information elements in this
  9776. * message
  9777. *
  9778. * PN information elements:
  9779. * - PN_IE_x-
  9780. * Purpose:
  9781. * Each PN information element contains the sequence number of the MPDU that
  9782. * has failed the target PN check.
  9783. * Value:
  9784. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9785. * that failed the PN check.
  9786. */
  9787. /* first DWORD */
  9788. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9789. #define HTT_RX_PN_IND_PEER_ID_S 8
  9790. #define HTT_RX_PN_IND_TID_M 0xff000000
  9791. #define HTT_RX_PN_IND_TID_S 24
  9792. /* second DWORD */
  9793. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9794. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9795. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9796. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9797. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9798. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9799. #define HTT_RX_PN_IND_BYTES 8
  9800. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9801. do { \
  9802. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9803. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9804. } while (0)
  9805. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9806. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9807. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9808. do { \
  9809. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9810. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9811. } while (0)
  9812. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9813. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9814. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9815. do { \
  9816. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9817. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9818. } while (0)
  9819. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9820. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9821. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9822. do { \
  9823. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9824. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9825. } while (0)
  9826. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9827. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9828. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9829. do { \
  9830. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9831. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9832. } while (0)
  9833. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9834. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9835. /*
  9836. * @brief target -> host rx offload deliver message for LL system
  9837. *
  9838. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9839. *
  9840. * @details
  9841. * In a low latency system this message is sent whenever the offload
  9842. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9843. * The DMA of the actual packets into host memory is done before sending out
  9844. * this message. This message indicates only how many MSDUs to reap. The
  9845. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9846. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9847. * DMA'd by the MAC directly into host memory these packets do not contain
  9848. * the MAC descriptors in the header portion of the packet. Instead they contain
  9849. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9850. * message, the packets are delivered directly to the NW stack without going
  9851. * through the regular reorder buffering and PN checking path since it has
  9852. * already been done in target.
  9853. *
  9854. * |31 24|23 16|15 8|7 0|
  9855. * |-----------------------------------------------------------------------|
  9856. * | Total MSDU count | reserved | msg type |
  9857. * |-----------------------------------------------------------------------|
  9858. *
  9859. * @brief target -> host rx offload deliver message for HL system
  9860. *
  9861. * @details
  9862. * In a high latency system this message is sent whenever the offload manager
  9863. * flushes out the packets it has coalesced in its coalescing buffer. The
  9864. * actual packets are also carried along with this message. When the host
  9865. * receives this message, it is expected to deliver these packets to the NW
  9866. * stack directly instead of routing them through the reorder buffering and
  9867. * PN checking path since it has already been done in target.
  9868. *
  9869. * |31 24|23 16|15 8|7 0|
  9870. * |-----------------------------------------------------------------------|
  9871. * | Total MSDU count | reserved | msg type |
  9872. * |-----------------------------------------------------------------------|
  9873. * | peer ID | MSDU length |
  9874. * |-----------------------------------------------------------------------|
  9875. * | MSDU payload | FW Desc | tid | vdev ID |
  9876. * |-----------------------------------------------------------------------|
  9877. * | MSDU payload contd. |
  9878. * |-----------------------------------------------------------------------|
  9879. * | peer ID | MSDU length |
  9880. * |-----------------------------------------------------------------------|
  9881. * | MSDU payload | FW Desc | tid | vdev ID |
  9882. * |-----------------------------------------------------------------------|
  9883. * | MSDU payload contd. |
  9884. * |-----------------------------------------------------------------------|
  9885. *
  9886. */
  9887. /* first DWORD */
  9888. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9889. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9890. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9891. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9892. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9893. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9894. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9896. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9897. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9898. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9899. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9900. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9901. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9902. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9903. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9904. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9905. do { \
  9906. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9907. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9908. } while (0)
  9909. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9910. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9911. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9912. do { \
  9913. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9914. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9915. } while (0)
  9916. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9917. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9918. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9919. do { \
  9920. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9921. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9922. } while (0)
  9923. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9924. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9925. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9926. do { \
  9927. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9928. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9929. } while (0)
  9930. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9931. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9932. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9933. do { \
  9934. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9935. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9936. } while (0)
  9937. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9938. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9939. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9942. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9943. } while (0)
  9944. /**
  9945. * @brief target -> host rx peer map/unmap message definition
  9946. *
  9947. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9948. *
  9949. * @details
  9950. * The following diagram shows the format of the rx peer map message sent
  9951. * from the target to the host. This layout assumes the target operates
  9952. * as little-endian.
  9953. *
  9954. * This message always contains a SW peer ID. The main purpose of the
  9955. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9956. * with, so that the host can use that peer ID to determine which peer
  9957. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9958. * other purposes, such as identifying during tx completions which peer
  9959. * the tx frames in question were transmitted to.
  9960. *
  9961. * In certain generations of chips, the peer map message also contains
  9962. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9963. * to identify which peer the frame needs to be forwarded to (i.e. the
  9964. * peer assocated with the Destination MAC Address within the packet),
  9965. * and particularly which vdev needs to transmit the frame (for cases
  9966. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9967. * meaning as AST_INDEX_0.
  9968. * This DA-based peer ID that is provided for certain rx frames
  9969. * (the rx frames that need to be re-transmitted as tx frames)
  9970. * is the ID that the HW uses for referring to the peer in question,
  9971. * rather than the peer ID that the SW+FW use to refer to the peer.
  9972. *
  9973. *
  9974. * |31 24|23 16|15 8|7 0|
  9975. * |-----------------------------------------------------------------------|
  9976. * | SW peer ID | VDEV ID | msg type |
  9977. * |-----------------------------------------------------------------------|
  9978. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9979. * |-----------------------------------------------------------------------|
  9980. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9981. * |-----------------------------------------------------------------------|
  9982. *
  9983. *
  9984. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9985. *
  9986. * The following diagram shows the format of the rx peer unmap message sent
  9987. * from the target to the host.
  9988. *
  9989. * |31 24|23 16|15 8|7 0|
  9990. * |-----------------------------------------------------------------------|
  9991. * | SW peer ID | VDEV ID | msg type |
  9992. * |-----------------------------------------------------------------------|
  9993. *
  9994. * The following field definitions describe the format of the rx peer map
  9995. * and peer unmap messages sent from the target to the host.
  9996. * - MSG_TYPE
  9997. * Bits 7:0
  9998. * Purpose: identifies this as an rx peer map or peer unmap message
  9999. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10000. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10001. * - VDEV_ID
  10002. * Bits 15:8
  10003. * Purpose: Indicates which virtual device the peer is associated
  10004. * with.
  10005. * Value: vdev ID (used in the host to look up the vdev object)
  10006. * - PEER_ID (a.k.a. SW_PEER_ID)
  10007. * Bits 31:16
  10008. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10009. * freeing (unmap)
  10010. * Value: (rx) peer ID
  10011. * - MAC_ADDR_L32 (peer map only)
  10012. * Bits 31:0
  10013. * Purpose: Identifies which peer node the peer ID is for.
  10014. * Value: lower 4 bytes of peer node's MAC address
  10015. * - MAC_ADDR_U16 (peer map only)
  10016. * Bits 15:0
  10017. * Purpose: Identifies which peer node the peer ID is for.
  10018. * Value: upper 2 bytes of peer node's MAC address
  10019. * - HW_PEER_ID
  10020. * Bits 31:16
  10021. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10022. * address, so for rx frames marked for rx --> tx forwarding, the
  10023. * host can determine from the HW peer ID provided as meta-data with
  10024. * the rx frame which peer the frame is supposed to be forwarded to.
  10025. * Value: ID used by the MAC HW to identify the peer
  10026. */
  10027. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10028. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10029. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10030. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10031. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10032. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10033. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10034. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10035. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10036. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10037. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10038. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10039. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10040. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10041. do { \
  10042. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10043. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10044. } while (0)
  10045. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10046. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10047. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10048. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10049. do { \
  10050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10051. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10052. } while (0)
  10053. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10054. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10055. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10056. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10057. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10058. do { \
  10059. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10060. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10061. } while (0)
  10062. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10063. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10064. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10065. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10066. #define HTT_RX_PEER_MAP_BYTES 12
  10067. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10068. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10069. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10070. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10071. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10072. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10073. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10074. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10075. #define HTT_RX_PEER_UNMAP_BYTES 4
  10076. /**
  10077. * @brief target -> host rx peer map V2 message definition
  10078. *
  10079. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10080. *
  10081. * @details
  10082. * The following diagram shows the format of the rx peer map v2 message sent
  10083. * from the target to the host. This layout assumes the target operates
  10084. * as little-endian.
  10085. *
  10086. * This message always contains a SW peer ID. The main purpose of the
  10087. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10088. * with, so that the host can use that peer ID to determine which peer
  10089. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10090. * other purposes, such as identifying during tx completions which peer
  10091. * the tx frames in question were transmitted to.
  10092. *
  10093. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10094. * is used during rx --> tx frame forwarding to identify which peer the
  10095. * frame needs to be forwarded to (i.e. the peer assocated with the
  10096. * Destination MAC Address within the packet), and particularly which vdev
  10097. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10098. * This DA-based peer ID that is provided for certain rx frames
  10099. * (the rx frames that need to be re-transmitted as tx frames)
  10100. * is the ID that the HW uses for referring to the peer in question,
  10101. * rather than the peer ID that the SW+FW use to refer to the peer.
  10102. *
  10103. * The HW peer id here is the same meaning as AST_INDEX_0.
  10104. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10105. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10106. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10107. * AST is valid.
  10108. *
  10109. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10110. * |-------------------------------------------------------------------------|
  10111. * | SW peer ID | VDEV ID | msg type |
  10112. * |-------------------------------------------------------------------------|
  10113. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10114. * |-------------------------------------------------------------------------|
  10115. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10116. * |-------------------------------------------------------------------------|
  10117. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10118. * |-------------------------------------------------------------------------|
  10119. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10120. * |-------------------------------------------------------------------------|
  10121. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10122. * |-------------------------------------------------------------------------|
  10123. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10124. * |-------------------------------------------------------------------------|
  10125. * | Reserved_2 |
  10126. * |-------------------------------------------------------------------------|
  10127. * Where:
  10128. * NH = Next Hop
  10129. * ASTVM = AST valid mask
  10130. * OA = on-chip AST valid bit
  10131. * ASTFM = AST flow mask
  10132. *
  10133. * The following field definitions describe the format of the rx peer map v2
  10134. * messages sent from the target to the host.
  10135. * - MSG_TYPE
  10136. * Bits 7:0
  10137. * Purpose: identifies this as an rx peer map v2 message
  10138. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10139. * - VDEV_ID
  10140. * Bits 15:8
  10141. * Purpose: Indicates which virtual device the peer is associated with.
  10142. * Value: vdev ID (used in the host to look up the vdev object)
  10143. * - SW_PEER_ID
  10144. * Bits 31:16
  10145. * Purpose: The peer ID (index) that WAL is allocating
  10146. * Value: (rx) peer ID
  10147. * - MAC_ADDR_L32
  10148. * Bits 31:0
  10149. * Purpose: Identifies which peer node the peer ID is for.
  10150. * Value: lower 4 bytes of peer node's MAC address
  10151. * - MAC_ADDR_U16
  10152. * Bits 15:0
  10153. * Purpose: Identifies which peer node the peer ID is for.
  10154. * Value: upper 2 bytes of peer node's MAC address
  10155. * - HW_PEER_ID / AST_INDEX_0
  10156. * Bits 31:16
  10157. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10158. * address, so for rx frames marked for rx --> tx forwarding, the
  10159. * host can determine from the HW peer ID provided as meta-data with
  10160. * the rx frame which peer the frame is supposed to be forwarded to.
  10161. * Value: ID used by the MAC HW to identify the peer
  10162. * - AST_HASH_VALUE
  10163. * Bits 15:0
  10164. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10165. * override feature.
  10166. * - NEXT_HOP
  10167. * Bit 16
  10168. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10169. * (Wireless Distribution System).
  10170. * - AST_VALID_MASK
  10171. * Bits 19:17
  10172. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10173. * - ONCHIP_AST_VALID_FLAG
  10174. * Bit 20
  10175. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10176. * is valid.
  10177. * - AST_INDEX_1
  10178. * Bits 15:0
  10179. * Purpose: indicate the second AST index for this peer
  10180. * - AST_0_FLOW_MASK
  10181. * Bits 19:16
  10182. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10183. * - AST_1_FLOW_MASK
  10184. * Bits 23:20
  10185. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10186. * - AST_2_FLOW_MASK
  10187. * Bits 27:24
  10188. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10189. * - AST_3_FLOW_MASK
  10190. * Bits 31:28
  10191. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10192. * - AST_INDEX_2
  10193. * Bits 15:0
  10194. * Purpose: indicate the third AST index for this peer
  10195. * - TID_VALID_HI_PRI
  10196. * Bits 23:16
  10197. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10198. * - TID_VALID_LOW_PRI
  10199. * Bits 31:24
  10200. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10201. * - AST_INDEX_3
  10202. * Bits 15:0
  10203. * Purpose: indicate the fourth AST index for this peer
  10204. * - ONCHIP_AST_IDX / RESERVED
  10205. * Bits 31:16
  10206. * Purpose: This field is valid only when split AST feature is enabled.
  10207. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10208. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10209. * address, this ast_idx is used for LMAC modules for RXPCU.
  10210. * Value: ID used by the LMAC HW to identify the peer
  10211. */
  10212. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10213. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10214. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10215. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10216. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10217. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10218. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10219. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10220. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10221. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10222. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10223. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10224. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10225. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10226. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10227. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10228. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10229. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10230. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10231. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10232. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10233. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10234. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10235. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10236. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10237. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10238. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10239. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10240. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10241. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10242. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10243. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10244. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10245. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10246. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10247. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10248. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10249. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10250. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10251. do { \
  10252. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10253. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10254. } while (0)
  10255. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10256. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10257. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10258. do { \
  10259. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10260. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10261. } while (0)
  10262. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10263. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10264. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10265. do { \
  10266. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10267. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10268. } while (0)
  10269. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10270. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10271. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10272. do { \
  10273. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10274. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10275. } while (0)
  10276. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10277. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10278. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10279. do { \
  10280. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10281. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10282. } while (0)
  10283. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10284. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10285. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10286. do { \
  10287. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10288. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10289. } while (0)
  10290. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10291. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10292. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10293. do { \
  10294. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10295. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10296. } while (0)
  10297. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10298. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10299. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10300. do { \
  10301. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10302. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10303. } while (0)
  10304. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10305. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10306. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10307. do { \
  10308. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10309. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10310. } while (0)
  10311. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10312. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10313. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10314. do { \
  10315. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10316. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10317. } while (0)
  10318. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10319. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10320. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10321. do { \
  10322. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10323. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10324. } while (0)
  10325. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10326. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10327. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10328. do { \
  10329. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10330. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10331. } while (0)
  10332. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10333. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10334. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10335. do { \
  10336. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10337. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10338. } while (0)
  10339. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10340. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10341. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10342. do { \
  10343. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10344. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10345. } while (0)
  10346. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10347. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10348. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10349. do { \
  10350. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10351. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10352. } while (0)
  10353. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10354. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10355. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10356. do { \
  10357. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10358. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10359. } while (0)
  10360. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10361. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10362. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10363. do { \
  10364. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10365. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10366. } while (0)
  10367. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10368. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10369. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10370. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10371. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10372. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10373. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10374. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10375. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10376. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10377. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10378. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10379. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10380. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10381. /**
  10382. * @brief target -> host rx peer map V3 message definition
  10383. *
  10384. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10385. *
  10386. * @details
  10387. * The following diagram shows the format of the rx peer map v3 message sent
  10388. * from the target to the host.
  10389. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10390. * This layout assumes the target operates as little-endian.
  10391. *
  10392. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10393. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10394. * | SW peer ID | VDEV ID | msg type |
  10395. * |-----------------+--------------------+-----------------+-----------------|
  10396. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10397. * |-----------------+--------------------+-----------------+-----------------|
  10398. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10399. * |-----------------+--------+-----------+-----------------+-----------------|
  10400. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10401. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10402. * | (8bits) | | (4bits) | |
  10403. * |-----------------+--------+--+--+--+--------------------------------------|
  10404. * | RESERVED |E |O | | |
  10405. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10406. * | |V |V | | |
  10407. * |-----------------+--------------------+-----------------------------------|
  10408. * | HTT_MSDU_IDX_ | RESERVED | |
  10409. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10410. * | (8bits) | | |
  10411. * |-----------------+--------------------+-----------------------------------|
  10412. * | Reserved_2 |
  10413. * |--------------------------------------------------------------------------|
  10414. * | Reserved_3 |
  10415. * |--------------------------------------------------------------------------|
  10416. *
  10417. * Where:
  10418. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10419. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10420. * NH = Next Hop
  10421. * The following field definitions describe the format of the rx peer map v3
  10422. * messages sent from the target to the host.
  10423. * - MSG_TYPE
  10424. * Bits 7:0
  10425. * Purpose: identifies this as a peer map v3 message
  10426. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10427. * - VDEV_ID
  10428. * Bits 15:8
  10429. * Purpose: Indicates which virtual device the peer is associated with.
  10430. * - SW_PEER_ID
  10431. * Bits 31:16
  10432. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10433. * - MAC_ADDR_L32
  10434. * Bits 31:0
  10435. * Purpose: Identifies which peer node the peer ID is for.
  10436. * Value: lower 4 bytes of peer node's MAC address
  10437. * - MAC_ADDR_U16
  10438. * Bits 15:0
  10439. * Purpose: Identifies which peer node the peer ID is for.
  10440. * Value: upper 2 bytes of peer node's MAC address
  10441. * - MULTICAST_SW_PEER_ID
  10442. * Bits 31:16
  10443. * Purpose: The multicast peer ID (index)
  10444. * Value: set to HTT_INVALID_PEER if not valid
  10445. * - HW_PEER_ID / AST_INDEX
  10446. * Bits 15:0
  10447. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10448. * address, so for rx frames marked for rx --> tx forwarding, the
  10449. * host can determine from the HW peer ID provided as meta-data with
  10450. * the rx frame which peer the frame is supposed to be forwarded to.
  10451. * - CACHE_SET_NUM
  10452. * Bits 19:16
  10453. * Purpose: Cache Set Number for AST_INDEX
  10454. * Cache set number that should be used to cache the index based
  10455. * search results, for address and flow search.
  10456. * This value should be equal to LSB 4 bits of the hash value
  10457. * of match data, in case of search index points to an entry which
  10458. * may be used in content based search also. The value can be
  10459. * anything when the entry pointed by search index will not be
  10460. * used for content based search.
  10461. * - HTT_MSDU_IDX_VALID_MASK
  10462. * Bits 31:24
  10463. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10464. * - ONCHIP_AST_IDX / RESERVED
  10465. * Bits 15:0
  10466. * Purpose: This field is valid only when split AST feature is enabled.
  10467. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10468. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10469. * address, this ast_idx is used for LMAC modules for RXPCU.
  10470. * - NEXT_HOP
  10471. * Bits 16
  10472. * Purpose: Flag indicates next_hop AST entry used for WDS
  10473. * (Wireless Distribution System).
  10474. * - ONCHIP_AST_VALID
  10475. * Bits 17
  10476. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10477. * - EXT_AST_VALID
  10478. * Bits 18
  10479. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10480. * - EXT_AST_INDEX
  10481. * Bits 15:0
  10482. * Purpose: This field describes Extended AST index
  10483. * Valid if EXT_AST_VALID flag set
  10484. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10485. * Bits 31:24
  10486. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10487. */
  10488. /* dword 0 */
  10489. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10490. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10491. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10492. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10493. /* dword 1 */
  10494. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10495. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10496. /* dword 2 */
  10497. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10498. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10499. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10500. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10501. /* dword 3 */
  10502. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10503. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10504. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10505. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10506. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10507. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10508. /* dword 4 */
  10509. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10510. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10511. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10512. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10513. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10514. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10515. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10516. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10517. /* dword 5 */
  10518. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10519. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10520. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10521. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10522. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10523. do { \
  10524. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10525. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10526. } while (0)
  10527. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10528. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10529. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10530. do { \
  10531. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10532. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10533. } while (0)
  10534. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10535. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10536. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10537. do { \
  10538. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10539. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10540. } while (0)
  10541. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10542. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10543. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10544. do { \
  10545. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10546. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10547. } while (0)
  10548. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10549. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10550. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10551. do { \
  10552. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10553. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10554. } while (0)
  10555. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10556. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10557. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10558. do { \
  10559. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10560. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10561. } while (0)
  10562. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10563. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10564. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10565. do { \
  10566. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10567. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10568. } while (0)
  10569. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10570. (((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)
  10571. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10572. do { \
  10573. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10574. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10575. } while (0)
  10576. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10577. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10578. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10579. do { \
  10580. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10581. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10582. } while (0)
  10583. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10584. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10585. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10588. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10589. } while (0)
  10590. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10591. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10592. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10595. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10596. } while (0)
  10597. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10598. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10599. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10600. do { \
  10601. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10602. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10603. } while (0)
  10604. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10605. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10606. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10607. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10608. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10609. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10610. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10611. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10612. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10613. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10614. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10615. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10616. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10617. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10618. /**
  10619. * @brief target -> host rx peer unmap V2 message definition
  10620. *
  10621. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10622. *
  10623. * The following diagram shows the format of the rx peer unmap message sent
  10624. * from the target to the host.
  10625. *
  10626. * |31 24|23 16|15 8|7 0|
  10627. * |-----------------------------------------------------------------------|
  10628. * | SW peer ID | VDEV ID | msg type |
  10629. * |-----------------------------------------------------------------------|
  10630. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10631. * |-----------------------------------------------------------------------|
  10632. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10633. * |-----------------------------------------------------------------------|
  10634. * | Peer Delete Duration |
  10635. * |-----------------------------------------------------------------------|
  10636. * | Reserved_0 | WDS Free Count |
  10637. * |-----------------------------------------------------------------------|
  10638. * | Reserved_1 |
  10639. * |-----------------------------------------------------------------------|
  10640. * | Reserved_2 |
  10641. * |-----------------------------------------------------------------------|
  10642. *
  10643. *
  10644. * The following field definitions describe the format of the rx peer unmap
  10645. * messages sent from the target to the host.
  10646. * - MSG_TYPE
  10647. * Bits 7:0
  10648. * Purpose: identifies this as an rx peer unmap v2 message
  10649. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10650. * - VDEV_ID
  10651. * Bits 15:8
  10652. * Purpose: Indicates which virtual device the peer is associated
  10653. * with.
  10654. * Value: vdev ID (used in the host to look up the vdev object)
  10655. * - SW_PEER_ID
  10656. * Bits 31:16
  10657. * Purpose: The peer ID (index) that WAL is freeing
  10658. * Value: (rx) peer ID
  10659. * - MAC_ADDR_L32
  10660. * Bits 31:0
  10661. * Purpose: Identifies which peer node the peer ID is for.
  10662. * Value: lower 4 bytes of peer node's MAC address
  10663. * - MAC_ADDR_U16
  10664. * Bits 15:0
  10665. * Purpose: Identifies which peer node the peer ID is for.
  10666. * Value: upper 2 bytes of peer node's MAC address
  10667. * - NEXT_HOP
  10668. * Bits 16
  10669. * Purpose: Bit indicates next_hop AST entry used for WDS
  10670. * (Wireless Distribution System).
  10671. * - PEER_DELETE_DURATION
  10672. * Bits 31:0
  10673. * Purpose: Time taken to delete peer, in msec,
  10674. * Used for monitoring / debugging PEER delete response delay
  10675. * - PEER_WDS_FREE_COUNT
  10676. * Bits 15:0
  10677. * Purpose: Count of WDS entries deleted associated to peer deleted
  10678. */
  10679. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10680. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10681. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10682. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10683. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10684. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10685. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10686. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10687. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10688. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10689. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10690. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10691. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10692. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10693. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10694. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10695. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10696. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10697. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10698. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10699. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10700. do { \
  10701. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10702. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10703. } while (0)
  10704. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10705. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10706. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10707. do { \
  10708. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10709. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10710. } while (0)
  10711. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10712. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10713. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10714. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10715. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10716. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10717. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10718. /**
  10719. * @brief target -> host rx peer mlo map message definition
  10720. *
  10721. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10722. *
  10723. * @details
  10724. * The following diagram shows the format of the rx mlo peer map message sent
  10725. * from the target to the host. This layout assumes the target operates
  10726. * as little-endian.
  10727. *
  10728. * MCC:
  10729. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10730. *
  10731. * WIN:
  10732. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10733. * It will be sent on the Assoc Link.
  10734. *
  10735. * This message always contains a MLO peer ID. The main purpose of the
  10736. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10737. * with, so that the host can use that MLO peer ID to determine which peer
  10738. * transmitted the rx frame.
  10739. *
  10740. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10741. * |-------------------------------------------------------------------------|
  10742. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10743. * |-------------------------------------------------------------------------|
  10744. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10745. * |-------------------------------------------------------------------------|
  10746. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10747. * |-------------------------------------------------------------------------|
  10748. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10749. * |-------------------------------------------------------------------------|
  10750. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10751. * |-------------------------------------------------------------------------|
  10752. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10753. * |-------------------------------------------------------------------------|
  10754. * |RSVD |
  10755. * |-------------------------------------------------------------------------|
  10756. * |RSVD |
  10757. * |-------------------------------------------------------------------------|
  10758. * | htt_tlv_hdr_t |
  10759. * |-------------------------------------------------------------------------|
  10760. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10761. * |-------------------------------------------------------------------------|
  10762. * | htt_tlv_hdr_t |
  10763. * |-------------------------------------------------------------------------|
  10764. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10765. * |-------------------------------------------------------------------------|
  10766. * | htt_tlv_hdr_t |
  10767. * |-------------------------------------------------------------------------|
  10768. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10769. * |-------------------------------------------------------------------------|
  10770. *
  10771. * Where:
  10772. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10773. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10774. * V (valid) - 1 Bit Bit17
  10775. * CHIPID - 3 Bits
  10776. * TIDMASK - 8 Bits
  10777. * CACHE_SET_NUM - 8 Bits
  10778. *
  10779. * The following field definitions describe the format of the rx MLO peer map
  10780. * messages sent from the target to the host.
  10781. * - MSG_TYPE
  10782. * Bits 7:0
  10783. * Purpose: identifies this as an rx mlo peer map message
  10784. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10785. *
  10786. * - MLO_PEER_ID
  10787. * Bits 23:8
  10788. * Purpose: The MLO peer ID (index).
  10789. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10790. * Value: MLO peer ID
  10791. *
  10792. * - NUMLINK
  10793. * Bits: 26:24 (3Bits)
  10794. * Purpose: Indicate the max number of logical links supported per client.
  10795. * Value: number of logical links
  10796. *
  10797. * - PRC
  10798. * Bits: 29:27 (3Bits)
  10799. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10800. * if there is migration of the primary chip.
  10801. * Value: Primary REO CHIPID
  10802. *
  10803. * - MAC_ADDR_L32
  10804. * Bits 31:0
  10805. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10806. * Value: lower 4 bytes of peer node's MAC address
  10807. *
  10808. * - MAC_ADDR_U16
  10809. * Bits 15:0
  10810. * Purpose: Identifies which peer node the peer ID is for.
  10811. * Value: upper 2 bytes of peer node's MAC address
  10812. *
  10813. * - PRIMARY_TCL_AST_IDX
  10814. * Bits 15:0
  10815. * Purpose: Primary TCL AST index for this peer.
  10816. *
  10817. * - V
  10818. * 1 Bit Position 16
  10819. * Purpose: If the ast idx is valid.
  10820. *
  10821. * - CHIPID
  10822. * Bits 19:17
  10823. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10824. *
  10825. * - TIDMASK
  10826. * Bits 27:20
  10827. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10828. *
  10829. * - CACHE_SET_NUM
  10830. * Bits 31:28
  10831. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10832. * Cache set number that should be used to cache the index based
  10833. * search results, for address and flow search.
  10834. * This value should be equal to LSB four bits of the hash value
  10835. * of match data, in case of search index points to an entry which
  10836. * may be used in content based search also. The value can be
  10837. * anything when the entry pointed by search index will not be
  10838. * used for content based search.
  10839. *
  10840. * - htt_tlv_hdr_t
  10841. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10842. *
  10843. * Bits 11:0
  10844. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10845. *
  10846. * Bits 23:12
  10847. * Purpose: Length, Length of the value that follows the header
  10848. *
  10849. * Bits 31:28
  10850. * Purpose: Reserved.
  10851. *
  10852. *
  10853. * - SW_PEER_ID
  10854. * Bits 15:0
  10855. * Purpose: The peer ID (index) that WAL is allocating
  10856. * Value: (rx) peer ID
  10857. *
  10858. * - VDEV_ID
  10859. * Bits 23:16
  10860. * Purpose: Indicates which virtual device the peer is associated with.
  10861. * Value: vdev ID (used in the host to look up the vdev object)
  10862. *
  10863. * - CHIPID
  10864. * Bits 26:24
  10865. * Purpose: Indicates which Chip id the peer is associated with.
  10866. * Value: chip ID (Provided by Host as part of QMI exchange)
  10867. */
  10868. typedef enum {
  10869. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10870. } MLO_PEER_MAP_TLV_TAG_ID;
  10871. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10872. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10873. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10874. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10875. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10876. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10877. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10878. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10879. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10880. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10881. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10882. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10883. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10884. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10885. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10886. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10887. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10888. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10889. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10890. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10891. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10892. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10893. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10894. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10895. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10896. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10897. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10898. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10899. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10900. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10901. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10902. do { \
  10903. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10904. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10905. } while (0)
  10906. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10907. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10908. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10909. do { \
  10910. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10911. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10912. } while (0)
  10913. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10914. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10915. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10916. do { \
  10917. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10918. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10919. } while (0)
  10920. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10921. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10922. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10923. do { \
  10924. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10925. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10926. } while (0)
  10927. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10928. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10929. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10930. do { \
  10931. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10932. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10933. } while (0)
  10934. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10935. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10936. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10937. do { \
  10938. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10939. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10940. } while (0)
  10941. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10942. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10943. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10944. do { \
  10945. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10946. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10947. } while (0)
  10948. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10949. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10950. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10951. do { \
  10952. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10953. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10954. } while (0)
  10955. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10956. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10957. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10958. do { \
  10959. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10960. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10961. } while (0)
  10962. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10963. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10964. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10965. do { \
  10966. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10967. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10968. } while (0)
  10969. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10970. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10971. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10972. do { \
  10973. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10974. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10975. } while (0)
  10976. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10977. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10978. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10979. do { \
  10980. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10981. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10982. } while (0)
  10983. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10984. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10985. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10986. do { \
  10987. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10988. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10989. } while (0)
  10990. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10991. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10992. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10993. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10994. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10995. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10996. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10997. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10998. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10999. *
  11000. * The following diagram shows the format of the rx mlo peer unmap message sent
  11001. * from the target to the host.
  11002. *
  11003. * |31 24|23 16|15 8|7 0|
  11004. * |-----------------------------------------------------------------------|
  11005. * | RSVD_24_31 | MLO peer ID | msg type |
  11006. * |-----------------------------------------------------------------------|
  11007. */
  11008. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11009. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11010. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11011. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11012. /**
  11013. * @brief target -> host message specifying security parameters
  11014. *
  11015. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11016. *
  11017. * @details
  11018. * The following diagram shows the format of the security specification
  11019. * message sent from the target to the host.
  11020. * This security specification message tells the host whether a PN check is
  11021. * necessary on rx data frames, and if so, how large the PN counter is.
  11022. * This message also tells the host about the security processing to apply
  11023. * to defragmented rx frames - specifically, whether a Message Integrity
  11024. * Check is required, and the Michael key to use.
  11025. *
  11026. * |31 24|23 16|15|14 8|7 0|
  11027. * |-----------------------------------------------------------------------|
  11028. * | peer ID | U| security type | msg type |
  11029. * |-----------------------------------------------------------------------|
  11030. * | Michael Key K0 |
  11031. * |-----------------------------------------------------------------------|
  11032. * | Michael Key K1 |
  11033. * |-----------------------------------------------------------------------|
  11034. * | WAPI RSC Low0 |
  11035. * |-----------------------------------------------------------------------|
  11036. * | WAPI RSC Low1 |
  11037. * |-----------------------------------------------------------------------|
  11038. * | WAPI RSC Hi0 |
  11039. * |-----------------------------------------------------------------------|
  11040. * | WAPI RSC Hi1 |
  11041. * |-----------------------------------------------------------------------|
  11042. *
  11043. * The following field definitions describe the format of the security
  11044. * indication message sent from the target to the host.
  11045. * - MSG_TYPE
  11046. * Bits 7:0
  11047. * Purpose: identifies this as a security specification message
  11048. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11049. * - SEC_TYPE
  11050. * Bits 14:8
  11051. * Purpose: specifies which type of security applies to the peer
  11052. * Value: htt_sec_type enum value
  11053. * - UNICAST
  11054. * Bit 15
  11055. * Purpose: whether this security is applied to unicast or multicast data
  11056. * Value: 1 -> unicast, 0 -> multicast
  11057. * - PEER_ID
  11058. * Bits 31:16
  11059. * Purpose: The ID number for the peer the security specification is for
  11060. * Value: peer ID
  11061. * - MICHAEL_KEY_K0
  11062. * Bits 31:0
  11063. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11064. * Value: Michael Key K0 (if security type is TKIP)
  11065. * - MICHAEL_KEY_K1
  11066. * Bits 31:0
  11067. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11068. * Value: Michael Key K1 (if security type is TKIP)
  11069. * - WAPI_RSC_LOW0
  11070. * Bits 31:0
  11071. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11072. * Value: WAPI RSC Low0 (if security type is WAPI)
  11073. * - WAPI_RSC_LOW1
  11074. * Bits 31:0
  11075. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11076. * Value: WAPI RSC Low1 (if security type is WAPI)
  11077. * - WAPI_RSC_HI0
  11078. * Bits 31:0
  11079. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11080. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11081. * - WAPI_RSC_HI1
  11082. * Bits 31:0
  11083. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11084. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11085. */
  11086. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11087. #define HTT_SEC_IND_SEC_TYPE_S 8
  11088. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11089. #define HTT_SEC_IND_UNICAST_S 15
  11090. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11091. #define HTT_SEC_IND_PEER_ID_S 16
  11092. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11093. do { \
  11094. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11095. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11096. } while (0)
  11097. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11098. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11099. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11100. do { \
  11101. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11102. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11103. } while (0)
  11104. #define HTT_SEC_IND_UNICAST_GET(word) \
  11105. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11106. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11107. do { \
  11108. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11109. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11110. } while (0)
  11111. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11112. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11113. #define HTT_SEC_IND_BYTES 28
  11114. /**
  11115. * @brief target -> host rx ADDBA / DELBA message definitions
  11116. *
  11117. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11118. *
  11119. * @details
  11120. * The following diagram shows the format of the rx ADDBA message sent
  11121. * from the target to the host:
  11122. *
  11123. * |31 20|19 16|15 8|7 0|
  11124. * |---------------------------------------------------------------------|
  11125. * | peer ID | TID | window size | msg type |
  11126. * |---------------------------------------------------------------------|
  11127. *
  11128. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11129. *
  11130. * The following diagram shows the format of the rx DELBA message sent
  11131. * from the target to the host:
  11132. *
  11133. * |31 20|19 16|15 10|9 8|7 0|
  11134. * |---------------------------------------------------------------------|
  11135. * | peer ID | TID | window size | IR| msg type |
  11136. * |---------------------------------------------------------------------|
  11137. *
  11138. * The following field definitions describe the format of the rx ADDBA
  11139. * and DELBA messages sent from the target to the host.
  11140. * - MSG_TYPE
  11141. * Bits 7:0
  11142. * Purpose: identifies this as an rx ADDBA or DELBA message
  11143. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11144. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11145. * - IR (initiator / recipient)
  11146. * Bits 9:8 (DELBA only)
  11147. * Purpose: specify whether the DELBA handshake was initiated by the
  11148. * local STA/AP, or by the peer STA/AP
  11149. * Value:
  11150. * 0 - unspecified
  11151. * 1 - initiator (a.k.a. originator)
  11152. * 2 - recipient (a.k.a. responder)
  11153. * 3 - unused / reserved
  11154. * - WIN_SIZE
  11155. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11156. * Purpose: Specifies the length of the block ack window (max = 64).
  11157. * Value:
  11158. * block ack window length specified by the received ADDBA/DELBA
  11159. * management message.
  11160. * - TID
  11161. * Bits 19:16
  11162. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11163. * Value:
  11164. * TID specified by the received ADDBA or DELBA management message.
  11165. * - PEER_ID
  11166. * Bits 31:20
  11167. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11168. * Value:
  11169. * ID (hash value) used by the host for fast, direct lookup of
  11170. * host SW peer info, including rx reorder states.
  11171. */
  11172. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11173. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11174. #define HTT_RX_ADDBA_TID_M 0xf0000
  11175. #define HTT_RX_ADDBA_TID_S 16
  11176. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11177. #define HTT_RX_ADDBA_PEER_ID_S 20
  11178. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11179. do { \
  11180. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11181. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11182. } while (0)
  11183. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11184. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11185. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11186. do { \
  11187. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11188. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11189. } while (0)
  11190. #define HTT_RX_ADDBA_TID_GET(word) \
  11191. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11192. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11193. do { \
  11194. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11195. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11196. } while (0)
  11197. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11198. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11199. #define HTT_RX_ADDBA_BYTES 4
  11200. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11201. #define HTT_RX_DELBA_INITIATOR_S 8
  11202. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11203. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11204. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11205. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11206. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11207. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11208. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11209. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11210. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11211. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11212. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11213. do { \
  11214. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11215. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11216. } while (0)
  11217. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11218. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11219. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11220. do { \
  11221. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11222. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11223. } while (0)
  11224. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11225. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11226. #define HTT_RX_DELBA_BYTES 4
  11227. /**
  11228. * @brief tx queue group information element definition
  11229. *
  11230. * @details
  11231. * The following diagram shows the format of the tx queue group
  11232. * information element, which can be included in target --> host
  11233. * messages to specify the number of tx "credits" (tx descriptors
  11234. * for LL, or tx buffers for HL) available to a particular group
  11235. * of host-side tx queues, and which host-side tx queues belong to
  11236. * the group.
  11237. *
  11238. * |31|30 24|23 16|15|14|13 0|
  11239. * |------------------------------------------------------------------------|
  11240. * | X| reserved | tx queue grp ID | A| S| credit count |
  11241. * |------------------------------------------------------------------------|
  11242. * | vdev ID mask | AC mask |
  11243. * |------------------------------------------------------------------------|
  11244. *
  11245. * The following definitions describe the fields within the tx queue group
  11246. * information element:
  11247. * - credit_count
  11248. * Bits 13:1
  11249. * Purpose: specify how many tx credits are available to the tx queue group
  11250. * Value: An absolute or relative, positive or negative credit value
  11251. * The 'A' bit specifies whether the value is absolute or relative.
  11252. * The 'S' bit specifies whether the value is positive or negative.
  11253. * A negative value can only be relative, not absolute.
  11254. * An absolute value replaces any prior credit value the host has for
  11255. * the tx queue group in question.
  11256. * A relative value is added to the prior credit value the host has for
  11257. * the tx queue group in question.
  11258. * - sign
  11259. * Bit 14
  11260. * Purpose: specify whether the credit count is positive or negative
  11261. * Value: 0 -> positive, 1 -> negative
  11262. * - absolute
  11263. * Bit 15
  11264. * Purpose: specify whether the credit count is absolute or relative
  11265. * Value: 0 -> relative, 1 -> absolute
  11266. * - txq_group_id
  11267. * Bits 23:16
  11268. * Purpose: indicate which tx queue group's credit and/or membership are
  11269. * being specified
  11270. * Value: 0 to max_tx_queue_groups-1
  11271. * - reserved
  11272. * Bits 30:16
  11273. * Value: 0x0
  11274. * - eXtension
  11275. * Bit 31
  11276. * Purpose: specify whether another tx queue group info element follows
  11277. * Value: 0 -> no more tx queue group information elements
  11278. * 1 -> another tx queue group information element immediately follows
  11279. * - ac_mask
  11280. * Bits 15:0
  11281. * Purpose: specify which Access Categories belong to the tx queue group
  11282. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11283. * the tx queue group.
  11284. * The AC bit-mask values are obtained by left-shifting by the
  11285. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11286. * - vdev_id_mask
  11287. * Bits 31:16
  11288. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11289. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11290. * belong to the tx queue group.
  11291. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11292. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11293. */
  11294. PREPACK struct htt_txq_group {
  11295. A_UINT32
  11296. credit_count: 14,
  11297. sign: 1,
  11298. absolute: 1,
  11299. tx_queue_group_id: 8,
  11300. reserved0: 7,
  11301. extension: 1;
  11302. A_UINT32
  11303. ac_mask: 16,
  11304. vdev_id_mask: 16;
  11305. } POSTPACK;
  11306. /* first word */
  11307. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11308. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11309. #define HTT_TXQ_GROUP_SIGN_S 14
  11310. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11311. #define HTT_TXQ_GROUP_ABS_S 15
  11312. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11313. #define HTT_TXQ_GROUP_ID_S 16
  11314. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11315. #define HTT_TXQ_GROUP_EXT_S 31
  11316. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11317. /* second word */
  11318. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11319. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11320. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11321. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11322. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11323. do { \
  11324. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11325. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11326. } while (0)
  11327. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11328. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11329. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11330. do { \
  11331. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11332. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11333. } while (0)
  11334. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11335. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11336. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11337. do { \
  11338. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11339. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11340. } while (0)
  11341. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11342. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11343. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11344. do { \
  11345. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11346. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11347. } while (0)
  11348. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11349. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11350. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11351. do { \
  11352. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11353. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11354. } while (0)
  11355. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11356. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11357. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11358. do { \
  11359. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11360. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11361. } while (0)
  11362. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11363. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11364. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11365. do { \
  11366. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11367. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11368. } while (0)
  11369. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11370. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11371. /**
  11372. * @brief target -> host TX completion indication message definition
  11373. *
  11374. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11375. *
  11376. * @details
  11377. * The following diagram shows the format of the TX completion indication sent
  11378. * from the target to the host
  11379. *
  11380. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11381. * |-------------------------------------------------------------------|
  11382. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11383. * |-------------------------------------------------------------------|
  11384. * payload:| MSDU1 ID | MSDU0 ID |
  11385. * |-------------------------------------------------------------------|
  11386. * : MSDU3 ID | MSDU2 ID :
  11387. * |-------------------------------------------------------------------|
  11388. * | struct htt_tx_compl_ind_append_retries |
  11389. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11390. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11391. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11392. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11393. * |-------------------------------------------------------------------|
  11394. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11395. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11396. * | MSDU0 tx_tsf64_low |
  11397. * |-------------------------------------------------------------------|
  11398. * | MSDU0 tx_tsf64_high |
  11399. * |-------------------------------------------------------------------|
  11400. * | MSDU1 tx_tsf64_low |
  11401. * |-------------------------------------------------------------------|
  11402. * | MSDU1 tx_tsf64_high |
  11403. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11404. * | phy_timestamp |
  11405. * |-------------------------------------------------------------------|
  11406. * | rate specs (see below) |
  11407. * |-------------------------------------------------------------------|
  11408. * | seqctrl | framectrl |
  11409. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11410. * Where:
  11411. * A0 = append (a.k.a. append0)
  11412. * A1 = append1
  11413. * TP = MSDU tx power presence
  11414. * A2 = append2
  11415. * A3 = append3
  11416. * A4 = append4
  11417. *
  11418. * The following field definitions describe the format of the TX completion
  11419. * indication sent from the target to the host
  11420. * Header fields:
  11421. * - msg_type
  11422. * Bits 7:0
  11423. * Purpose: identifies this as HTT TX completion indication
  11424. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11425. * - status
  11426. * Bits 10:8
  11427. * Purpose: the TX completion status of payload fragmentations descriptors
  11428. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11429. * - tid
  11430. * Bits 14:11
  11431. * Purpose: the tid associated with those fragmentation descriptors. It is
  11432. * valid or not, depending on the tid_invalid bit.
  11433. * Value: 0 to 15
  11434. * - tid_invalid
  11435. * Bits 15:15
  11436. * Purpose: this bit indicates whether the tid field is valid or not
  11437. * Value: 0 indicates valid; 1 indicates invalid
  11438. * - num
  11439. * Bits 23:16
  11440. * Purpose: the number of payload in this indication
  11441. * Value: 1 to 255
  11442. * - append (a.k.a. append0)
  11443. * Bits 24:24
  11444. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11445. * the number of tx retries for one MSDU at the end of this message
  11446. * Value: 0 indicates no appending; 1 indicates appending
  11447. * - append1
  11448. * Bits 25:25
  11449. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11450. * contains the timestamp info for each TX msdu id in payload.
  11451. * The order of the timestamps matches the order of the MSDU IDs.
  11452. * Note that a big-endian host needs to account for the reordering
  11453. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11454. * conversion) when determining which tx timestamp corresponds to
  11455. * which MSDU ID.
  11456. * Value: 0 indicates no appending; 1 indicates appending
  11457. * - msdu_tx_power_presence
  11458. * Bits 26:26
  11459. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11460. * for each MSDU referenced by the TX_COMPL_IND message.
  11461. * The tx power is reported in 0.5 dBm units.
  11462. * The order of the per-MSDU tx power reports matches the order
  11463. * of the MSDU IDs.
  11464. * Note that a big-endian host needs to account for the reordering
  11465. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11466. * conversion) when determining which Tx Power corresponds to
  11467. * which MSDU ID.
  11468. * Value: 0 indicates MSDU tx power reports are not appended,
  11469. * 1 indicates MSDU tx power reports are appended
  11470. * - append2
  11471. * Bits 27:27
  11472. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11473. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11474. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11475. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11476. * for each MSDU, for convenience.
  11477. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11478. * this append2 bit is set).
  11479. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11480. * dB above the noise floor.
  11481. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11482. * 1 indicates MSDU ACK RSSI values are appended.
  11483. * - append3
  11484. * Bits 28:28
  11485. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11486. * contains the tx tsf info based on wlan global TSF for
  11487. * each TX msdu id in payload.
  11488. * The order of the tx tsf matches the order of the MSDU IDs.
  11489. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11490. * values to indicate the the lower 32 bits and higher 32 bits of
  11491. * the tx tsf.
  11492. * The tx_tsf64 here represents the time MSDU was acked and the
  11493. * tx_tsf64 has microseconds units.
  11494. * Value: 0 indicates no appending; 1 indicates appending
  11495. * - append4
  11496. * Bits 29:29
  11497. * Purpose: Indicate whether data frame control fields and fields required
  11498. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11499. * message. The order of the this message matches the order of
  11500. * the MSDU IDs.
  11501. * Value: 0 indicates frame control fields and fields required for
  11502. * radio tap header values are not appended,
  11503. * 1 indicates frame control fields and fields required for
  11504. * radio tap header values are appended.
  11505. * Payload fields:
  11506. * - hmsdu_id
  11507. * Bits 15:0
  11508. * Purpose: this ID is used to track the Tx buffer in host
  11509. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11510. */
  11511. PREPACK struct htt_tx_data_hdr_information {
  11512. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11513. A_UINT32 /* word 1 */
  11514. /* preamble:
  11515. * 0-OFDM,
  11516. * 1-CCk,
  11517. * 2-HT,
  11518. * 3-VHT
  11519. */
  11520. preamble: 2, /* [1:0] */
  11521. /* mcs:
  11522. * In case of HT preamble interpret
  11523. * MCS along with NSS.
  11524. * Valid values for HT are 0 to 7.
  11525. * HT mcs 0 with NSS 2 is mcs 8.
  11526. * Valid values for VHT are 0 to 9.
  11527. */
  11528. mcs: 4, /* [5:2] */
  11529. /* rate:
  11530. * This is applicable only for
  11531. * CCK and OFDM preamble type
  11532. * rate 0: OFDM 48 Mbps,
  11533. * 1: OFDM 24 Mbps,
  11534. * 2: OFDM 12 Mbps
  11535. * 3: OFDM 6 Mbps
  11536. * 4: OFDM 54 Mbps
  11537. * 5: OFDM 36 Mbps
  11538. * 6: OFDM 18 Mbps
  11539. * 7: OFDM 9 Mbps
  11540. * rate 0: CCK 11 Mbps Long
  11541. * 1: CCK 5.5 Mbps Long
  11542. * 2: CCK 2 Mbps Long
  11543. * 3: CCK 1 Mbps Long
  11544. * 4: CCK 11 Mbps Short
  11545. * 5: CCK 5.5 Mbps Short
  11546. * 6: CCK 2 Mbps Short
  11547. */
  11548. rate : 3, /* [ 8: 6] */
  11549. rssi : 8, /* [16: 9] units=dBm */
  11550. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11551. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11552. stbc : 1, /* [22] */
  11553. sgi : 1, /* [23] */
  11554. ldpc : 1, /* [24] */
  11555. beamformed: 1, /* [25] */
  11556. /* tx_retry_cnt:
  11557. * Indicates retry count of data tx frames provided by the host.
  11558. */
  11559. tx_retry_cnt: 6; /* [31:26] */
  11560. A_UINT32 /* word 2 */
  11561. framectrl:16, /* [15: 0] */
  11562. seqno:16; /* [31:16] */
  11563. } POSTPACK;
  11564. #define HTT_TX_COMPL_IND_STATUS_S 8
  11565. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11566. #define HTT_TX_COMPL_IND_TID_S 11
  11567. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11568. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11569. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11570. #define HTT_TX_COMPL_IND_NUM_S 16
  11571. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11572. #define HTT_TX_COMPL_IND_APPEND_S 24
  11573. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11574. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11575. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11576. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11577. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11578. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11579. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11580. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11581. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11582. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11583. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11584. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11585. do { \
  11586. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11587. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11588. } while (0)
  11589. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11590. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11591. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11592. do { \
  11593. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11594. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11595. } while (0)
  11596. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11597. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11598. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11599. do { \
  11600. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11601. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11602. } while (0)
  11603. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11604. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11605. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11606. do { \
  11607. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11608. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11609. } while (0)
  11610. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11611. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11612. HTT_TX_COMPL_IND_TID_INV_S)
  11613. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11614. do { \
  11615. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11616. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11617. } while (0)
  11618. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11619. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11620. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11621. do { \
  11622. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11623. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11624. } while (0)
  11625. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11626. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11627. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11628. do { \
  11629. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11630. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11631. } while (0)
  11632. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11633. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11634. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11635. do { \
  11636. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11637. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11638. } while (0)
  11639. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11640. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11641. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11642. do { \
  11643. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11644. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11645. } while (0)
  11646. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11647. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11648. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11649. do { \
  11650. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11651. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11652. } while (0)
  11653. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11654. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11655. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11656. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11657. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11658. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11659. #define HTT_TX_COMPL_IND_STAT_OK 0
  11660. /* DISCARD:
  11661. * current meaning:
  11662. * MSDUs were queued for transmission but filtered by HW or SW
  11663. * without any over the air attempts
  11664. * legacy meaning (HL Rome):
  11665. * MSDUs were discarded by the target FW without any over the air
  11666. * attempts due to lack of space
  11667. */
  11668. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11669. /* NO_ACK:
  11670. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11671. */
  11672. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11673. /* POSTPONE:
  11674. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11675. * be downloaded again later (in the appropriate order), when they are
  11676. * deliverable.
  11677. */
  11678. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11679. /*
  11680. * The PEER_DEL tx completion status is used for HL cases
  11681. * where the peer the frame is for has been deleted.
  11682. * The host has already discarded its copy of the frame, but
  11683. * it still needs the tx completion to restore its credit.
  11684. */
  11685. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11686. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11687. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11688. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11689. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11690. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11691. PREPACK struct htt_tx_compl_ind_base {
  11692. A_UINT32 hdr;
  11693. A_UINT16 payload[1/*or more*/];
  11694. } POSTPACK;
  11695. PREPACK struct htt_tx_compl_ind_append_retries {
  11696. A_UINT16 msdu_id;
  11697. A_UINT8 tx_retries;
  11698. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11699. 0: this is the last append_retries struct */
  11700. } POSTPACK;
  11701. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11702. A_UINT32 timestamp[1/*or more*/];
  11703. } POSTPACK;
  11704. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11705. A_UINT32 tx_tsf64_low;
  11706. A_UINT32 tx_tsf64_high;
  11707. } POSTPACK;
  11708. /* htt_tx_data_hdr_information payload extension fields: */
  11709. /* DWORD zero */
  11710. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11711. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11712. /* DWORD one */
  11713. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11714. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11715. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11716. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11717. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11718. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11719. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11720. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11721. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11722. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11723. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11724. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11725. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11726. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11727. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11728. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11729. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11730. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11731. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11732. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11733. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11734. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11735. /* DWORD two */
  11736. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11737. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11738. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11739. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11740. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11741. do { \
  11742. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11743. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11744. } while (0)
  11745. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11746. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11747. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11748. do { \
  11749. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11750. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11751. } while (0)
  11752. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11753. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11754. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11755. do { \
  11756. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11757. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11758. } while (0)
  11759. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11760. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11761. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11762. do { \
  11763. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11764. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11765. } while (0)
  11766. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11767. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11768. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11769. do { \
  11770. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11771. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11772. } while (0)
  11773. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11774. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11775. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11776. do { \
  11777. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11778. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11779. } while (0)
  11780. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11781. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11782. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11783. do { \
  11784. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11785. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11786. } while (0)
  11787. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11788. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11789. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11790. do { \
  11791. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11792. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11793. } while (0)
  11794. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11795. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11796. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11797. do { \
  11798. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11799. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11800. } while (0)
  11801. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11802. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11803. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11806. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11807. } while (0)
  11808. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11809. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11810. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11811. do { \
  11812. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11813. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11814. } while (0)
  11815. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11816. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11817. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11818. do { \
  11819. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11820. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11821. } while (0)
  11822. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11823. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11824. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11827. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11828. } while (0)
  11829. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11830. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11831. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11832. do { \
  11833. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11834. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11835. } while (0)
  11836. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11837. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11838. /**
  11839. * @brief target -> host rate-control update indication message
  11840. *
  11841. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11842. *
  11843. * @details
  11844. * The following diagram shows the format of the RC Update message
  11845. * sent from the target to the host, while processing the tx-completion
  11846. * of a transmitted PPDU.
  11847. *
  11848. * |31 24|23 16|15 8|7 0|
  11849. * |-------------------------------------------------------------|
  11850. * | peer ID | vdev ID | msg_type |
  11851. * |-------------------------------------------------------------|
  11852. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11853. * |-------------------------------------------------------------|
  11854. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11855. * |-------------------------------------------------------------|
  11856. * | : |
  11857. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11858. * | : |
  11859. * |-------------------------------------------------------------|
  11860. * | : |
  11861. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11862. * | : |
  11863. * |-------------------------------------------------------------|
  11864. * : :
  11865. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11866. *
  11867. */
  11868. typedef struct {
  11869. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11870. A_UINT32 rate_code_flags;
  11871. A_UINT32 flags; /* Encodes information such as excessive
  11872. retransmission, aggregate, some info
  11873. from .11 frame control,
  11874. STBC, LDPC, (SGI and Tx Chain Mask
  11875. are encoded in ptx_rc->flags field),
  11876. AMPDU truncation (BT/time based etc.),
  11877. RTS/CTS attempt */
  11878. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11879. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11880. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11881. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11882. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11883. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11884. } HTT_RC_TX_DONE_PARAMS;
  11885. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11886. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11887. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11888. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11889. #define HTT_RC_UPDATE_VDEVID_S 8
  11890. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11891. #define HTT_RC_UPDATE_PEERID_S 16
  11892. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11893. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11894. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11895. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11896. do { \
  11897. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11898. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11899. } while (0)
  11900. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11901. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11902. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11903. do { \
  11904. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11905. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11906. } while (0)
  11907. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11908. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11909. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11910. do { \
  11911. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11912. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11913. } while (0)
  11914. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11915. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11916. /**
  11917. * @brief target -> host rx fragment indication message definition
  11918. *
  11919. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11920. *
  11921. * @details
  11922. * The following field definitions describe the format of the rx fragment
  11923. * indication message sent from the target to the host.
  11924. * The rx fragment indication message shares the format of the
  11925. * rx indication message, but not all fields from the rx indication message
  11926. * are relevant to the rx fragment indication message.
  11927. *
  11928. *
  11929. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11930. * |-----------+-------------------+---------------------+-------------|
  11931. * | peer ID | |FV| ext TID | msg type |
  11932. * |-------------------------------------------------------------------|
  11933. * | | flush | flush |
  11934. * | | end | start |
  11935. * | | seq num | seq num |
  11936. * |-------------------------------------------------------------------|
  11937. * | reserved | FW rx desc bytes |
  11938. * |-------------------------------------------------------------------|
  11939. * | | FW MSDU Rx |
  11940. * | | desc B0 |
  11941. * |-------------------------------------------------------------------|
  11942. * Header fields:
  11943. * - MSG_TYPE
  11944. * Bits 7:0
  11945. * Purpose: identifies this as an rx fragment indication message
  11946. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11947. * - EXT_TID
  11948. * Bits 12:8
  11949. * Purpose: identify the traffic ID of the rx data, including
  11950. * special "extended" TID values for multicast, broadcast, and
  11951. * non-QoS data frames
  11952. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11953. * - FLUSH_VALID (FV)
  11954. * Bit 13
  11955. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11956. * is valid
  11957. * Value:
  11958. * 1 -> flush IE is valid and needs to be processed
  11959. * 0 -> flush IE is not valid and should be ignored
  11960. * - PEER_ID
  11961. * Bits 31:16
  11962. * Purpose: Identify, by ID, which peer sent the rx data
  11963. * Value: ID of the peer who sent the rx data
  11964. * - FLUSH_SEQ_NUM_START
  11965. * Bits 5:0
  11966. * Purpose: Indicate the start of a series of MPDUs to flush
  11967. * Not all MPDUs within this series are necessarily valid - the host
  11968. * must check each sequence number within this range to see if the
  11969. * corresponding MPDU is actually present.
  11970. * This field is only valid if the FV bit is set.
  11971. * Value:
  11972. * The sequence number for the first MPDUs to check to flush.
  11973. * The sequence number is masked by 0x3f.
  11974. * - FLUSH_SEQ_NUM_END
  11975. * Bits 11:6
  11976. * Purpose: Indicate the end of a series of MPDUs to flush
  11977. * Value:
  11978. * The sequence number one larger than the sequence number of the
  11979. * last MPDU to check to flush.
  11980. * The sequence number is masked by 0x3f.
  11981. * Not all MPDUs within this series are necessarily valid - the host
  11982. * must check each sequence number within this range to see if the
  11983. * corresponding MPDU is actually present.
  11984. * This field is only valid if the FV bit is set.
  11985. * Rx descriptor fields:
  11986. * - FW_RX_DESC_BYTES
  11987. * Bits 15:0
  11988. * Purpose: Indicate how many bytes in the Rx indication are used for
  11989. * FW Rx descriptors
  11990. * Value: 1
  11991. */
  11992. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11993. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11994. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11995. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11996. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11997. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11998. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11999. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12000. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12001. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12002. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12003. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12004. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12005. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12006. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12007. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12008. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12009. #define HTT_RX_FRAG_IND_BYTES \
  12010. (4 /* msg hdr */ + \
  12011. 4 /* flush spec */ + \
  12012. 4 /* (unused) FW rx desc bytes spec */ + \
  12013. 4 /* FW rx desc */)
  12014. /**
  12015. * @brief target -> host test message definition
  12016. *
  12017. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12018. *
  12019. * @details
  12020. * The following field definitions describe the format of the test
  12021. * message sent from the target to the host.
  12022. * The message consists of a 4-octet header, followed by a variable
  12023. * number of 32-bit integer values, followed by a variable number
  12024. * of 8-bit character values.
  12025. *
  12026. * |31 16|15 8|7 0|
  12027. * |-----------------------------------------------------------|
  12028. * | num chars | num ints | msg type |
  12029. * |-----------------------------------------------------------|
  12030. * | int 0 |
  12031. * |-----------------------------------------------------------|
  12032. * | int 1 |
  12033. * |-----------------------------------------------------------|
  12034. * | ... |
  12035. * |-----------------------------------------------------------|
  12036. * | char 3 | char 2 | char 1 | char 0 |
  12037. * |-----------------------------------------------------------|
  12038. * | | | ... | char 4 |
  12039. * |-----------------------------------------------------------|
  12040. * - MSG_TYPE
  12041. * Bits 7:0
  12042. * Purpose: identifies this as a test message
  12043. * Value: HTT_MSG_TYPE_TEST
  12044. * - NUM_INTS
  12045. * Bits 15:8
  12046. * Purpose: indicate how many 32-bit integers follow the message header
  12047. * - NUM_CHARS
  12048. * Bits 31:16
  12049. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12050. */
  12051. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12052. #define HTT_RX_TEST_NUM_INTS_S 8
  12053. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12054. #define HTT_RX_TEST_NUM_CHARS_S 16
  12055. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12056. do { \
  12057. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12058. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12059. } while (0)
  12060. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12061. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12062. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12063. do { \
  12064. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12065. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12066. } while (0)
  12067. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12068. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12069. /**
  12070. * @brief target -> host packet log message
  12071. *
  12072. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12073. *
  12074. * @details
  12075. * The following field definitions describe the format of the packet log
  12076. * message sent from the target to the host.
  12077. * The message consists of a 4-octet header,followed by a variable number
  12078. * of 32-bit character values.
  12079. *
  12080. * |31 16|15 12|11 10|9 8|7 0|
  12081. * |------------------------------------------------------------------|
  12082. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12083. * |------------------------------------------------------------------|
  12084. * | payload |
  12085. * |------------------------------------------------------------------|
  12086. * - MSG_TYPE
  12087. * Bits 7:0
  12088. * Purpose: identifies this as a pktlog message
  12089. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12090. * - mac_id
  12091. * Bits 9:8
  12092. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12093. * Value: 0-3
  12094. * - pdev_id
  12095. * Bits 11:10
  12096. * Purpose: pdev_id
  12097. * Value: 0-3
  12098. * 0 (for rings at SOC level),
  12099. * 1/2/3 PDEV -> 0/1/2
  12100. * - payload_size
  12101. * Bits 31:16
  12102. * Purpose: explicitly specify the payload size
  12103. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12104. */
  12105. PREPACK struct htt_pktlog_msg {
  12106. A_UINT32 header;
  12107. A_UINT32 payload[1/* or more */];
  12108. } POSTPACK;
  12109. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12110. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12111. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12112. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12113. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12114. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12115. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12116. do { \
  12117. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12118. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12119. } while (0)
  12120. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12121. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12122. HTT_T2H_PKTLOG_MAC_ID_S)
  12123. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12124. do { \
  12125. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12126. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12127. } while (0)
  12128. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12129. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12130. HTT_T2H_PKTLOG_PDEV_ID_S)
  12131. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12132. do { \
  12133. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12134. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12135. } while (0)
  12136. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12137. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12138. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12139. /*
  12140. * Rx reorder statistics
  12141. * NB: all the fields must be defined in 4 octets size.
  12142. */
  12143. struct rx_reorder_stats {
  12144. /* Non QoS MPDUs received */
  12145. A_UINT32 deliver_non_qos;
  12146. /* MPDUs received in-order */
  12147. A_UINT32 deliver_in_order;
  12148. /* Flush due to reorder timer expired */
  12149. A_UINT32 deliver_flush_timeout;
  12150. /* Flush due to move out of window */
  12151. A_UINT32 deliver_flush_oow;
  12152. /* Flush due to DELBA */
  12153. A_UINT32 deliver_flush_delba;
  12154. /* MPDUs dropped due to FCS error */
  12155. A_UINT32 fcs_error;
  12156. /* MPDUs dropped due to monitor mode non-data packet */
  12157. A_UINT32 mgmt_ctrl;
  12158. /* Unicast-data MPDUs dropped due to invalid peer */
  12159. A_UINT32 invalid_peer;
  12160. /* MPDUs dropped due to duplication (non aggregation) */
  12161. A_UINT32 dup_non_aggr;
  12162. /* MPDUs dropped due to processed before */
  12163. A_UINT32 dup_past;
  12164. /* MPDUs dropped due to duplicate in reorder queue */
  12165. A_UINT32 dup_in_reorder;
  12166. /* Reorder timeout happened */
  12167. A_UINT32 reorder_timeout;
  12168. /* invalid bar ssn */
  12169. A_UINT32 invalid_bar_ssn;
  12170. /* reorder reset due to bar ssn */
  12171. A_UINT32 ssn_reset;
  12172. /* Flush due to delete peer */
  12173. A_UINT32 deliver_flush_delpeer;
  12174. /* Flush due to offload*/
  12175. A_UINT32 deliver_flush_offload;
  12176. /* Flush due to out of buffer*/
  12177. A_UINT32 deliver_flush_oob;
  12178. /* MPDUs dropped due to PN check fail */
  12179. A_UINT32 pn_fail;
  12180. /* MPDUs dropped due to unable to allocate memory */
  12181. A_UINT32 store_fail;
  12182. /* Number of times the tid pool alloc succeeded */
  12183. A_UINT32 tid_pool_alloc_succ;
  12184. /* Number of times the MPDU pool alloc succeeded */
  12185. A_UINT32 mpdu_pool_alloc_succ;
  12186. /* Number of times the MSDU pool alloc succeeded */
  12187. A_UINT32 msdu_pool_alloc_succ;
  12188. /* Number of times the tid pool alloc failed */
  12189. A_UINT32 tid_pool_alloc_fail;
  12190. /* Number of times the MPDU pool alloc failed */
  12191. A_UINT32 mpdu_pool_alloc_fail;
  12192. /* Number of times the MSDU pool alloc failed */
  12193. A_UINT32 msdu_pool_alloc_fail;
  12194. /* Number of times the tid pool freed */
  12195. A_UINT32 tid_pool_free;
  12196. /* Number of times the MPDU pool freed */
  12197. A_UINT32 mpdu_pool_free;
  12198. /* Number of times the MSDU pool freed */
  12199. A_UINT32 msdu_pool_free;
  12200. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12201. A_UINT32 msdu_queued;
  12202. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12203. A_UINT32 msdu_recycled;
  12204. /* Number of MPDUs with invalid peer but A2 found in AST */
  12205. A_UINT32 invalid_peer_a2_in_ast;
  12206. /* Number of MPDUs with invalid peer but A3 found in AST */
  12207. A_UINT32 invalid_peer_a3_in_ast;
  12208. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12209. A_UINT32 invalid_peer_bmc_mpdus;
  12210. /* Number of MSDUs with err attention word */
  12211. A_UINT32 rxdesc_err_att;
  12212. /* Number of MSDUs with flag of peer_idx_invalid */
  12213. A_UINT32 rxdesc_err_peer_idx_inv;
  12214. /* Number of MSDUs with flag of peer_idx_timeout */
  12215. A_UINT32 rxdesc_err_peer_idx_to;
  12216. /* Number of MSDUs with flag of overflow */
  12217. A_UINT32 rxdesc_err_ov;
  12218. /* Number of MSDUs with flag of msdu_length_err */
  12219. A_UINT32 rxdesc_err_msdu_len;
  12220. /* Number of MSDUs with flag of mpdu_length_err */
  12221. A_UINT32 rxdesc_err_mpdu_len;
  12222. /* Number of MSDUs with flag of tkip_mic_err */
  12223. A_UINT32 rxdesc_err_tkip_mic;
  12224. /* Number of MSDUs with flag of decrypt_err */
  12225. A_UINT32 rxdesc_err_decrypt;
  12226. /* Number of MSDUs with flag of fcs_err */
  12227. A_UINT32 rxdesc_err_fcs;
  12228. /* Number of Unicast (bc_mc bit is not set in attention word)
  12229. * frames with invalid peer handler
  12230. */
  12231. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12232. /* Number of unicast frame directly (direct bit is set in attention word)
  12233. * to DUT with invalid peer handler
  12234. */
  12235. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12236. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12237. * frames with invalid peer handler
  12238. */
  12239. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12240. /* Number of MSDUs dropped due to no first MSDU flag */
  12241. A_UINT32 rxdesc_no_1st_msdu;
  12242. /* Number of MSDUs droped due to ring overflow */
  12243. A_UINT32 msdu_drop_ring_ov;
  12244. /* Number of MSDUs dropped due to FC mismatch */
  12245. A_UINT32 msdu_drop_fc_mismatch;
  12246. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12247. A_UINT32 msdu_drop_mgmt_remote_ring;
  12248. /* Number of MSDUs dropped due to errors not reported in attention word */
  12249. A_UINT32 msdu_drop_misc;
  12250. /* Number of MSDUs go to offload before reorder */
  12251. A_UINT32 offload_msdu_wal;
  12252. /* Number of data frame dropped by offload after reorder */
  12253. A_UINT32 offload_msdu_reorder;
  12254. /* Number of MPDUs with sequence number in the past and within the BA window */
  12255. A_UINT32 dup_past_within_window;
  12256. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12257. A_UINT32 dup_past_outside_window;
  12258. /* Number of MSDUs with decrypt/MIC error */
  12259. A_UINT32 rxdesc_err_decrypt_mic;
  12260. /* Number of data MSDUs received on both local and remote rings */
  12261. A_UINT32 data_msdus_on_both_rings;
  12262. /* MPDUs never filled */
  12263. A_UINT32 holes_not_filled;
  12264. };
  12265. /*
  12266. * Rx Remote buffer statistics
  12267. * NB: all the fields must be defined in 4 octets size.
  12268. */
  12269. struct rx_remote_buffer_mgmt_stats {
  12270. /* Total number of MSDUs reaped for Rx processing */
  12271. A_UINT32 remote_reaped;
  12272. /* MSDUs recycled within firmware */
  12273. A_UINT32 remote_recycled;
  12274. /* MSDUs stored by Data Rx */
  12275. A_UINT32 data_rx_msdus_stored;
  12276. /* Number of HTT indications from WAL Rx MSDU */
  12277. A_UINT32 wal_rx_ind;
  12278. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12279. A_UINT32 wal_rx_ind_unconsumed;
  12280. /* Number of HTT indications from Data Rx MSDU */
  12281. A_UINT32 data_rx_ind;
  12282. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12283. A_UINT32 data_rx_ind_unconsumed;
  12284. /* Number of HTT indications from ATHBUF */
  12285. A_UINT32 athbuf_rx_ind;
  12286. /* Number of remote buffers requested for refill */
  12287. A_UINT32 refill_buf_req;
  12288. /* Number of remote buffers filled by the host */
  12289. A_UINT32 refill_buf_rsp;
  12290. /* Number of times MAC hw_index = f/w write_index */
  12291. A_INT32 mac_no_bufs;
  12292. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12293. A_INT32 fw_indices_equal;
  12294. /* Number of times f/w finds no buffers to post */
  12295. A_INT32 host_no_bufs;
  12296. };
  12297. /*
  12298. * TXBF MU/SU packets and NDPA statistics
  12299. * NB: all the fields must be defined in 4 octets size.
  12300. */
  12301. struct rx_txbf_musu_ndpa_pkts_stats {
  12302. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12303. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12304. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12305. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12306. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12307. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12308. };
  12309. /*
  12310. * htt_dbg_stats_status -
  12311. * present - The requested stats have been delivered in full.
  12312. * This indicates that either the stats information was contained
  12313. * in its entirety within this message, or else this message
  12314. * completes the delivery of the requested stats info that was
  12315. * partially delivered through earlier STATS_CONF messages.
  12316. * partial - The requested stats have been delivered in part.
  12317. * One or more subsequent STATS_CONF messages with the same
  12318. * cookie value will be sent to deliver the remainder of the
  12319. * information.
  12320. * error - The requested stats could not be delivered, for example due
  12321. * to a shortage of memory to construct a message holding the
  12322. * requested stats.
  12323. * invalid - The requested stat type is either not recognized, or the
  12324. * target is configured to not gather the stats type in question.
  12325. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12326. * series_done - This special value indicates that no further stats info
  12327. * elements are present within a series of stats info elems
  12328. * (within a stats upload confirmation message).
  12329. */
  12330. enum htt_dbg_stats_status {
  12331. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12332. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12333. HTT_DBG_STATS_STATUS_ERROR = 2,
  12334. HTT_DBG_STATS_STATUS_INVALID = 3,
  12335. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12336. };
  12337. /**
  12338. * @brief target -> host statistics upload
  12339. *
  12340. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12341. *
  12342. * @details
  12343. * The following field definitions describe the format of the HTT target
  12344. * to host stats upload confirmation message.
  12345. * The message contains a cookie echoed from the HTT host->target stats
  12346. * upload request, which identifies which request the confirmation is
  12347. * for, and a series of tag-length-value stats information elements.
  12348. * The tag-length header for each stats info element also includes a
  12349. * status field, to indicate whether the request for the stat type in
  12350. * question was fully met, partially met, unable to be met, or invalid
  12351. * (if the stat type in question is disabled in the target).
  12352. * A special value of all 1's in this status field is used to indicate
  12353. * the end of the series of stats info elements.
  12354. *
  12355. *
  12356. * |31 16|15 8|7 5|4 0|
  12357. * |------------------------------------------------------------|
  12358. * | reserved | msg type |
  12359. * |------------------------------------------------------------|
  12360. * | cookie LSBs |
  12361. * |------------------------------------------------------------|
  12362. * | cookie MSBs |
  12363. * |------------------------------------------------------------|
  12364. * | stats entry length | reserved | S |stat type|
  12365. * |------------------------------------------------------------|
  12366. * | |
  12367. * | type-specific stats info |
  12368. * | |
  12369. * |------------------------------------------------------------|
  12370. * | stats entry length | reserved | S |stat type|
  12371. * |------------------------------------------------------------|
  12372. * | |
  12373. * | type-specific stats info |
  12374. * | |
  12375. * |------------------------------------------------------------|
  12376. * | n/a | reserved | 111 | n/a |
  12377. * |------------------------------------------------------------|
  12378. * Header fields:
  12379. * - MSG_TYPE
  12380. * Bits 7:0
  12381. * Purpose: identifies this is a statistics upload confirmation message
  12382. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12383. * - COOKIE_LSBS
  12384. * Bits 31:0
  12385. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12386. * message with its preceding host->target stats request message.
  12387. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12388. * - COOKIE_MSBS
  12389. * Bits 31:0
  12390. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12391. * message with its preceding host->target stats request message.
  12392. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12393. *
  12394. * Stats Information Element tag-length header fields:
  12395. * - STAT_TYPE
  12396. * Bits 4:0
  12397. * Purpose: identifies the type of statistics info held in the
  12398. * following information element
  12399. * Value: htt_dbg_stats_type
  12400. * - STATUS
  12401. * Bits 7:5
  12402. * Purpose: indicate whether the requested stats are present
  12403. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12404. * the completion of the stats entry series
  12405. * - LENGTH
  12406. * Bits 31:16
  12407. * Purpose: indicate the stats information size
  12408. * Value: This field specifies the number of bytes of stats information
  12409. * that follows the element tag-length header.
  12410. * It is expected but not required that this length is a multiple of
  12411. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12412. * subsequent stats entry header will begin on a 4-byte aligned
  12413. * boundary.
  12414. */
  12415. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12416. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12417. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12418. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12419. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12420. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12421. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12422. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12423. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12424. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12425. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12426. do { \
  12427. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12428. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12429. } while (0)
  12430. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12431. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12432. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12433. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12434. do { \
  12435. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12436. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12437. } while (0)
  12438. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12439. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12440. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12441. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12442. do { \
  12443. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12444. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12445. } while (0)
  12446. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12447. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12448. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12449. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12450. #define HTT_MAX_AGGR 64
  12451. #define HTT_HL_MAX_AGGR 18
  12452. /**
  12453. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12454. *
  12455. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12456. *
  12457. * @details
  12458. * The following field definitions describe the format of the HTT host
  12459. * to target frag_desc/msdu_ext bank configuration message.
  12460. * The message contains the based address and the min and max id of the
  12461. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12462. * MSDU_EXT/FRAG_DESC.
  12463. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12464. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12465. * the hardware does the mapping/translation.
  12466. *
  12467. * Total banks that can be configured is configured to 16.
  12468. *
  12469. * This should be called before any TX has be initiated by the HTT
  12470. *
  12471. * |31 16|15 8|7 5|4 0|
  12472. * |------------------------------------------------------------|
  12473. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12474. * |------------------------------------------------------------|
  12475. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12476. #if HTT_PADDR64
  12477. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12478. #endif
  12479. * |------------------------------------------------------------|
  12480. * | ... |
  12481. * |------------------------------------------------------------|
  12482. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12483. #if HTT_PADDR64
  12484. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12485. #endif
  12486. * |------------------------------------------------------------|
  12487. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12488. * |------------------------------------------------------------|
  12489. * | ... |
  12490. * |------------------------------------------------------------|
  12491. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12492. * |------------------------------------------------------------|
  12493. * Header fields:
  12494. * - MSG_TYPE
  12495. * Bits 7:0
  12496. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12497. * for systems with 64-bit format for bus addresses:
  12498. * - BANKx_BASE_ADDRESS_LO
  12499. * Bits 31:0
  12500. * Purpose: Provide a mechanism to specify the base address of the
  12501. * MSDU_EXT bank physical/bus address.
  12502. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12503. * - BANKx_BASE_ADDRESS_HI
  12504. * Bits 31:0
  12505. * Purpose: Provide a mechanism to specify the base address of the
  12506. * MSDU_EXT bank physical/bus address.
  12507. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12508. * for systems with 32-bit format for bus addresses:
  12509. * - BANKx_BASE_ADDRESS
  12510. * Bits 31:0
  12511. * Purpose: Provide a mechanism to specify the base address of the
  12512. * MSDU_EXT bank physical/bus address.
  12513. * Value: MSDU_EXT bank physical / bus address
  12514. * - BANKx_MIN_ID
  12515. * Bits 15:0
  12516. * Purpose: Provide a mechanism to specify the min index that needs to
  12517. * mapped.
  12518. * - BANKx_MAX_ID
  12519. * Bits 31:16
  12520. * Purpose: Provide a mechanism to specify the max index that needs to
  12521. * mapped.
  12522. *
  12523. */
  12524. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12525. * safe value.
  12526. * @note MAX supported banks is 16.
  12527. */
  12528. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12529. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12530. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12531. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12532. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12533. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12534. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12535. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12536. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12537. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12538. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12539. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12540. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12541. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12542. do { \
  12543. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12544. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12545. } while (0)
  12546. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12547. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12548. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12549. do { \
  12550. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12551. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12552. } while (0)
  12553. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12554. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12555. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12556. do { \
  12557. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12558. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12559. } while (0)
  12560. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12561. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12562. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12563. do { \
  12564. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12565. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12566. } while (0)
  12567. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12568. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12569. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12570. do { \
  12571. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12572. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12573. } while (0)
  12574. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12575. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12576. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12577. do { \
  12578. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12579. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12580. } while (0)
  12581. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12582. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12583. /*
  12584. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12585. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12586. * addresses are stored in a XXX-bit field.
  12587. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12588. * htt_tx_frag_desc64_bank_cfg_t structs.
  12589. */
  12590. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12591. _paddr_bits_, \
  12592. _paddr__bank_base_address_) \
  12593. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12594. /** word 0 \
  12595. * msg_type: 8, \
  12596. * pdev_id: 2, \
  12597. * swap: 1, \
  12598. * reserved0: 5, \
  12599. * num_banks: 8, \
  12600. * desc_size: 8; \
  12601. */ \
  12602. A_UINT32 word0; \
  12603. /* \
  12604. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12605. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12606. * the second A_UINT32). \
  12607. */ \
  12608. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12609. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12610. } POSTPACK
  12611. /* define htt_tx_frag_desc32_bank_cfg_t */
  12612. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12613. /* define htt_tx_frag_desc64_bank_cfg_t */
  12614. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12615. /*
  12616. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12617. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12618. */
  12619. #if HTT_PADDR64
  12620. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12621. #else
  12622. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12623. #endif
  12624. /**
  12625. * @brief target -> host HTT TX Credit total count update message definition
  12626. *
  12627. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12628. *
  12629. *|31 16|15|14 9| 8 |7 0 |
  12630. *|---------------------+--+----------+-------+----------|
  12631. *|cur htt credit delta | Q| reserved | sign | msg type |
  12632. *|------------------------------------------------------|
  12633. *
  12634. * Header fields:
  12635. * - MSG_TYPE
  12636. * Bits 7:0
  12637. * Purpose: identifies this as a htt tx credit delta update message
  12638. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12639. * - SIGN
  12640. * Bits 8
  12641. * identifies whether credit delta is positive or negative
  12642. * Value:
  12643. * - 0x0: credit delta is positive, rebalance in some buffers
  12644. * - 0x1: credit delta is negative, rebalance out some buffers
  12645. * - reserved
  12646. * Bits 14:9
  12647. * Value: 0x0
  12648. * - TXQ_GRP
  12649. * Bit 15
  12650. * Purpose: indicates whether any tx queue group information elements
  12651. * are appended to the tx credit update message
  12652. * Value: 0 -> no tx queue group information element is present
  12653. * 1 -> a tx queue group information element immediately follows
  12654. * - DELTA_COUNT
  12655. * Bits 31:16
  12656. * Purpose: Specify current htt credit delta absolute count
  12657. */
  12658. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12659. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12660. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12661. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12662. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12663. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12664. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12665. do { \
  12666. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12667. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12668. } while (0)
  12669. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12670. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12671. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12672. do { \
  12673. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12674. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12675. } while (0)
  12676. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12677. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12678. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12679. do { \
  12680. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12681. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12682. } while (0)
  12683. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12684. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12685. #define HTT_TX_CREDIT_MSG_BYTES 4
  12686. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12687. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12688. /**
  12689. * @brief HTT WDI_IPA Operation Response Message
  12690. *
  12691. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12692. *
  12693. * @details
  12694. * HTT WDI_IPA Operation Response message is sent by target
  12695. * to host confirming suspend or resume operation.
  12696. * |31 24|23 16|15 8|7 0|
  12697. * |----------------+----------------+----------------+----------------|
  12698. * | op_code | Rsvd | msg_type |
  12699. * |-------------------------------------------------------------------|
  12700. * | Rsvd | Response len |
  12701. * |-------------------------------------------------------------------|
  12702. * | |
  12703. * | Response-type specific info |
  12704. * | |
  12705. * | |
  12706. * |-------------------------------------------------------------------|
  12707. * Header fields:
  12708. * - MSG_TYPE
  12709. * Bits 7:0
  12710. * Purpose: Identifies this as WDI_IPA Operation Response message
  12711. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12712. * - OP_CODE
  12713. * Bits 31:16
  12714. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12715. * value: = enum htt_wdi_ipa_op_code
  12716. * - RSP_LEN
  12717. * Bits 16:0
  12718. * Purpose: length for the response-type specific info
  12719. * value: = length in bytes for response-type specific info
  12720. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12721. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12722. */
  12723. PREPACK struct htt_wdi_ipa_op_response_t
  12724. {
  12725. /* DWORD 0: flags and meta-data */
  12726. A_UINT32
  12727. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12728. reserved1: 8,
  12729. op_code: 16;
  12730. A_UINT32
  12731. rsp_len: 16,
  12732. reserved2: 16;
  12733. } POSTPACK;
  12734. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12735. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12736. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12737. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12738. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12739. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12740. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12741. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12742. do { \
  12743. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12744. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12745. } while (0)
  12746. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12747. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12748. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12749. do { \
  12750. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12751. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12752. } while (0)
  12753. enum htt_phy_mode {
  12754. htt_phy_mode_11a = 0,
  12755. htt_phy_mode_11g = 1,
  12756. htt_phy_mode_11b = 2,
  12757. htt_phy_mode_11g_only = 3,
  12758. htt_phy_mode_11na_ht20 = 4,
  12759. htt_phy_mode_11ng_ht20 = 5,
  12760. htt_phy_mode_11na_ht40 = 6,
  12761. htt_phy_mode_11ng_ht40 = 7,
  12762. htt_phy_mode_11ac_vht20 = 8,
  12763. htt_phy_mode_11ac_vht40 = 9,
  12764. htt_phy_mode_11ac_vht80 = 10,
  12765. htt_phy_mode_11ac_vht20_2g = 11,
  12766. htt_phy_mode_11ac_vht40_2g = 12,
  12767. htt_phy_mode_11ac_vht80_2g = 13,
  12768. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12769. htt_phy_mode_11ac_vht160 = 15,
  12770. htt_phy_mode_max,
  12771. };
  12772. /**
  12773. * @brief target -> host HTT channel change indication
  12774. *
  12775. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12776. *
  12777. * @details
  12778. * Specify when a channel change occurs.
  12779. * This allows the host to precisely determine which rx frames arrived
  12780. * on the old channel and which rx frames arrived on the new channel.
  12781. *
  12782. *|31 |7 0 |
  12783. *|-------------------------------------------+----------|
  12784. *| reserved | msg type |
  12785. *|------------------------------------------------------|
  12786. *| primary_chan_center_freq_mhz |
  12787. *|------------------------------------------------------|
  12788. *| contiguous_chan1_center_freq_mhz |
  12789. *|------------------------------------------------------|
  12790. *| contiguous_chan2_center_freq_mhz |
  12791. *|------------------------------------------------------|
  12792. *| phy_mode |
  12793. *|------------------------------------------------------|
  12794. *
  12795. * Header fields:
  12796. * - MSG_TYPE
  12797. * Bits 7:0
  12798. * Purpose: identifies this as a htt channel change indication message
  12799. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12800. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12801. * Bits 31:0
  12802. * Purpose: identify the (center of the) new 20 MHz primary channel
  12803. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12804. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12805. * Bits 31:0
  12806. * Purpose: identify the (center of the) contiguous frequency range
  12807. * comprising the new channel.
  12808. * For example, if the new channel is a 80 MHz channel extending
  12809. * 60 MHz beyond the primary channel, this field would be 30 larger
  12810. * than the primary channel center frequency field.
  12811. * Value: center frequency of the contiguous frequency range comprising
  12812. * the full channel in MHz units
  12813. * (80+80 channels also use the CONTIG_CHAN2 field)
  12814. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12815. * Bits 31:0
  12816. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12817. * within a VHT 80+80 channel.
  12818. * This field is only relevant for VHT 80+80 channels.
  12819. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12820. * channel (arbitrary value for cases besides VHT 80+80)
  12821. * - PHY_MODE
  12822. * Bits 31:0
  12823. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12824. * and band
  12825. * Value: htt_phy_mode enum value
  12826. */
  12827. PREPACK struct htt_chan_change_t
  12828. {
  12829. /* DWORD 0: flags and meta-data */
  12830. A_UINT32
  12831. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12832. reserved1: 24;
  12833. A_UINT32 primary_chan_center_freq_mhz;
  12834. A_UINT32 contig_chan1_center_freq_mhz;
  12835. A_UINT32 contig_chan2_center_freq_mhz;
  12836. A_UINT32 phy_mode;
  12837. } POSTPACK;
  12838. /*
  12839. * Due to historical / backwards-compatibility reasons, maintain the
  12840. * below htt_chan_change_msg struct definition, which needs to be
  12841. * consistent with the above htt_chan_change_t struct definition
  12842. * (aside from the htt_chan_change_t definition including the msg_type
  12843. * dword within the message, and the htt_chan_change_msg only containing
  12844. * the payload of the message that follows the msg_type dword).
  12845. */
  12846. PREPACK struct htt_chan_change_msg {
  12847. A_UINT32 chan_mhz; /* frequency in mhz */
  12848. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12849. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12850. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12851. } POSTPACK;
  12852. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12853. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12854. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12855. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12856. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12857. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12858. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12859. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12860. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12861. do { \
  12862. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12863. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12864. } while (0)
  12865. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12866. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12867. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12868. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12869. do { \
  12870. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12871. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12872. } while (0)
  12873. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12874. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12875. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12876. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12877. do { \
  12878. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12879. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12880. } while (0)
  12881. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12882. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12883. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12884. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12885. do { \
  12886. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12887. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12888. } while (0)
  12889. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12890. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12891. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12892. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12893. /**
  12894. * @brief rx offload packet error message
  12895. *
  12896. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12897. *
  12898. * @details
  12899. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12900. * of target payload like mic err.
  12901. *
  12902. * |31 24|23 16|15 8|7 0|
  12903. * |----------------+----------------+----------------+----------------|
  12904. * | tid | vdev_id | msg_sub_type | msg_type |
  12905. * |-------------------------------------------------------------------|
  12906. * : (sub-type dependent content) :
  12907. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12908. * Header fields:
  12909. * - msg_type
  12910. * Bits 7:0
  12911. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12912. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12913. * - msg_sub_type
  12914. * Bits 15:8
  12915. * Purpose: Identifies which type of rx error is reported by this message
  12916. * value: htt_rx_ofld_pkt_err_type
  12917. * - vdev_id
  12918. * Bits 23:16
  12919. * Purpose: Identifies which vdev received the erroneous rx frame
  12920. * value:
  12921. * - tid
  12922. * Bits 31:24
  12923. * Purpose: Identifies the traffic type of the rx frame
  12924. * value:
  12925. *
  12926. * - The payload fields used if the sub-type == MIC error are shown below.
  12927. * Note - MIC err is per MSDU, while PN is per MPDU.
  12928. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12929. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12930. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12931. * instead of sending separate HTT messages for each wrong MSDU within
  12932. * the MPDU.
  12933. *
  12934. * |31 24|23 16|15 8|7 0|
  12935. * |----------------+----------------+----------------+----------------|
  12936. * | Rsvd | key_id | peer_id |
  12937. * |-------------------------------------------------------------------|
  12938. * | receiver MAC addr 31:0 |
  12939. * |-------------------------------------------------------------------|
  12940. * | Rsvd | receiver MAC addr 47:32 |
  12941. * |-------------------------------------------------------------------|
  12942. * | transmitter MAC addr 31:0 |
  12943. * |-------------------------------------------------------------------|
  12944. * | Rsvd | transmitter MAC addr 47:32 |
  12945. * |-------------------------------------------------------------------|
  12946. * | PN 31:0 |
  12947. * |-------------------------------------------------------------------|
  12948. * | Rsvd | PN 47:32 |
  12949. * |-------------------------------------------------------------------|
  12950. * - peer_id
  12951. * Bits 15:0
  12952. * Purpose: identifies which peer is frame is from
  12953. * value:
  12954. * - key_id
  12955. * Bits 23:16
  12956. * Purpose: identifies key_id of rx frame
  12957. * value:
  12958. * - RA_31_0 (receiver MAC addr 31:0)
  12959. * Bits 31:0
  12960. * Purpose: identifies by MAC address which vdev received the frame
  12961. * value: MAC address lower 4 bytes
  12962. * - RA_47_32 (receiver MAC addr 47:32)
  12963. * Bits 15:0
  12964. * Purpose: identifies by MAC address which vdev received the frame
  12965. * value: MAC address upper 2 bytes
  12966. * - TA_31_0 (transmitter MAC addr 31:0)
  12967. * Bits 31:0
  12968. * Purpose: identifies by MAC address which peer transmitted the frame
  12969. * value: MAC address lower 4 bytes
  12970. * - TA_47_32 (transmitter MAC addr 47:32)
  12971. * Bits 15:0
  12972. * Purpose: identifies by MAC address which peer transmitted the frame
  12973. * value: MAC address upper 2 bytes
  12974. * - PN_31_0
  12975. * Bits 31:0
  12976. * Purpose: Identifies pn of rx frame
  12977. * value: PN lower 4 bytes
  12978. * - PN_47_32
  12979. * Bits 15:0
  12980. * Purpose: Identifies pn of rx frame
  12981. * value:
  12982. * TKIP or CCMP: PN upper 2 bytes
  12983. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12984. */
  12985. enum htt_rx_ofld_pkt_err_type {
  12986. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12987. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12988. };
  12989. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12990. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12991. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12992. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12993. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12994. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12995. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12996. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12997. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12998. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12999. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13000. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13001. do { \
  13002. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13003. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13004. } while (0)
  13005. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13006. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13007. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13008. do { \
  13009. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13010. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13011. } while (0)
  13012. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13013. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13014. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13015. do { \
  13016. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13017. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13018. } while (0)
  13019. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13020. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13021. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13022. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13023. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13024. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13025. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13026. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13027. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13028. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13029. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13030. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13031. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13032. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13033. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13034. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13035. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13036. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13037. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13038. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13039. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13040. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13041. do { \
  13042. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13043. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13044. } while (0)
  13045. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13046. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13047. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13048. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13049. do { \
  13050. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13051. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13052. } while (0)
  13053. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13054. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13055. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13056. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13057. do { \
  13058. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13059. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13060. } while (0)
  13061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13062. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13063. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13065. do { \
  13066. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13067. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13068. } while (0)
  13069. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13070. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13071. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13072. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13073. do { \
  13074. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13075. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13076. } while (0)
  13077. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13078. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13079. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13080. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13081. do { \
  13082. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13083. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13084. } while (0)
  13085. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13086. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13087. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13088. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13089. do { \
  13090. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13091. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13092. } while (0)
  13093. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13094. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13095. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13096. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13097. do { \
  13098. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13099. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13100. } while (0)
  13101. /**
  13102. * @brief target -> host peer rate report message
  13103. *
  13104. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13105. *
  13106. * @details
  13107. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13108. * justified rate of all the peers.
  13109. *
  13110. * |31 24|23 16|15 8|7 0|
  13111. * |----------------+----------------+----------------+----------------|
  13112. * | peer_count | | msg_type |
  13113. * |-------------------------------------------------------------------|
  13114. * : Payload (variant number of peer rate report) :
  13115. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13116. * Header fields:
  13117. * - msg_type
  13118. * Bits 7:0
  13119. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13120. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13121. * - reserved
  13122. * Bits 15:8
  13123. * Purpose:
  13124. * value:
  13125. * - peer_count
  13126. * Bits 31:16
  13127. * Purpose: Specify how many peer rate report elements are present in the payload.
  13128. * value:
  13129. *
  13130. * Payload:
  13131. * There are variant number of peer rate report follow the first 32 bits.
  13132. * The peer rate report is defined as follows.
  13133. *
  13134. * |31 20|19 16|15 0|
  13135. * |-----------------------+---------+---------------------------------|-
  13136. * | reserved | phy | peer_id | \
  13137. * |-------------------------------------------------------------------| -> report #0
  13138. * | rate | /
  13139. * |-----------------------+---------+---------------------------------|-
  13140. * | reserved | phy | peer_id | \
  13141. * |-------------------------------------------------------------------| -> report #1
  13142. * | rate | /
  13143. * |-----------------------+---------+---------------------------------|-
  13144. * | reserved | phy | peer_id | \
  13145. * |-------------------------------------------------------------------| -> report #2
  13146. * | rate | /
  13147. * |-------------------------------------------------------------------|-
  13148. * : :
  13149. * : :
  13150. * : :
  13151. * :-------------------------------------------------------------------:
  13152. *
  13153. * - peer_id
  13154. * Bits 15:0
  13155. * Purpose: identify the peer
  13156. * value:
  13157. * - phy
  13158. * Bits 19:16
  13159. * Purpose: identify which phy is in use
  13160. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13161. * Please see enum htt_peer_report_phy_type for detail.
  13162. * - reserved
  13163. * Bits 31:20
  13164. * Purpose:
  13165. * value:
  13166. * - rate
  13167. * Bits 31:0
  13168. * Purpose: represent the justified rate of the peer specified by peer_id
  13169. * value:
  13170. */
  13171. enum htt_peer_rate_report_phy_type {
  13172. HTT_PEER_RATE_REPORT_11B = 0,
  13173. HTT_PEER_RATE_REPORT_11A_G,
  13174. HTT_PEER_RATE_REPORT_11N,
  13175. HTT_PEER_RATE_REPORT_11AC,
  13176. };
  13177. #define HTT_PEER_RATE_REPORT_SIZE 8
  13178. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13179. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13180. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13181. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13182. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13183. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13184. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13185. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13186. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13187. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13188. do { \
  13189. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13190. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13191. } while (0)
  13192. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13193. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13194. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13195. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13196. do { \
  13197. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13198. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13199. } while (0)
  13200. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13201. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13202. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13203. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13204. do { \
  13205. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13206. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13207. } while (0)
  13208. /**
  13209. * @brief target -> host flow pool map message
  13210. *
  13211. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13212. *
  13213. * @details
  13214. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13215. * a flow of descriptors.
  13216. *
  13217. * This message is in TLV format and indicates the parameters to be setup a
  13218. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13219. * receive descriptors from a specified pool.
  13220. *
  13221. * The message would appear as follows:
  13222. *
  13223. * |31 24|23 16|15 8|7 0|
  13224. * |----------------+----------------+----------------+----------------|
  13225. * header | reserved | num_flows | msg_type |
  13226. * |-------------------------------------------------------------------|
  13227. * | |
  13228. * : payload :
  13229. * | |
  13230. * |-------------------------------------------------------------------|
  13231. *
  13232. * The header field is one DWORD long and is interpreted as follows:
  13233. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13234. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13235. * this message
  13236. * b'16-31 - reserved: These bits are reserved for future use
  13237. *
  13238. * Payload:
  13239. * The payload would contain multiple objects of the following structure. Each
  13240. * object represents a flow.
  13241. *
  13242. * |31 24|23 16|15 8|7 0|
  13243. * |----------------+----------------+----------------+----------------|
  13244. * header | reserved | num_flows | msg_type |
  13245. * |-------------------------------------------------------------------|
  13246. * payload0| flow_type |
  13247. * |-------------------------------------------------------------------|
  13248. * | flow_id |
  13249. * |-------------------------------------------------------------------|
  13250. * | reserved0 | flow_pool_id |
  13251. * |-------------------------------------------------------------------|
  13252. * | reserved1 | flow_pool_size |
  13253. * |-------------------------------------------------------------------|
  13254. * | reserved2 |
  13255. * |-------------------------------------------------------------------|
  13256. * payload1| flow_type |
  13257. * |-------------------------------------------------------------------|
  13258. * | flow_id |
  13259. * |-------------------------------------------------------------------|
  13260. * | reserved0 | flow_pool_id |
  13261. * |-------------------------------------------------------------------|
  13262. * | reserved1 | flow_pool_size |
  13263. * |-------------------------------------------------------------------|
  13264. * | reserved2 |
  13265. * |-------------------------------------------------------------------|
  13266. * | . |
  13267. * | . |
  13268. * | . |
  13269. * |-------------------------------------------------------------------|
  13270. *
  13271. * Each payload is 5 DWORDS long and is interpreted as follows:
  13272. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13273. * this flow is associated. It can be VDEV, peer,
  13274. * or tid (AC). Based on enum htt_flow_type.
  13275. *
  13276. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13277. * object. For flow_type vdev it is set to the
  13278. * vdevid, for peer it is peerid and for tid, it is
  13279. * tid_num.
  13280. *
  13281. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13282. * in the host for this flow
  13283. * b'16:31 - reserved0: This field in reserved for the future. In case
  13284. * we have a hierarchical implementation (HCM) of
  13285. * pools, it can be used to indicate the ID of the
  13286. * parent-pool.
  13287. *
  13288. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13289. * Descriptors for this flow will be
  13290. * allocated from this pool in the host.
  13291. * b'16:31 - reserved1: This field in reserved for the future. In case
  13292. * we have a hierarchical implementation of pools,
  13293. * it can be used to indicate the max number of
  13294. * descriptors in the pool. The b'0:15 can be used
  13295. * to indicate min number of descriptors in the
  13296. * HCM scheme.
  13297. *
  13298. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13299. * we have a hierarchical implementation of pools,
  13300. * b'0:15 can be used to indicate the
  13301. * priority-based borrowing (PBB) threshold of
  13302. * the flow's pool. The b'16:31 are still left
  13303. * reserved.
  13304. */
  13305. enum htt_flow_type {
  13306. FLOW_TYPE_VDEV = 0,
  13307. /* Insert new flow types above this line */
  13308. };
  13309. PREPACK struct htt_flow_pool_map_payload_t {
  13310. A_UINT32 flow_type;
  13311. A_UINT32 flow_id;
  13312. A_UINT32 flow_pool_id:16,
  13313. reserved0:16;
  13314. A_UINT32 flow_pool_size:16,
  13315. reserved1:16;
  13316. A_UINT32 reserved2;
  13317. } POSTPACK;
  13318. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13319. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13320. (sizeof(struct htt_flow_pool_map_payload_t))
  13321. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13322. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13323. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13324. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13325. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13326. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13327. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13328. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13329. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13330. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13331. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13332. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13333. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13334. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13335. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13336. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13337. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13338. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13339. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13340. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13341. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13342. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13343. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13344. do { \
  13345. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13346. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13347. } while (0)
  13348. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13349. do { \
  13350. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13351. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13352. } while (0)
  13353. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13354. do { \
  13355. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13356. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13357. } while (0)
  13358. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13359. do { \
  13360. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13361. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13362. } while (0)
  13363. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13364. do { \
  13365. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13366. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13367. } while (0)
  13368. /**
  13369. * @brief target -> host flow pool unmap message
  13370. *
  13371. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13372. *
  13373. * @details
  13374. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13375. * down a flow of descriptors.
  13376. * This message indicates that for the flow (whose ID is provided) is wanting
  13377. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13378. * pool of descriptors from where descriptors are being allocated for this
  13379. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13380. * be unmapped by the host.
  13381. *
  13382. * The message would appear as follows:
  13383. *
  13384. * |31 24|23 16|15 8|7 0|
  13385. * |----------------+----------------+----------------+----------------|
  13386. * | reserved0 | msg_type |
  13387. * |-------------------------------------------------------------------|
  13388. * | flow_type |
  13389. * |-------------------------------------------------------------------|
  13390. * | flow_id |
  13391. * |-------------------------------------------------------------------|
  13392. * | reserved1 | flow_pool_id |
  13393. * |-------------------------------------------------------------------|
  13394. *
  13395. * The message is interpreted as follows:
  13396. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13397. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13398. * b'8:31 - reserved0: Reserved for future use
  13399. *
  13400. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13401. * this flow is associated. It can be VDEV, peer,
  13402. * or tid (AC). Based on enum htt_flow_type.
  13403. *
  13404. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13405. * object. For flow_type vdev it is set to the
  13406. * vdevid, for peer it is peerid and for tid, it is
  13407. * tid_num.
  13408. *
  13409. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13410. * used in the host for this flow
  13411. * b'16:31 - reserved0: This field in reserved for the future.
  13412. *
  13413. */
  13414. PREPACK struct htt_flow_pool_unmap_t {
  13415. A_UINT32 msg_type:8,
  13416. reserved0:24;
  13417. A_UINT32 flow_type;
  13418. A_UINT32 flow_id;
  13419. A_UINT32 flow_pool_id:16,
  13420. reserved1:16;
  13421. } POSTPACK;
  13422. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13423. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13424. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13425. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13426. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13427. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13428. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13429. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13430. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13431. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13432. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13433. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13434. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13435. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13436. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13437. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13438. do { \
  13439. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13440. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13441. } while (0)
  13442. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13443. do { \
  13444. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13445. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13446. } while (0)
  13447. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13448. do { \
  13449. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13450. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13451. } while (0)
  13452. /**
  13453. * @brief target -> host SRING setup done message
  13454. *
  13455. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13456. *
  13457. * @details
  13458. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13459. * SRNG ring setup is done
  13460. *
  13461. * This message indicates whether the last setup operation is successful.
  13462. * It will be sent to host when host set respose_required bit in
  13463. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13464. * The message would appear as follows:
  13465. *
  13466. * |31 24|23 16|15 8|7 0|
  13467. * |--------------- +----------------+----------------+----------------|
  13468. * | setup_status | ring_id | pdev_id | msg_type |
  13469. * |-------------------------------------------------------------------|
  13470. *
  13471. * The message is interpreted as follows:
  13472. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13473. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13474. * b'8:15 - pdev_id:
  13475. * 0 (for rings at SOC/UMAC level),
  13476. * 1/2/3 mac id (for rings at LMAC level)
  13477. * b'16:23 - ring_id: Identify the ring which is set up
  13478. * More details can be got from enum htt_srng_ring_id
  13479. * b'24:31 - setup_status: Indicate status of setup operation
  13480. * Refer to htt_ring_setup_status
  13481. */
  13482. PREPACK struct htt_sring_setup_done_t {
  13483. A_UINT32 msg_type: 8,
  13484. pdev_id: 8,
  13485. ring_id: 8,
  13486. setup_status: 8;
  13487. } POSTPACK;
  13488. enum htt_ring_setup_status {
  13489. htt_ring_setup_status_ok = 0,
  13490. htt_ring_setup_status_error,
  13491. };
  13492. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13493. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13494. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13495. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13496. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13497. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13498. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13499. do { \
  13500. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13501. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13502. } while (0)
  13503. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13504. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13505. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13506. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13507. HTT_SRING_SETUP_DONE_RING_ID_S)
  13508. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13509. do { \
  13510. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13511. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13512. } while (0)
  13513. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13514. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13515. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13516. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13517. HTT_SRING_SETUP_DONE_STATUS_S)
  13518. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13519. do { \
  13520. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13521. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13522. } while (0)
  13523. /**
  13524. * @brief target -> flow map flow info
  13525. *
  13526. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13527. *
  13528. * @details
  13529. * HTT TX map flow entry with tqm flow pointer
  13530. * Sent from firmware to host to add tqm flow pointer in corresponding
  13531. * flow search entry. Flow metadata is replayed back to host as part of this
  13532. * struct to enable host to find the specific flow search entry
  13533. *
  13534. * The message would appear as follows:
  13535. *
  13536. * |31 28|27 18|17 14|13 8|7 0|
  13537. * |-------+------------------------------------------+----------------|
  13538. * | rsvd0 | fse_hsh_idx | msg_type |
  13539. * |-------------------------------------------------------------------|
  13540. * | rsvd1 | tid | peer_id |
  13541. * |-------------------------------------------------------------------|
  13542. * | tqm_flow_pntr_lo |
  13543. * |-------------------------------------------------------------------|
  13544. * | tqm_flow_pntr_hi |
  13545. * |-------------------------------------------------------------------|
  13546. * | fse_meta_data |
  13547. * |-------------------------------------------------------------------|
  13548. *
  13549. * The message is interpreted as follows:
  13550. *
  13551. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13552. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13553. *
  13554. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13555. * for this flow entry
  13556. *
  13557. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13558. *
  13559. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13560. *
  13561. * dword1 - b'14:17 - tid
  13562. *
  13563. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13564. *
  13565. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13566. *
  13567. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13568. *
  13569. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13570. * given by host
  13571. */
  13572. PREPACK struct htt_tx_map_flow_info {
  13573. A_UINT32
  13574. msg_type: 8,
  13575. fse_hsh_idx: 20,
  13576. rsvd0: 4;
  13577. A_UINT32
  13578. peer_id: 14,
  13579. tid: 4,
  13580. rsvd1: 14;
  13581. A_UINT32 tqm_flow_pntr_lo;
  13582. A_UINT32 tqm_flow_pntr_hi;
  13583. struct htt_tx_flow_metadata fse_meta_data;
  13584. } POSTPACK;
  13585. /* DWORD 0 */
  13586. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13587. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13588. /* DWORD 1 */
  13589. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13590. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13591. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13592. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13593. /* DWORD 0 */
  13594. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13595. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13596. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13597. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13598. do { \
  13599. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13600. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13601. } while (0)
  13602. /* DWORD 1 */
  13603. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13604. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13605. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13606. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13607. do { \
  13608. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13609. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13610. } while (0)
  13611. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13612. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13613. HTT_TX_MAP_FLOW_INFO_TID_S)
  13614. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13615. do { \
  13616. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13617. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13618. } while (0)
  13619. /*
  13620. * htt_dbg_ext_stats_status -
  13621. * present - The requested stats have been delivered in full.
  13622. * This indicates that either the stats information was contained
  13623. * in its entirety within this message, or else this message
  13624. * completes the delivery of the requested stats info that was
  13625. * partially delivered through earlier STATS_CONF messages.
  13626. * partial - The requested stats have been delivered in part.
  13627. * One or more subsequent STATS_CONF messages with the same
  13628. * cookie value will be sent to deliver the remainder of the
  13629. * information.
  13630. * error - The requested stats could not be delivered, for example due
  13631. * to a shortage of memory to construct a message holding the
  13632. * requested stats.
  13633. * invalid - The requested stat type is either not recognized, or the
  13634. * target is configured to not gather the stats type in question.
  13635. */
  13636. enum htt_dbg_ext_stats_status {
  13637. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13638. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13639. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13640. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13641. };
  13642. /**
  13643. * @brief target -> host ppdu stats upload
  13644. *
  13645. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13646. *
  13647. * @details
  13648. * The following field definitions describe the format of the HTT target
  13649. * to host ppdu stats indication message.
  13650. *
  13651. *
  13652. * |31 16|15 12|11 10|9 8|7 0 |
  13653. * |----------------------------------------------------------------------|
  13654. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13655. * |----------------------------------------------------------------------|
  13656. * | ppdu_id |
  13657. * |----------------------------------------------------------------------|
  13658. * | Timestamp in us |
  13659. * |----------------------------------------------------------------------|
  13660. * | reserved |
  13661. * |----------------------------------------------------------------------|
  13662. * | type-specific stats info |
  13663. * | (see htt_ppdu_stats.h) |
  13664. * |----------------------------------------------------------------------|
  13665. * Header fields:
  13666. * - MSG_TYPE
  13667. * Bits 7:0
  13668. * Purpose: Identifies this is a PPDU STATS indication
  13669. * message.
  13670. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13671. * - mac_id
  13672. * Bits 9:8
  13673. * Purpose: mac_id of this ppdu_id
  13674. * Value: 0-3
  13675. * - pdev_id
  13676. * Bits 11:10
  13677. * Purpose: pdev_id of this ppdu_id
  13678. * Value: 0-3
  13679. * 0 (for rings at SOC level),
  13680. * 1/2/3 PDEV -> 0/1/2
  13681. * - payload_size
  13682. * Bits 31:16
  13683. * Purpose: total tlv size
  13684. * Value: payload_size in bytes
  13685. */
  13686. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13687. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13688. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13689. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13690. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13691. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13692. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13693. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13694. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13695. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13696. do { \
  13697. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13698. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13699. } while (0)
  13700. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13701. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13702. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13703. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13704. do { \
  13705. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13706. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13707. } while (0)
  13708. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13709. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13710. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13711. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13712. do { \
  13713. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13714. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13715. } while (0)
  13716. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13717. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13718. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13719. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13720. do { \
  13721. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13722. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13723. } while (0)
  13724. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13725. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13726. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13727. /* htt_t2h_ppdu_stats_ind_hdr_t
  13728. * This struct contains the fields within the header of the
  13729. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13730. * stats info.
  13731. * This struct assumes little-endian layout, and thus is only
  13732. * suitable for use within processors known to be little-endian
  13733. * (such as the target).
  13734. * In contrast, the above macros provide endian-portable methods
  13735. * to get and set the bitfields within this PPDU_STATS_IND header.
  13736. */
  13737. typedef struct {
  13738. A_UINT32 msg_type: 8, /* bits 7:0 */
  13739. mac_id: 2, /* bits 9:8 */
  13740. pdev_id: 2, /* bits 11:10 */
  13741. reserved1: 4, /* bits 15:12 */
  13742. payload_size: 16; /* bits 31:16 */
  13743. A_UINT32 ppdu_id;
  13744. A_UINT32 timestamp_us;
  13745. A_UINT32 reserved2;
  13746. } htt_t2h_ppdu_stats_ind_hdr_t;
  13747. /**
  13748. * @brief target -> host extended statistics upload
  13749. *
  13750. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13751. *
  13752. * @details
  13753. * The following field definitions describe the format of the HTT target
  13754. * to host stats upload confirmation message.
  13755. * The message contains a cookie echoed from the HTT host->target stats
  13756. * upload request, which identifies which request the confirmation is
  13757. * for, and a single stats can span over multiple HTT stats indication
  13758. * due to the HTT message size limitation so every HTT ext stats indication
  13759. * will have tag-length-value stats information elements.
  13760. * The tag-length header for each HTT stats IND message also includes a
  13761. * status field, to indicate whether the request for the stat type in
  13762. * question was fully met, partially met, unable to be met, or invalid
  13763. * (if the stat type in question is disabled in the target).
  13764. * A Done bit 1's indicate the end of the of stats info elements.
  13765. *
  13766. *
  13767. * |31 16|15 12|11|10 8|7 5|4 0|
  13768. * |--------------------------------------------------------------|
  13769. * | reserved | msg type |
  13770. * |--------------------------------------------------------------|
  13771. * | cookie LSBs |
  13772. * |--------------------------------------------------------------|
  13773. * | cookie MSBs |
  13774. * |--------------------------------------------------------------|
  13775. * | stats entry length | rsvd | D| S | stat type |
  13776. * |--------------------------------------------------------------|
  13777. * | type-specific stats info |
  13778. * | (see htt_stats.h) |
  13779. * |--------------------------------------------------------------|
  13780. * Header fields:
  13781. * - MSG_TYPE
  13782. * Bits 7:0
  13783. * Purpose: Identifies this is a extended statistics upload confirmation
  13784. * message.
  13785. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13786. * - COOKIE_LSBS
  13787. * Bits 31:0
  13788. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13789. * message with its preceding host->target stats request message.
  13790. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13791. * - COOKIE_MSBS
  13792. * Bits 31:0
  13793. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13794. * message with its preceding host->target stats request message.
  13795. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13796. *
  13797. * Stats Information Element tag-length header fields:
  13798. * - STAT_TYPE
  13799. * Bits 7:0
  13800. * Purpose: identifies the type of statistics info held in the
  13801. * following information element
  13802. * Value: htt_dbg_ext_stats_type
  13803. * - STATUS
  13804. * Bits 10:8
  13805. * Purpose: indicate whether the requested stats are present
  13806. * Value: htt_dbg_ext_stats_status
  13807. * - DONE
  13808. * Bits 11
  13809. * Purpose:
  13810. * Indicates the completion of the stats entry, this will be the last
  13811. * stats conf HTT segment for the requested stats type.
  13812. * Value:
  13813. * 0 -> the stats retrieval is ongoing
  13814. * 1 -> the stats retrieval is complete
  13815. * - LENGTH
  13816. * Bits 31:16
  13817. * Purpose: indicate the stats information size
  13818. * Value: This field specifies the number of bytes of stats information
  13819. * that follows the element tag-length header.
  13820. * It is expected but not required that this length is a multiple of
  13821. * 4 bytes.
  13822. */
  13823. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13824. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13825. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13826. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13827. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13828. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13829. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13830. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13831. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13832. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13833. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13834. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13835. do { \
  13836. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13837. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13838. } while (0)
  13839. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13840. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13841. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13842. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13843. do { \
  13844. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13845. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13846. } while (0)
  13847. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13848. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13849. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13850. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13851. do { \
  13852. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13853. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13854. } while (0)
  13855. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13856. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13857. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13858. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13859. do { \
  13860. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13861. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13862. } while (0)
  13863. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13864. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13865. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13866. typedef enum {
  13867. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13868. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13869. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13870. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13871. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13872. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13873. /* Reserved from 128 - 255 for target internal use.*/
  13874. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13875. } HTT_PEER_TYPE;
  13876. /** macro to convert MAC address from char array to HTT word format */
  13877. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13878. (phtt_mac_addr)->mac_addr31to0 = \
  13879. (((c_macaddr)[0] << 0) | \
  13880. ((c_macaddr)[1] << 8) | \
  13881. ((c_macaddr)[2] << 16) | \
  13882. ((c_macaddr)[3] << 24)); \
  13883. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13884. } while (0)
  13885. /**
  13886. * @brief target -> host monitor mac header indication message
  13887. *
  13888. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13889. *
  13890. * @details
  13891. * The following diagram shows the format of the monitor mac header message
  13892. * sent from the target to the host.
  13893. * This message is primarily sent when promiscuous rx mode is enabled.
  13894. * One message is sent per rx PPDU.
  13895. *
  13896. * |31 24|23 16|15 8|7 0|
  13897. * |-------------------------------------------------------------|
  13898. * | peer_id | reserved0 | msg_type |
  13899. * |-------------------------------------------------------------|
  13900. * | reserved1 | num_mpdu |
  13901. * |-------------------------------------------------------------|
  13902. * | struct hw_rx_desc |
  13903. * | (see wal_rx_desc.h) |
  13904. * |-------------------------------------------------------------|
  13905. * | struct ieee80211_frame_addr4 |
  13906. * | (see ieee80211_defs.h) |
  13907. * |-------------------------------------------------------------|
  13908. * | struct ieee80211_frame_addr4 |
  13909. * | (see ieee80211_defs.h) |
  13910. * |-------------------------------------------------------------|
  13911. * | ...... |
  13912. * |-------------------------------------------------------------|
  13913. *
  13914. * Header fields:
  13915. * - msg_type
  13916. * Bits 7:0
  13917. * Purpose: Identifies this is a monitor mac header indication message.
  13918. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13919. * - peer_id
  13920. * Bits 31:16
  13921. * Purpose: Software peer id given by host during association,
  13922. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13923. * for rx PPDUs received from unassociated peers.
  13924. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13925. * - num_mpdu
  13926. * Bits 15:0
  13927. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13928. * delivered within the message.
  13929. * Value: 1 to 32
  13930. * num_mpdu is limited to a maximum value of 32, due to buffer
  13931. * size limits. For PPDUs with more than 32 MPDUs, only the
  13932. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13933. * the PPDU will be provided.
  13934. */
  13935. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13936. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13937. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13938. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13939. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13940. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13941. do { \
  13942. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13943. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13944. } while (0)
  13945. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13946. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13947. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13948. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13949. do { \
  13950. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13951. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13952. } while (0)
  13953. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13954. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13955. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13956. /**
  13957. * @brief target -> host flow pool resize Message
  13958. *
  13959. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13960. *
  13961. * @details
  13962. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13963. * the flow pool associated with the specified ID is resized
  13964. *
  13965. * The message would appear as follows:
  13966. *
  13967. * |31 16|15 8|7 0|
  13968. * |---------------------------------+----------------+----------------|
  13969. * | reserved0 | Msg type |
  13970. * |-------------------------------------------------------------------|
  13971. * | flow pool new size | flow pool ID |
  13972. * |-------------------------------------------------------------------|
  13973. *
  13974. * The message is interpreted as follows:
  13975. * b'0:7 - msg_type: This will be set to 0x21
  13976. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13977. *
  13978. * b'0:15 - flow pool ID: Existing flow pool ID
  13979. *
  13980. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13981. *
  13982. */
  13983. PREPACK struct htt_flow_pool_resize_t {
  13984. A_UINT32 msg_type:8,
  13985. reserved0:24;
  13986. A_UINT32 flow_pool_id:16,
  13987. flow_pool_new_size:16;
  13988. } POSTPACK;
  13989. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13990. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13991. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13992. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13993. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13994. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13995. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13996. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13997. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13998. do { \
  13999. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14000. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14001. } while (0)
  14002. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14003. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14004. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14005. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14006. do { \
  14007. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14008. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14009. } while (0)
  14010. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14011. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14012. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14013. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14014. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14015. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14016. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14017. /*
  14018. * The read and write indices point to the data within the host buffer.
  14019. * Because the first 4 bytes of the host buffer is used for the read index and
  14020. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14021. * The read index and write index are the byte offsets from the base of the
  14022. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14023. * Refer the ASCII text picture below.
  14024. */
  14025. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14026. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14027. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14028. /*
  14029. ***************************************************************************
  14030. *
  14031. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14032. *
  14033. ***************************************************************************
  14034. *
  14035. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14036. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14037. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14038. * written into the Host memory region mentioned below.
  14039. *
  14040. * Read index is updated by the Host. At any point of time, the read index will
  14041. * indicate the index that will next be read by the Host. The read index is
  14042. * in units of bytes offset from the base of the meta-data buffer.
  14043. *
  14044. * Write index is updated by the FW. At any point of time, the write index will
  14045. * indicate from where the FW can start writing any new data. The write index is
  14046. * in units of bytes offset from the base of the meta-data buffer.
  14047. *
  14048. * If the Host is not fast enough in reading the CFR data, any new capture data
  14049. * would be dropped if there is no space left to write the new captures.
  14050. *
  14051. * The last 4 bytes of the memory region will have the magic pattern
  14052. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14053. * not overrun the host buffer.
  14054. *
  14055. * ,--------------------. read and write indices store the
  14056. * | | byte offset from the base of the
  14057. * | ,--------+--------. meta-data buffer to the next
  14058. * | | | | location within the data buffer
  14059. * | | v v that will be read / written
  14060. * ************************************************************************
  14061. * * Read * Write * * Magic *
  14062. * * index * index * CFR data1 ...... CFR data N * pattern *
  14063. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14064. * ************************************************************************
  14065. * |<---------- data buffer ---------->|
  14066. *
  14067. * |<----------------- meta-data buffer allocated in Host ----------------|
  14068. *
  14069. * Note:
  14070. * - Considering the 4 bytes needed to store the Read index (R) and the
  14071. * Write index (W), the initial value is as follows:
  14072. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14073. * - Buffer empty condition:
  14074. * R = W
  14075. *
  14076. * Regarding CFR data format:
  14077. * --------------------------
  14078. *
  14079. * Each CFR tone is stored in HW as 16-bits with the following format:
  14080. * {bits[15:12], bits[11:6], bits[5:0]} =
  14081. * {unsigned exponent (4 bits),
  14082. * signed mantissa_real (6 bits),
  14083. * signed mantissa_imag (6 bits)}
  14084. *
  14085. * CFR_real = mantissa_real * 2^(exponent-5)
  14086. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14087. *
  14088. *
  14089. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14090. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14091. *
  14092. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14093. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14094. * .
  14095. * .
  14096. * .
  14097. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14098. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14099. */
  14100. /* Bandwidth of peer CFR captures */
  14101. typedef enum {
  14102. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14103. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14104. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14105. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14106. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14107. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14108. } HTT_PEER_CFR_CAPTURE_BW;
  14109. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14110. * was captured
  14111. */
  14112. typedef enum {
  14113. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14114. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14115. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14116. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14117. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14118. } HTT_PEER_CFR_CAPTURE_MODE;
  14119. typedef enum {
  14120. /* This message type is currently used for the below purpose:
  14121. *
  14122. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14123. * wmi_peer_cfr_capture_cmd.
  14124. * If payload_present bit is set to 0 then the associated memory region
  14125. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14126. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14127. * message; the CFR dump will be present at the end of the message,
  14128. * after the chan_phy_mode.
  14129. */
  14130. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14131. /* Always keep this last */
  14132. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14133. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14134. /**
  14135. * @brief target -> host CFR dump completion indication message definition
  14136. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14137. *
  14138. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14139. *
  14140. * @details
  14141. * The following diagram shows the format of the Channel Frequency Response
  14142. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14143. * the channel capture of a peer is copied by Firmware into the Host memory
  14144. *
  14145. * **************************************************************************
  14146. *
  14147. * Message format when the CFR capture message type is
  14148. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14149. *
  14150. * **************************************************************************
  14151. *
  14152. * |31 16|15 |8|7 0|
  14153. * |----------------------------------------------------------------|
  14154. * header: | reserved |P| msg_type |
  14155. * word 0 | | | |
  14156. * |----------------------------------------------------------------|
  14157. * payload: | cfr_capture_msg_type |
  14158. * word 1 | |
  14159. * |----------------------------------------------------------------|
  14160. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14161. * word 2 | | | | | | | | |
  14162. * |----------------------------------------------------------------|
  14163. * | mac_addr31to0 |
  14164. * word 3 | |
  14165. * |----------------------------------------------------------------|
  14166. * | unused / reserved | mac_addr47to32 |
  14167. * word 4 | | |
  14168. * |----------------------------------------------------------------|
  14169. * | index |
  14170. * word 5 | |
  14171. * |----------------------------------------------------------------|
  14172. * | length |
  14173. * word 6 | |
  14174. * |----------------------------------------------------------------|
  14175. * | timestamp |
  14176. * word 7 | |
  14177. * |----------------------------------------------------------------|
  14178. * | counter |
  14179. * word 8 | |
  14180. * |----------------------------------------------------------------|
  14181. * | chan_mhz |
  14182. * word 9 | |
  14183. * |----------------------------------------------------------------|
  14184. * | band_center_freq1 |
  14185. * word 10 | |
  14186. * |----------------------------------------------------------------|
  14187. * | band_center_freq2 |
  14188. * word 11 | |
  14189. * |----------------------------------------------------------------|
  14190. * | chan_phy_mode |
  14191. * word 12 | |
  14192. * |----------------------------------------------------------------|
  14193. * where,
  14194. * P - payload present bit (payload_present explained below)
  14195. * req_id - memory request id (mem_req_id explained below)
  14196. * S - status field (status explained below)
  14197. * capbw - capture bandwidth (capture_bw explained below)
  14198. * mode - mode of capture (mode explained below)
  14199. * sts - space time streams (sts_count explained below)
  14200. * chbw - channel bandwidth (channel_bw explained below)
  14201. * captype - capture type (cap_type explained below)
  14202. *
  14203. * The following field definitions describe the format of the CFR dump
  14204. * completion indication sent from the target to the host
  14205. *
  14206. * Header fields:
  14207. *
  14208. * Word 0
  14209. * - msg_type
  14210. * Bits 7:0
  14211. * Purpose: Identifies this as CFR TX completion indication
  14212. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14213. * - payload_present
  14214. * Bit 8
  14215. * Purpose: Identifies how CFR data is sent to host
  14216. * Value: 0 - If CFR Payload is written to host memory
  14217. * 1 - If CFR Payload is sent as part of HTT message
  14218. * (This is the requirement for SDIO/USB where it is
  14219. * not possible to write CFR data to host memory)
  14220. * - reserved
  14221. * Bits 31:9
  14222. * Purpose: Reserved
  14223. * Value: 0
  14224. *
  14225. * Payload fields:
  14226. *
  14227. * Word 1
  14228. * - cfr_capture_msg_type
  14229. * Bits 31:0
  14230. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14231. * to specify the format used for the remainder of the message
  14232. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14233. * (currently only MSG_TYPE_1 is defined)
  14234. *
  14235. * Word 2
  14236. * - mem_req_id
  14237. * Bits 6:0
  14238. * Purpose: Contain the mem request id of the region where the CFR capture
  14239. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14240. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14241. this value is invalid)
  14242. * - status
  14243. * Bit 7
  14244. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14245. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14246. * - capture_bw
  14247. * Bits 10:8
  14248. * Purpose: Carry the bandwidth of the CFR capture
  14249. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14250. * - mode
  14251. * Bits 13:11
  14252. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14253. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14254. * - sts_count
  14255. * Bits 16:14
  14256. * Purpose: Carry the number of space time streams
  14257. * Value: Number of space time streams
  14258. * - channel_bw
  14259. * Bits 19:17
  14260. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14261. * measurement
  14262. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14263. * - cap_type
  14264. * Bits 23:20
  14265. * Purpose: Carry the type of the capture
  14266. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14267. * - vdev_id
  14268. * Bits 31:24
  14269. * Purpose: Carry the virtual device id
  14270. * Value: vdev ID
  14271. *
  14272. * Word 3
  14273. * - mac_addr31to0
  14274. * Bits 31:0
  14275. * Purpose: Contain the bits 31:0 of the peer MAC address
  14276. * Value: Bits 31:0 of the peer MAC address
  14277. *
  14278. * Word 4
  14279. * - mac_addr47to32
  14280. * Bits 15:0
  14281. * Purpose: Contain the bits 47:32 of the peer MAC address
  14282. * Value: Bits 47:32 of the peer MAC address
  14283. *
  14284. * Word 5
  14285. * - index
  14286. * Bits 31:0
  14287. * Purpose: Contain the index at which this CFR dump was written in the Host
  14288. * allocated memory. This index is the number of bytes from the base address.
  14289. * Value: Index position
  14290. *
  14291. * Word 6
  14292. * - length
  14293. * Bits 31:0
  14294. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14295. * Value: Length of the CFR capture of the peer
  14296. *
  14297. * Word 7
  14298. * - timestamp
  14299. * Bits 31:0
  14300. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14301. * clock used for this timestamp is private to the target and not visible to
  14302. * the host i.e., Host can interpret only the relative timestamp deltas from
  14303. * one message to the next, but can't interpret the absolute timestamp from a
  14304. * single message.
  14305. * Value: Timestamp in microseconds
  14306. *
  14307. * Word 8
  14308. * - counter
  14309. * Bits 31:0
  14310. * Purpose: Carry the count of the current CFR capture from FW. This is
  14311. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14312. * in host memory)
  14313. * Value: Count of the current CFR capture
  14314. *
  14315. * Word 9
  14316. * - chan_mhz
  14317. * Bits 31:0
  14318. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14319. * Value: Primary 20 channel frequency
  14320. *
  14321. * Word 10
  14322. * - band_center_freq1
  14323. * Bits 31:0
  14324. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14325. * Value: Center frequency 1 in MHz
  14326. *
  14327. * Word 11
  14328. * - band_center_freq2
  14329. * Bits 31:0
  14330. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14331. * the VDEV
  14332. * 80plus80 mode
  14333. * Value: Center frequency 2 in MHz
  14334. *
  14335. * Word 12
  14336. * - chan_phy_mode
  14337. * Bits 31:0
  14338. * Purpose: Carry the phy mode of the channel, of the VDEV
  14339. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14340. */
  14341. PREPACK struct htt_cfr_dump_ind_type_1 {
  14342. A_UINT32 mem_req_id:7,
  14343. status:1,
  14344. capture_bw:3,
  14345. mode:3,
  14346. sts_count:3,
  14347. channel_bw:3,
  14348. cap_type:4,
  14349. vdev_id:8;
  14350. htt_mac_addr addr;
  14351. A_UINT32 index;
  14352. A_UINT32 length;
  14353. A_UINT32 timestamp;
  14354. A_UINT32 counter;
  14355. struct htt_chan_change_msg chan;
  14356. } POSTPACK;
  14357. PREPACK struct htt_cfr_dump_compl_ind {
  14358. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14359. union {
  14360. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14361. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14362. /* If there is a need to change the memory layout and its associated
  14363. * HTT indication format, a new CFR capture message type can be
  14364. * introduced and added into this union.
  14365. */
  14366. };
  14367. } POSTPACK;
  14368. /*
  14369. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14370. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14371. */
  14372. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14373. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14374. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14375. do { \
  14376. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14377. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14378. } while(0)
  14379. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14380. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14381. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14382. /*
  14383. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14384. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14385. */
  14386. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14387. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14388. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14389. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14390. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14391. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14392. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14393. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14394. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14395. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14396. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14397. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14398. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14399. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14400. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14401. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14402. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14403. do { \
  14404. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14405. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14406. } while (0)
  14407. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14408. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14409. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14410. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14411. do { \
  14412. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14413. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14414. } while (0)
  14415. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14416. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14417. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14418. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14419. do { \
  14420. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14421. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14422. } while (0)
  14423. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14424. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14425. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14426. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14427. do { \
  14428. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14429. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14430. } while (0)
  14431. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14432. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14433. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14434. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14435. do { \
  14436. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14437. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14438. } while (0)
  14439. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14440. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14441. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14442. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14443. do { \
  14444. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14445. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14446. } while (0)
  14447. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14448. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14449. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14450. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14451. do { \
  14452. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14453. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14454. } while (0)
  14455. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14456. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14457. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14458. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14459. do { \
  14460. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14461. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14462. } while (0)
  14463. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14464. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14465. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14466. /**
  14467. * @brief target -> host peer (PPDU) stats message
  14468. *
  14469. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14470. *
  14471. * @details
  14472. * This message is generated by FW when FW is sending stats to host
  14473. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14474. * This message is sent autonomously by the target rather than upon request
  14475. * by the host.
  14476. * The following field definitions describe the format of the HTT target
  14477. * to host peer stats indication message.
  14478. *
  14479. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14480. * or more PPDU stats records.
  14481. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14482. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14483. * then the message would start with the
  14484. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14485. * below.
  14486. *
  14487. * |31 16|15|14|13 11|10 9|8|7 0|
  14488. * |-------------------------------------------------------------|
  14489. * | reserved |MSG_TYPE |
  14490. * |-------------------------------------------------------------|
  14491. * rec 0 | TLV header |
  14492. * rec 0 |-------------------------------------------------------------|
  14493. * rec 0 | ppdu successful bytes |
  14494. * rec 0 |-------------------------------------------------------------|
  14495. * rec 0 | ppdu retry bytes |
  14496. * rec 0 |-------------------------------------------------------------|
  14497. * rec 0 | ppdu failed bytes |
  14498. * rec 0 |-------------------------------------------------------------|
  14499. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14500. * rec 0 |-------------------------------------------------------------|
  14501. * rec 0 | retried MSDUs | successful MSDUs |
  14502. * rec 0 |-------------------------------------------------------------|
  14503. * rec 0 | TX duration | failed MSDUs |
  14504. * rec 0 |-------------------------------------------------------------|
  14505. * ...
  14506. * |-------------------------------------------------------------|
  14507. * rec N | TLV header |
  14508. * rec N |-------------------------------------------------------------|
  14509. * rec N | ppdu successful bytes |
  14510. * rec N |-------------------------------------------------------------|
  14511. * rec N | ppdu retry bytes |
  14512. * rec N |-------------------------------------------------------------|
  14513. * rec N | ppdu failed bytes |
  14514. * rec N |-------------------------------------------------------------|
  14515. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14516. * rec N |-------------------------------------------------------------|
  14517. * rec N | retried MSDUs | successful MSDUs |
  14518. * rec N |-------------------------------------------------------------|
  14519. * rec N | TX duration | failed MSDUs |
  14520. * rec N |-------------------------------------------------------------|
  14521. *
  14522. * where:
  14523. * A = is A-MPDU flag
  14524. * BA = block-ack failure flags
  14525. * BW = bandwidth spec
  14526. * SG = SGI enabled spec
  14527. * S = skipped rate ctrl
  14528. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14529. *
  14530. * Header
  14531. * ------
  14532. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14533. * dword0 - b'8:31 - reserved : Reserved for future use
  14534. *
  14535. * payload include below peer_stats information
  14536. * --------------------------------------------
  14537. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14538. * @tx_success_bytes : total successful bytes in the PPDU.
  14539. * @tx_retry_bytes : total retried bytes in the PPDU.
  14540. * @tx_failed_bytes : total failed bytes in the PPDU.
  14541. * @tx_ratecode : rate code used for the PPDU.
  14542. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14543. * @ba_ack_failed : BA/ACK failed for this PPDU
  14544. * b00 -> BA received
  14545. * b01 -> BA failed once
  14546. * b10 -> BA failed twice, when HW retry is enabled.
  14547. * @bw : BW
  14548. * b00 -> 20 MHz
  14549. * b01 -> 40 MHz
  14550. * b10 -> 80 MHz
  14551. * b11 -> 160 MHz (or 80+80)
  14552. * @sg : SGI enabled
  14553. * @s : skipped ratectrl
  14554. * @peer_id : peer id
  14555. * @tx_success_msdus : successful MSDUs
  14556. * @tx_retry_msdus : retried MSDUs
  14557. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14558. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14559. */
  14560. /**
  14561. * @brief target -> host backpressure event
  14562. *
  14563. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14564. *
  14565. * @details
  14566. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14567. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14568. * This message will only be sent if the backpressure condition has existed
  14569. * continuously for an initial period (100 ms).
  14570. * Repeat messages with updated information will be sent after each
  14571. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14572. * This message indicates the ring id along with current head and tail index
  14573. * locations (i.e. write and read indices).
  14574. * The backpressure time indicates the time in ms for which continous
  14575. * backpressure has been observed in the ring.
  14576. *
  14577. * The message format is as follows:
  14578. *
  14579. * |31 24|23 16|15 8|7 0|
  14580. * |----------------+----------------+----------------+----------------|
  14581. * | ring_id | ring_type | pdev_id | msg_type |
  14582. * |-------------------------------------------------------------------|
  14583. * | tail_idx | head_idx |
  14584. * |-------------------------------------------------------------------|
  14585. * | backpressure_time_ms |
  14586. * |-------------------------------------------------------------------|
  14587. *
  14588. * The message is interpreted as follows:
  14589. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14590. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14591. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14592. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14593. the msg is for LMAC ring.
  14594. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14595. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14596. * htt_backpressure_lmac_ring_id. This represents
  14597. * the ring id for which continous backpressure is seen
  14598. *
  14599. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14600. * the ring indicated by the ring_id
  14601. *
  14602. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14603. * the ring indicated by the ring id
  14604. *
  14605. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14606. * backpressure has been seen in the ring
  14607. * indicated by the ring_id.
  14608. * Units = milliseconds
  14609. */
  14610. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14611. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14612. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14613. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14614. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14615. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14616. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14617. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14618. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14619. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14620. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14621. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14622. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14623. do { \
  14624. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14625. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14626. } while (0)
  14627. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14628. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14629. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14630. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14631. do { \
  14632. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14633. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14634. } while (0)
  14635. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14636. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14637. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14638. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14639. do { \
  14640. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14641. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14642. } while (0)
  14643. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14644. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14645. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14646. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14647. do { \
  14648. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14649. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14650. } while (0)
  14651. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14652. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14653. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14654. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14655. do { \
  14656. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14657. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14658. } while (0)
  14659. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14660. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14661. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14662. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14663. do { \
  14664. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14665. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14666. } while (0)
  14667. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14668. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14669. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14670. enum htt_backpressure_ring_type {
  14671. HTT_SW_RING_TYPE_UMAC,
  14672. HTT_SW_RING_TYPE_LMAC,
  14673. HTT_SW_RING_TYPE_MAX,
  14674. };
  14675. /* Ring id for which the message is sent to host */
  14676. enum htt_backpressure_umac_ringid {
  14677. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14678. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14679. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14680. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14681. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14682. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14683. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14684. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14685. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14686. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14687. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14688. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14689. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14690. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14691. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14692. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14693. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14694. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14695. HTT_SW_UMAC_RING_IDX_MAX,
  14696. };
  14697. enum htt_backpressure_lmac_ringid {
  14698. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14699. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14700. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14701. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14702. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14703. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14704. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14705. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14706. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14707. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14708. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14709. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14710. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14711. HTT_SW_LMAC_RING_IDX_MAX,
  14712. };
  14713. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14714. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14715. pdev_id: 8,
  14716. ring_type: 8, /* htt_backpressure_ring_type */
  14717. /*
  14718. * ring_id holds an enum value from either
  14719. * htt_backpressure_umac_ringid or
  14720. * htt_backpressure_lmac_ringid, based on
  14721. * the ring_type setting.
  14722. */
  14723. ring_id: 8;
  14724. A_UINT16 head_idx;
  14725. A_UINT16 tail_idx;
  14726. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14727. } POSTPACK;
  14728. /*
  14729. * Defines two 32 bit words that can be used by the target to indicate a per
  14730. * user RU allocation and rate information.
  14731. *
  14732. * This information is currently provided in the "sw_response_reference_ptr"
  14733. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14734. * "rx_ppdu_end_user_stats" TLV.
  14735. *
  14736. * VALID:
  14737. * The consumer of these words must explicitly check the valid bit,
  14738. * and only attempt interpretation of any of the remaining fields if
  14739. * the valid bit is set to 1.
  14740. *
  14741. * VERSION:
  14742. * The consumer of these words must also explicitly check the version bit,
  14743. * and only use the V0 definition if the VERSION field is set to 0.
  14744. *
  14745. * Version 1 is currently undefined, with the exception of the VALID and
  14746. * VERSION fields.
  14747. *
  14748. * Version 0:
  14749. *
  14750. * The fields below are duplicated per BW.
  14751. *
  14752. * The consumer must determine which BW field to use, based on the UL OFDMA
  14753. * PPDU BW indicated by HW.
  14754. *
  14755. * RU_START: RU26 start index for the user.
  14756. * Note that this is always using the RU26 index, regardless
  14757. * of the actual RU assigned to the user
  14758. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14759. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14760. *
  14761. * For example, 20MHz (the value in the top row is RU_START)
  14762. *
  14763. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14764. * RU Size 1 (52): | | | | | |
  14765. * RU Size 2 (106): | | | |
  14766. * RU Size 3 (242): | |
  14767. *
  14768. * RU_SIZE: Indicates the RU size, as defined by enum
  14769. * htt_ul_ofdma_user_info_ru_size.
  14770. *
  14771. * LDPC: LDPC enabled (if 0, BCC is used)
  14772. *
  14773. * DCM: DCM enabled
  14774. *
  14775. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14776. * |---------------------------------+--------------------------------|
  14777. * |Ver|Valid| FW internal |
  14778. * |---------------------------------+--------------------------------|
  14779. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14780. * |---------------------------------+--------------------------------|
  14781. */
  14782. enum htt_ul_ofdma_user_info_ru_size {
  14783. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14784. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14785. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14786. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14787. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14788. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14789. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14790. };
  14791. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14792. struct htt_ul_ofdma_user_info_v0 {
  14793. A_UINT32 word0;
  14794. A_UINT32 word1;
  14795. };
  14796. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14797. A_UINT32 w0_fw_rsvd:30; \
  14798. A_UINT32 w0_valid:1; \
  14799. A_UINT32 w0_version:1;
  14800. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14801. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14802. };
  14803. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14804. A_UINT32 w1_nss:3; \
  14805. A_UINT32 w1_mcs:4; \
  14806. A_UINT32 w1_ldpc:1; \
  14807. A_UINT32 w1_dcm:1; \
  14808. A_UINT32 w1_ru_start:7; \
  14809. A_UINT32 w1_ru_size:3; \
  14810. A_UINT32 w1_trig_type:4; \
  14811. A_UINT32 w1_unused:9;
  14812. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14813. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14814. };
  14815. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14816. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14817. union {
  14818. A_UINT32 word0;
  14819. struct {
  14820. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14821. };
  14822. };
  14823. union {
  14824. A_UINT32 word1;
  14825. struct {
  14826. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14827. };
  14828. };
  14829. } POSTPACK;
  14830. enum HTT_UL_OFDMA_TRIG_TYPE {
  14831. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14832. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14833. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14834. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14835. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14836. };
  14837. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14838. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14839. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14840. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14841. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14842. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14843. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14844. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14845. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14846. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14847. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14848. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14849. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14850. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14851. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14852. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14853. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14854. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14855. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14856. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14857. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14858. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14859. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14860. /*--- word 0 ---*/
  14861. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14862. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14863. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14864. do { \
  14865. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14866. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14867. } while (0)
  14868. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14869. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14870. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14871. do { \
  14872. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14873. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14874. } while (0)
  14875. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14876. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14877. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14878. do { \
  14879. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14880. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14881. } while (0)
  14882. /*--- word 1 ---*/
  14883. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14884. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14885. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14886. do { \
  14887. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14888. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14889. } while (0)
  14890. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14891. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14892. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14893. do { \
  14894. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14895. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14896. } while (0)
  14897. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14898. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14899. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14900. do { \
  14901. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14902. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14903. } while (0)
  14904. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14905. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14906. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14907. do { \
  14908. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14909. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14910. } while (0)
  14911. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14912. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14913. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14914. do { \
  14915. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14916. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14917. } while (0)
  14918. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14919. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14920. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14921. do { \
  14922. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14923. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14924. } while (0)
  14925. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14926. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14927. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14928. do { \
  14929. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14930. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14931. } while (0)
  14932. /**
  14933. * @brief target -> host channel calibration data message
  14934. *
  14935. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14936. *
  14937. * @brief host -> target channel calibration data message
  14938. *
  14939. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14940. *
  14941. * @details
  14942. * The following field definitions describe the format of the channel
  14943. * calibration data message sent from the target to the host when
  14944. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14945. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14946. * The message is defined as htt_chan_caldata_msg followed by a variable
  14947. * number of 32-bit character values.
  14948. *
  14949. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14950. * |------------------------------------------------------------------|
  14951. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14952. * |------------------------------------------------------------------|
  14953. * | payload size | mhz |
  14954. * |------------------------------------------------------------------|
  14955. * | center frequency 2 | center frequency 1 |
  14956. * |------------------------------------------------------------------|
  14957. * | check sum |
  14958. * |------------------------------------------------------------------|
  14959. * | payload |
  14960. * |------------------------------------------------------------------|
  14961. * message info field:
  14962. * - MSG_TYPE
  14963. * Bits 7:0
  14964. * Purpose: identifies this as a channel calibration data message
  14965. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14966. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14967. * - SUB_TYPE
  14968. * Bits 11:8
  14969. * Purpose: T2H: indicates whether target is providing chan cal data
  14970. * to the host to store, or requesting that the host
  14971. * download previously-stored data.
  14972. * H2T: indicates whether the host is providing the requested
  14973. * channel cal data, or if it is rejecting the data
  14974. * request because it does not have the requested data.
  14975. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14976. * - CHKSUM_VALID
  14977. * Bit 12
  14978. * Purpose: indicates if the checksum field is valid
  14979. * value:
  14980. * - FRAG
  14981. * Bit 19:16
  14982. * Purpose: indicates the fragment index for message
  14983. * value: 0 for first fragment, 1 for second fragment, ...
  14984. * - APPEND
  14985. * Bit 20
  14986. * Purpose: indicates if this is the last fragment
  14987. * value: 0 = final fragment, 1 = more fragments will be appended
  14988. *
  14989. * channel and payload size field
  14990. * - MHZ
  14991. * Bits 15:0
  14992. * Purpose: indicates the channel primary frequency
  14993. * Value:
  14994. * - PAYLOAD_SIZE
  14995. * Bits 31:16
  14996. * Purpose: indicates the bytes of calibration data in payload
  14997. * Value:
  14998. *
  14999. * center frequency field
  15000. * - CENTER FREQUENCY 1
  15001. * Bits 15:0
  15002. * Purpose: indicates the channel center frequency
  15003. * Value: channel center frequency, in MHz units
  15004. * - CENTER FREQUENCY 2
  15005. * Bits 31:16
  15006. * Purpose: indicates the secondary channel center frequency,
  15007. * only for 11acvht 80plus80 mode
  15008. * Value: secondary channel center frequeny, in MHz units, if applicable
  15009. *
  15010. * checksum field
  15011. * - CHECK_SUM
  15012. * Bits 31:0
  15013. * Purpose: check the payload data, it is just for this fragment.
  15014. * This is intended for the target to check that the channel
  15015. * calibration data returned by the host is the unmodified data
  15016. * that was previously provided to the host by the target.
  15017. * value: checksum of fragment payload
  15018. */
  15019. PREPACK struct htt_chan_caldata_msg {
  15020. /* DWORD 0: message info */
  15021. A_UINT32
  15022. msg_type: 8,
  15023. sub_type: 4 ,
  15024. chksum_valid: 1, /** 1:valid, 0:invalid */
  15025. reserved1: 3,
  15026. frag_idx: 4, /** fragment index for calibration data */
  15027. appending: 1, /** 0: no fragment appending,
  15028. * 1: extra fragment appending */
  15029. reserved2: 11;
  15030. /* DWORD 1: channel and payload size */
  15031. A_UINT32
  15032. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15033. payload_size: 16; /** unit: bytes */
  15034. /* DWORD 2: center frequency */
  15035. A_UINT32
  15036. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15037. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15038. * valid only for 11acvht 80plus80 mode */
  15039. /* DWORD 3: check sum */
  15040. A_UINT32 chksum;
  15041. /* variable length for calibration data */
  15042. A_UINT32 payload[1/* or more */];
  15043. } POSTPACK;
  15044. /* T2H SUBTYPE */
  15045. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15046. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15047. /* H2T SUBTYPE */
  15048. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15049. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15050. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15051. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15052. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15053. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15054. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15055. do { \
  15056. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15057. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15058. } while (0)
  15059. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15060. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15061. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15062. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15063. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15064. do { \
  15065. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15066. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15067. } while (0)
  15068. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15069. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15070. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15071. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15072. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15073. do { \
  15074. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15075. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15076. } while (0)
  15077. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15078. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15079. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15080. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15081. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15082. do { \
  15083. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15084. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15085. } while (0)
  15086. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15087. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15088. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15089. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15090. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15091. do { \
  15092. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15093. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15094. } while (0)
  15095. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15096. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15097. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15098. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15099. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15100. do { \
  15101. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15102. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15103. } while (0)
  15104. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15105. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15106. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15107. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15108. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15109. do { \
  15110. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15111. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15112. } while (0)
  15113. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15114. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15115. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15116. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15117. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15118. do { \
  15119. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15120. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15121. } while (0)
  15122. /**
  15123. * @brief target -> host FSE CMEM based send
  15124. *
  15125. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15126. *
  15127. * @details
  15128. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15129. * FSE placement in CMEM is enabled.
  15130. *
  15131. * This message sends the non-secure CMEM base address.
  15132. * It will be sent to host in response to message
  15133. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15134. * The message would appear as follows:
  15135. *
  15136. * |31 24|23 16|15 8|7 0|
  15137. * |----------------+----------------+----------------+----------------|
  15138. * | reserved | num_entries | msg_type |
  15139. * |----------------+----------------+----------------+----------------|
  15140. * | base_address_lo |
  15141. * |----------------+----------------+----------------+----------------|
  15142. * | base_address_hi |
  15143. * |-------------------------------------------------------------------|
  15144. *
  15145. * The message is interpreted as follows:
  15146. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15147. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15148. * b'8:15 - number_entries: Indicated the number of entries
  15149. * programmed.
  15150. * b'16:31 - reserved.
  15151. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15152. * CMEM base address
  15153. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15154. * CMEM base address
  15155. */
  15156. PREPACK struct htt_cmem_base_send_t {
  15157. A_UINT32 msg_type: 8,
  15158. num_entries: 8,
  15159. reserved: 16;
  15160. A_UINT32 base_address_lo;
  15161. A_UINT32 base_address_hi;
  15162. } POSTPACK;
  15163. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15164. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15165. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15166. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15167. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15168. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15169. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15170. do { \
  15171. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15172. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15173. } while (0)
  15174. /**
  15175. * @brief - HTT PPDU ID format
  15176. *
  15177. * @details
  15178. * The following field definitions describe the format of the PPDU ID.
  15179. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15180. *
  15181. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15182. * +--------------------------------------------------------------------------
  15183. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15184. * +--------------------------------------------------------------------------
  15185. *
  15186. * sch id :Schedule command id
  15187. * Bits [11 : 0] : monotonically increasing counter to track the
  15188. * PPDU posted to a specific transmit queue.
  15189. *
  15190. * hwq_id: Hardware Queue ID.
  15191. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15192. *
  15193. * mac_id: MAC ID
  15194. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15195. *
  15196. * seq_idx: Sequence index.
  15197. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15198. * a particular TXOP.
  15199. *
  15200. * tqm_cmd: HWSCH/TQM flag.
  15201. * Bit [23] : Always set to 0.
  15202. *
  15203. * seq_cmd_type: Sequence command type.
  15204. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15205. * Refer to enum HTT_STATS_FTYPE for values.
  15206. */
  15207. PREPACK struct htt_ppdu_id {
  15208. A_UINT32
  15209. sch_id: 12,
  15210. hwq_id: 5,
  15211. mac_id: 2,
  15212. seq_idx: 2,
  15213. reserved1: 2,
  15214. tqm_cmd: 1,
  15215. seq_cmd_type: 6,
  15216. reserved2: 2;
  15217. } POSTPACK;
  15218. #define HTT_PPDU_ID_SCH_ID_S 0
  15219. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15220. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15221. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15222. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15223. do { \
  15224. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15225. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15226. } while (0)
  15227. #define HTT_PPDU_ID_HWQ_ID_S 12
  15228. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15229. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15230. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15231. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15232. do { \
  15233. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15234. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15235. } while (0)
  15236. #define HTT_PPDU_ID_MAC_ID_S 17
  15237. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15238. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15239. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15240. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15241. do { \
  15242. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15243. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15244. } while (0)
  15245. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15246. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15247. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15248. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15249. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15250. do { \
  15251. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15252. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15253. } while (0)
  15254. #define HTT_PPDU_ID_TQM_CMD_S 23
  15255. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15256. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15257. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15258. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15259. do { \
  15260. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15261. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15262. } while (0)
  15263. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15264. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15265. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15266. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15267. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15268. do { \
  15269. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15270. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15271. } while (0)
  15272. /**
  15273. * @brief target -> RX PEER METADATA V0 format
  15274. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15275. * message from target, and will confirm to the target which peer metadata
  15276. * version to use in the wmi_init message.
  15277. *
  15278. * The following diagram shows the format of the RX PEER METADATA.
  15279. *
  15280. * |31 24|23 16|15 8|7 0|
  15281. * |-----------------------------------------------------------------------|
  15282. * | Reserved | VDEV ID | PEER ID |
  15283. * |-----------------------------------------------------------------------|
  15284. */
  15285. PREPACK struct htt_rx_peer_metadata_v0 {
  15286. A_UINT32
  15287. peer_id: 16,
  15288. vdev_id: 8,
  15289. reserved1: 8;
  15290. } POSTPACK;
  15291. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15292. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15293. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15294. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15295. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15296. do { \
  15297. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15298. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15299. } while (0)
  15300. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15301. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15302. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15303. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15304. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15305. do { \
  15306. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15307. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15308. } while (0)
  15309. /**
  15310. * @brief target -> RX PEER METADATA V1 format
  15311. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15312. * message from target, and will confirm to the target which peer metadata
  15313. * version to use in the wmi_init message.
  15314. *
  15315. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15316. *
  15317. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15318. * |-----------------------------------------------------------------------|
  15319. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15320. * |-----------------------------------------------------------------------|
  15321. */
  15322. PREPACK struct htt_rx_peer_metadata_v1 {
  15323. A_UINT32
  15324. peer_id: 13,
  15325. ml_peer_valid: 1,
  15326. reserved1: 2,
  15327. vdev_id: 8,
  15328. lmac_id: 2,
  15329. chip_id: 3,
  15330. reserved2: 3;
  15331. } POSTPACK;
  15332. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15333. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15334. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15335. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15336. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15337. do { \
  15338. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15339. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15340. } while (0)
  15341. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15342. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15343. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15344. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15345. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15346. do { \
  15347. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15348. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15349. } while (0)
  15350. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15351. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15352. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15353. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15354. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15355. do { \
  15356. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15357. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15358. } while (0)
  15359. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15360. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15361. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15362. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15363. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15364. do { \
  15365. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15366. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15367. } while (0)
  15368. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15369. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15370. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15371. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15372. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15373. do { \
  15374. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15375. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15376. } while (0)
  15377. /*
  15378. * In some systems, the host SW wants to specify priorities between
  15379. * different MSDU / flow queues within the same peer-TID.
  15380. * The below enums are used for the host to identify to the target
  15381. * which MSDU queue's priority it wants to adjust.
  15382. */
  15383. /*
  15384. * The MSDUQ index describe index of TCL HW, where each index is
  15385. * used for queuing particular types of MSDUs.
  15386. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15387. */
  15388. enum HTT_MSDUQ_INDEX {
  15389. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15390. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15391. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15392. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15393. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15394. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15395. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15396. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15397. HTT_MSDUQ_MAX_INDEX,
  15398. };
  15399. /* MSDU qtype definition */
  15400. enum HTT_MSDU_QTYPE {
  15401. /*
  15402. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15403. * relative priority. Instead, the relative priority of CRIT_0 versus
  15404. * CRIT_1 is controlled by the FW, through the configuration parameters
  15405. * it applies to the queues.
  15406. */
  15407. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15408. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15409. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15410. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15411. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15412. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15413. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15414. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15415. /* New MSDU_QTYPE should be added above this line */
  15416. /*
  15417. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15418. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15419. * any host/target message definitions. The QTYPE_MAX value can
  15420. * only be used internally within the host or within the target.
  15421. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15422. * it must regard the unexpected value as a default qtype value,
  15423. * or ignore it.
  15424. */
  15425. HTT_MSDU_QTYPE_MAX,
  15426. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15427. };
  15428. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15429. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15430. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15431. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15432. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15433. };
  15434. /**
  15435. * @brief target -> host mlo timestamp offset indication
  15436. *
  15437. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15438. *
  15439. * @details
  15440. * The following field definitions describe the format of the HTT target
  15441. * to host mlo timestamp offset indication message.
  15442. *
  15443. *
  15444. * |31 16|15 12|11 10|9 8|7 0 |
  15445. * |----------------------------------------------------------------------|
  15446. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15447. * |----------------------------------------------------------------------|
  15448. * | Sync time stamp lo in us |
  15449. * |----------------------------------------------------------------------|
  15450. * | Sync time stamp hi in us |
  15451. * |----------------------------------------------------------------------|
  15452. * | mlo time stamp offset lo in us |
  15453. * |----------------------------------------------------------------------|
  15454. * | mlo time stamp offset hi in us |
  15455. * |----------------------------------------------------------------------|
  15456. * | mlo time stamp offset clocks in clock ticks |
  15457. * |----------------------------------------------------------------------|
  15458. * |31 26|25 16|15 0 |
  15459. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15460. * | | compensation in clks | |
  15461. * |----------------------------------------------------------------------|
  15462. * |31 22|21 0 |
  15463. * | rsvd 3 | mlo time stamp comp timer period |
  15464. * |----------------------------------------------------------------------|
  15465. * The message is interpreted as follows:
  15466. *
  15467. * dword0 - b'0:7 - msg_type: This will be set to
  15468. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15469. * value: 0x28
  15470. *
  15471. * dword0 - b'9:8 - pdev_id
  15472. *
  15473. * dword0 - b'11:10 - chip_id
  15474. *
  15475. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15476. *
  15477. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15478. *
  15479. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15480. * which last sync interrupt was received
  15481. *
  15482. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15483. * which last sync interrupt was received
  15484. *
  15485. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15486. *
  15487. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15488. *
  15489. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15490. *
  15491. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15492. *
  15493. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15494. * for sub us resolution
  15495. *
  15496. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15497. *
  15498. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15499. * is applied, in us
  15500. *
  15501. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15502. */
  15503. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15504. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15505. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15506. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15507. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15508. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15509. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15510. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15511. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15512. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15513. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15514. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15515. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15516. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15517. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15518. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15519. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15520. do { \
  15521. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15522. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15523. } while (0)
  15524. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15525. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15526. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15527. do { \
  15528. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15529. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15530. } while (0)
  15531. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15532. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15533. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15534. do { \
  15535. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15536. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15537. } while (0)
  15538. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15539. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15540. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15541. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15542. do { \
  15543. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15544. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15545. } while (0)
  15546. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15547. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15548. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15549. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15550. do { \
  15551. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15552. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15553. } while (0)
  15554. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15555. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15556. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15557. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15558. do { \
  15559. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15560. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15561. } while (0)
  15562. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15563. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15564. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15565. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15566. do { \
  15567. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15568. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15569. } while (0)
  15570. typedef struct {
  15571. A_UINT32 msg_type: 8, /* bits 7:0 */
  15572. pdev_id: 2, /* bits 9:8 */
  15573. chip_id: 2, /* bits 11:10 */
  15574. reserved1: 4, /* bits 15:12 */
  15575. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15576. A_UINT32 sync_timestamp_lo_us;
  15577. A_UINT32 sync_timestamp_hi_us;
  15578. A_UINT32 mlo_timestamp_offset_lo_us;
  15579. A_UINT32 mlo_timestamp_offset_hi_us;
  15580. A_UINT32 mlo_timestamp_offset_clks;
  15581. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15582. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15583. reserved2: 6; /* bits 31:26 */
  15584. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15585. reserved3: 10; /* bits 31:22 */
  15586. } htt_t2h_mlo_offset_ind_t;
  15587. /*
  15588. * @brief target -> host VDEV TX RX STATS
  15589. *
  15590. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15591. *
  15592. * @details
  15593. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15594. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15595. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15596. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15597. * periodically by target even in the absence of any further HTT request
  15598. * messages from host.
  15599. *
  15600. * The message is formatted as follows:
  15601. *
  15602. * |31 16|15 8|7 0|
  15603. * |---------------------------------+----------------+----------------|
  15604. * | payload_size | pdev_id | msg_type |
  15605. * |---------------------------------+----------------+----------------|
  15606. * | reserved0 |
  15607. * |-------------------------------------------------------------------|
  15608. * | reserved1 |
  15609. * |-------------------------------------------------------------------|
  15610. * | reserved2 |
  15611. * |-------------------------------------------------------------------|
  15612. * | |
  15613. * | VDEV specific Tx Rx stats info |
  15614. * | |
  15615. * |-------------------------------------------------------------------|
  15616. *
  15617. * The message is interpreted as follows:
  15618. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15619. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15620. * b'8:15 - pdev_id
  15621. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15622. * message header fields (msg_type through reserved2)
  15623. * dword1 - b'0:31 - reserved0.
  15624. * dword2 - b'0:31 - reserved1.
  15625. * dword3 - b'0:31 - reserved2.
  15626. */
  15627. typedef struct {
  15628. A_UINT32 msg_type: 8,
  15629. pdev_id: 8,
  15630. payload_size: 16;
  15631. A_UINT32 reserved0;
  15632. A_UINT32 reserved1;
  15633. A_UINT32 reserved2;
  15634. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15635. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15636. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15637. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15638. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15639. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15640. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15641. do { \
  15642. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15643. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15644. } while (0)
  15645. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15646. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15647. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15648. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15649. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15650. do { \
  15651. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15652. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15653. } while (0)
  15654. /* SOC related stats */
  15655. typedef struct {
  15656. htt_tlv_hdr_t tlv_hdr;
  15657. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15658. * This can be due to either the peer is deleted or deletion is ongoing
  15659. * */
  15660. A_UINT32 inv_peers_msdu_drop_count_lo;
  15661. A_UINT32 inv_peers_msdu_drop_count_hi;
  15662. } htt_t2h_soc_txrx_stats_common_tlv;
  15663. /* VDEV HW Tx/Rx stats */
  15664. typedef struct {
  15665. htt_tlv_hdr_t tlv_hdr;
  15666. A_UINT32 vdev_id;
  15667. /* Rx msdu byte cnt */
  15668. A_UINT32 rx_msdu_byte_cnt_lo;
  15669. A_UINT32 rx_msdu_byte_cnt_hi;
  15670. /* Rx msdu cnt */
  15671. A_UINT32 rx_msdu_cnt_lo;
  15672. A_UINT32 rx_msdu_cnt_hi;
  15673. /* tx msdu byte cnt */
  15674. A_UINT32 tx_msdu_byte_cnt_lo;
  15675. A_UINT32 tx_msdu_byte_cnt_hi;
  15676. /* tx msdu cnt */
  15677. A_UINT32 tx_msdu_cnt_lo;
  15678. A_UINT32 tx_msdu_cnt_hi;
  15679. /* tx excessive retry discarded msdu cnt */
  15680. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15681. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15682. /* TX congestion ctrl msdu drop cnt */
  15683. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15684. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15685. /* discarded tx msdus cnt coz of time to live expiry */
  15686. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15687. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15688. /* tx excessive retry discarded msdu byte cnt */
  15689. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15690. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15691. /* TX congestion ctrl msdu drop byte cnt */
  15692. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15693. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15694. /* discarded tx msdus byte cnt coz of time to live expiry */
  15695. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15696. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15697. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15698. /*
  15699. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15700. *
  15701. * @details
  15702. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  15703. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  15704. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  15705. * the default MSDU queues of the peer-TID specified in the
  15706. * SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  15707. * If the default MSDU queues of the specified peer-TID are not linked to
  15708. * a service class, the status field of the SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15709. * will specify that no such mapping exists of the default MSDU queues to a
  15710. * service class.
  15711. *
  15712. * |31 16|15 12|11 8|7 0|
  15713. * |------------------------------+------+-------+--------------|
  15714. * | peer ID | rsvd | TID | msg type |
  15715. * |------------------------------+--------------+--------------|
  15716. * | reserved | svc class ID | status |
  15717. * |------------------------------------------------------------|
  15718. * Header fields:
  15719. * dword0 - b'7:0 - msg_type: This will be set to
  15720. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  15721. * b'11:8 - TID
  15722. * b'31:16 - peer ID
  15723. * dword1 - b'7:0 - status (htt_t2h_sawf_def_queues_map_report_status)
  15724. * b'15:8 - svc class ID (only valid if status == MAPPED)
  15725. */
  15726. enum htt_t2h_sawf_def_queues_map_report_status {
  15727. /* MAPPED:
  15728. * The default MSDU queues for the peer-TID are linked to a service class.
  15729. * The svc_class_id field shows which service class the default MSDU queues
  15730. * are associated with.
  15731. */
  15732. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_MAPPED = 0,
  15733. /* UNMAPPED:
  15734. * The default MSDU queues for the peer-TID are not linked to any
  15735. * service class.
  15736. */
  15737. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_UNMAPPED = 1,
  15738. /* INVALID_IDS:
  15739. * One or more of pdev_id, vdev_id, peer_id, and TID were invalid.
  15740. */
  15741. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_INVALID_IDS = 2,
  15742. };
  15743. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  15744. A_UINT32 msg_type :8,
  15745. tid :4,
  15746. reserved0 :4,
  15747. peer_id :16;
  15748. A_UINT32 status :8,
  15749. svc_class_id :8,
  15750. reserved1 :16;
  15751. } POSTPACK;
  15752. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_BYTES 8
  15753. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x00000F00
  15754. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 8
  15755. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  15756. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  15757. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  15758. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  15759. do { \
  15760. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  15761. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S));\
  15762. } while (0)
  15763. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  15764. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  15765. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  15766. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  15767. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  15768. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  15769. do { \
  15770. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  15771. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  15772. } while (0)
  15773. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M 0x000000FF
  15774. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S 0
  15775. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_GET(_var) \
  15776. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M) >> \
  15777. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)
  15778. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_SET(_var, _val) \
  15779. do { \
  15780. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS, _val); \
  15781. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)); \
  15782. } while (0)
  15783. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  15784. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  15785. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  15786. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  15787. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  15788. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  15789. do { \
  15790. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  15791. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  15792. } while (0)
  15793. #endif