htt.h 789 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210
  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. */
  218. #define HTT_CURRENT_VERSION_MAJOR 3
  219. #define HTT_CURRENT_VERSION_MINOR 98
  220. #define HTT_NUM_TX_FRAG_DESC 1024
  221. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  222. #define HTT_CHECK_SET_VAL(field, val) \
  223. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  224. /* macros to assist in sign-extending fields from HTT messages */
  225. #define HTT_SIGN_BIT_MASK(field) \
  226. ((field ## _M + (1 << field ## _S)) >> 1)
  227. #define HTT_SIGN_BIT(_val, field) \
  228. (_val & HTT_SIGN_BIT_MASK(field))
  229. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  230. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  231. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  232. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  233. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  234. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  235. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  236. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  237. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  238. /*
  239. * TEMPORARY:
  240. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  241. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  242. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  243. * updated.
  244. */
  245. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  246. /*
  247. * TEMPORARY:
  248. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  249. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  250. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  251. * updated.
  252. */
  253. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  254. /*
  255. * htt_dbg_stats_type -
  256. * bit positions for each stats type within a stats type bitmask
  257. * The bitmask contains 24 bits.
  258. */
  259. enum htt_dbg_stats_type {
  260. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  261. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  262. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  263. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  264. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  265. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  266. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  267. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  268. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  269. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  270. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  271. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  272. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  273. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  274. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  275. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  276. /* bits 16-23 currently reserved */
  277. /* keep this last */
  278. HTT_DBG_NUM_STATS
  279. };
  280. /*=== HTT option selection TLVs ===
  281. * Certain HTT messages have alternatives or options.
  282. * For such cases, the host and target need to agree on which option to use.
  283. * Option specification TLVs can be appended to the VERSION_REQ and
  284. * VERSION_CONF messages to select options other than the default.
  285. * These TLVs are entirely optional - if they are not provided, there is a
  286. * well-defined default for each option. If they are provided, they can be
  287. * provided in any order. Each TLV can be present or absent independent of
  288. * the presence / absence of other TLVs.
  289. *
  290. * The HTT option selection TLVs use the following format:
  291. * |31 16|15 8|7 0|
  292. * |---------------------------------+----------------+----------------|
  293. * | value (payload) | length | tag |
  294. * |-------------------------------------------------------------------|
  295. * The value portion need not be only 2 bytes; it can be extended by any
  296. * integer number of 4-byte units. The total length of the TLV, including
  297. * the tag and length fields, must be a multiple of 4 bytes. The length
  298. * field specifies the total TLV size in 4-byte units. Thus, the typical
  299. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  300. * field, would store 0x1 in its length field, to show that the TLV occupies
  301. * a single 4-byte unit.
  302. */
  303. /*--- TLV header format - applies to all HTT option TLVs ---*/
  304. enum HTT_OPTION_TLV_TAGS {
  305. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  306. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  307. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  308. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  309. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  310. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  311. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  312. };
  313. PREPACK struct htt_option_tlv_header_t {
  314. A_UINT8 tag;
  315. A_UINT8 length;
  316. } POSTPACK;
  317. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  318. #define HTT_OPTION_TLV_TAG_S 0
  319. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  320. #define HTT_OPTION_TLV_LENGTH_S 8
  321. /*
  322. * value0 - 16 bit value field stored in word0
  323. * The TLV's value field may be longer than 2 bytes, in which case
  324. * the remainder of the value is stored in word1, word2, etc.
  325. */
  326. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  327. #define HTT_OPTION_TLV_VALUE0_S 16
  328. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  329. do { \
  330. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  331. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  332. } while (0)
  333. #define HTT_OPTION_TLV_TAG_GET(word) \
  334. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  335. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  336. do { \
  337. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  338. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  339. } while (0)
  340. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  341. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  342. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  348. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  349. /*--- format of specific HTT option TLVs ---*/
  350. /*
  351. * HTT option TLV for specifying LL bus address size
  352. * Some chips require bus addresses used by the target to access buffers
  353. * within the host's memory to be 32 bits; others require bus addresses
  354. * used by the target to access buffers within the host's memory to be
  355. * 64 bits.
  356. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  357. * a suffix to the VERSION_CONF message to specify which bus address format
  358. * the target requires.
  359. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  360. * default to providing bus addresses to the target in 32-bit format.
  361. */
  362. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  363. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  364. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  365. };
  366. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  367. struct htt_option_tlv_header_t hdr;
  368. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  369. } POSTPACK;
  370. /*
  371. * HTT option TLV for specifying whether HL systems should indicate
  372. * over-the-air tx completion for individual frames, or should instead
  373. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  374. * requests an OTA tx completion for a particular tx frame.
  375. * This option does not apply to LL systems, where the TX_COMPL_IND
  376. * is mandatory.
  377. * This option is primarily intended for HL systems in which the tx frame
  378. * downloads over the host --> target bus are as slow as or slower than
  379. * the transmissions over the WLAN PHY. For cases where the bus is faster
  380. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  381. * and consquently will send one TX_COMPL_IND message that covers several
  382. * tx frames. For cases where the WLAN PHY is faster than the bus,
  383. * the target will end up transmitting very short A-MPDUs, and consequently
  384. * sending many TX_COMPL_IND messages, which each cover a very small number
  385. * of tx frames.
  386. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  387. * a suffix to the VERSION_REQ message to request whether the host desires to
  388. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  389. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  390. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  391. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  392. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  393. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  394. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  395. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  396. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  397. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  398. * TLV.
  399. */
  400. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  401. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  402. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  403. };
  404. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  405. struct htt_option_tlv_header_t hdr;
  406. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  407. } POSTPACK;
  408. /*
  409. * HTT option TLV for specifying how many tx queue groups the target
  410. * may establish.
  411. * This TLV specifies the maximum value the target may send in the
  412. * txq_group_id field of any TXQ_GROUP information elements sent by
  413. * the target to the host. This allows the host to pre-allocate an
  414. * appropriate number of tx queue group structs.
  415. *
  416. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  417. * a suffix to the VERSION_REQ message to specify whether the host supports
  418. * tx queue groups at all, and if so if there is any limit on the number of
  419. * tx queue groups that the host supports.
  420. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  421. * a suffix to the VERSION_CONF message. If the host has specified in the
  422. * VER_REQ message a limit on the number of tx queue groups the host can
  423. * supprt, the target shall limit its specification of the maximum tx groups
  424. * to be no larger than this host-specified limit.
  425. *
  426. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  427. * shall preallocate 4 tx queue group structs, and the target shall not
  428. * specify a txq_group_id larger than 3.
  429. */
  430. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  432. /*
  433. * values 1 through N specify the max number of tx queue groups
  434. * the sender supports
  435. */
  436. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  437. };
  438. /* TEMPORARY backwards-compatibility alias for a typo fix -
  439. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  440. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  441. * to support the old name (with the typo) until all references to the
  442. * old name are replaced with the new name.
  443. */
  444. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  445. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  446. struct htt_option_tlv_header_t hdr;
  447. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  448. } POSTPACK;
  449. /*
  450. * HTT option TLV for specifying whether the target supports an extended
  451. * version of the HTT tx descriptor. If the target provides this TLV
  452. * and specifies in the TLV that the target supports an extended version
  453. * of the HTT tx descriptor, the target must check the "extension" bit in
  454. * the HTT tx descriptor, and if the extension bit is set, to expect a
  455. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  456. * descriptor. Furthermore, the target must provide room for the HTT
  457. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  458. * This option is intended for systems where the host needs to explicitly
  459. * control the transmission parameters such as tx power for individual
  460. * tx frames.
  461. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  462. * as a suffix to the VERSION_CONF message to explicitly specify whether
  463. * the target supports the HTT tx MSDU extension descriptor.
  464. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  465. * by the host as lack of target support for the HTT tx MSDU extension
  466. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  467. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  468. * the HTT tx MSDU extension descriptor.
  469. * The host is not required to provide the HTT tx MSDU extension descriptor
  470. * just because the target supports it; the target must check the
  471. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  472. * extension descriptor is present.
  473. */
  474. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  475. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  476. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  477. };
  478. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  479. struct htt_option_tlv_header_t hdr;
  480. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  481. } POSTPACK;
  482. /*
  483. * For the tcl data command V2 and higher support added a new
  484. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  485. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  486. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  487. * HTT option TLV for specifying which version of the TCL metadata struct
  488. * should be used:
  489. * V1 -> use htt_tx_tcl_metadata struct
  490. * V2 -> use htt_tx_tcl_metadata_v2 struct
  491. * Old FW will only support V1.
  492. * New FW will support V2. New FW will still support V1, at least during
  493. * a transition period.
  494. * Similarly, old host will only support V1, and new host will support V1 + V2.
  495. *
  496. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  497. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  498. * of TCL metadata the host supports. If the host doesn't provide a
  499. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  500. * is implicitly understood that the host only supports V1.
  501. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  502. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  503. * the host shall use. The target shall only select one of the versions
  504. * supported by the host. If the target doesn't provide a
  505. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  506. * is implicitly understood that the V1 TCL metadata shall be used.
  507. */
  508. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  509. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  510. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  511. };
  512. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  513. struct htt_option_tlv_header_t hdr;
  514. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  515. } POSTPACK;
  516. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  517. HTT_OPTION_TLV_VALUE0_SET(word, value)
  518. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  519. HTT_OPTION_TLV_VALUE0_GET(word)
  520. typedef struct {
  521. union {
  522. /* BIT [11 : 0] :- tag
  523. * BIT [23 : 12] :- length
  524. * BIT [31 : 24] :- reserved
  525. */
  526. A_UINT32 tag__length;
  527. /*
  528. * The following struct is not endian-portable.
  529. * It is suitable for use within the target, which is known to be
  530. * little-endian.
  531. * The host should use the above endian-portable macros to access
  532. * the tag and length bitfields in an endian-neutral manner.
  533. */
  534. struct {
  535. A_UINT32 tag : 12, /* BIT [11 : 0] */
  536. length : 12, /* BIT [23 : 12] */
  537. reserved : 8; /* BIT [31 : 24] */
  538. };
  539. };
  540. } htt_tlv_hdr_t;
  541. typedef enum {
  542. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  543. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  544. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  545. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  546. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  547. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  548. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  549. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  550. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  551. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  552. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  553. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  554. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  555. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  556. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  557. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  558. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  559. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  560. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  561. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  562. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  563. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  564. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  565. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  566. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  567. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  568. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  569. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  570. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  571. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  572. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  573. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  574. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  575. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  576. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  577. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  578. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  579. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  580. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  581. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  582. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  583. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  584. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  585. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  586. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  587. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  588. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  589. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  590. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  591. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  592. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  593. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  594. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  595. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  596. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  597. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  598. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  599. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  600. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  601. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  602. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  603. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  604. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  605. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  606. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  607. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  608. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  609. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  610. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  611. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  612. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  613. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  614. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  615. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  616. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  617. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  618. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  619. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  620. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  621. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  622. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  623. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  624. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  625. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  626. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  627. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  628. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  629. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  630. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  631. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  632. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  633. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  634. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  635. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  636. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  637. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  638. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  639. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  640. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  641. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  642. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  643. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  644. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  645. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  646. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  647. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  648. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  649. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  650. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  651. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  652. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  653. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  654. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  655. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  656. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  657. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  658. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  659. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  660. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  661. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  662. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  663. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  664. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  665. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  666. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  667. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  668. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  669. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  670. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  671. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  672. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  673. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  674. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  675. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  676. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  677. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  678. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  679. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  680. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  681. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  682. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  683. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  684. HTT_STATS_MAX_TAG,
  685. } htt_tlv_tag_t;
  686. #define HTT_STATS_TLV_TAG_M 0x00000fff
  687. #define HTT_STATS_TLV_TAG_S 0
  688. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  689. #define HTT_STATS_TLV_LENGTH_S 12
  690. #define HTT_STATS_TLV_TAG_GET(_var) \
  691. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  692. HTT_STATS_TLV_TAG_S)
  693. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  694. do { \
  695. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  696. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  697. } while (0)
  698. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  699. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  700. HTT_STATS_TLV_LENGTH_S)
  701. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  702. do { \
  703. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  704. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  705. } while (0)
  706. /*=== host -> target messages ===============================================*/
  707. enum htt_h2t_msg_type {
  708. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  709. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  710. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  711. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  712. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  713. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  714. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  715. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  716. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  717. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  718. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  719. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  720. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  721. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  722. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  723. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  724. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  725. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  726. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  727. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  728. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  729. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  730. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  731. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  732. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  733. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  734. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  735. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  736. /* keep this last */
  737. HTT_H2T_NUM_MSGS
  738. };
  739. /*
  740. * HTT host to target message type -
  741. * stored in bits 7:0 of the first word of the message
  742. */
  743. #define HTT_H2T_MSG_TYPE_M 0xff
  744. #define HTT_H2T_MSG_TYPE_S 0
  745. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  746. do { \
  747. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  748. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  749. } while (0)
  750. #define HTT_H2T_MSG_TYPE_GET(word) \
  751. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  752. /**
  753. * @brief host -> target version number request message definition
  754. *
  755. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  756. *
  757. *
  758. * |31 24|23 16|15 8|7 0|
  759. * |----------------+----------------+----------------+----------------|
  760. * | reserved | msg type |
  761. * |-------------------------------------------------------------------|
  762. * : option request TLV (optional) |
  763. * :...................................................................:
  764. *
  765. * The VER_REQ message may consist of a single 4-byte word, or may be
  766. * extended with TLVs that specify which HTT options the host is requesting
  767. * from the target.
  768. * The following option TLVs may be appended to the VER_REQ message:
  769. * - HL_SUPPRESS_TX_COMPL_IND
  770. * - HL_MAX_TX_QUEUE_GROUPS
  771. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  772. * may be appended to the VER_REQ message (but only one TLV of each type).
  773. *
  774. * Header fields:
  775. * - MSG_TYPE
  776. * Bits 7:0
  777. * Purpose: identifies this as a version number request message
  778. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  779. */
  780. #define HTT_VER_REQ_BYTES 4
  781. /* TBDXXX: figure out a reasonable number */
  782. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  783. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  784. /**
  785. * @brief HTT tx MSDU descriptor
  786. *
  787. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  788. *
  789. * @details
  790. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  791. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  792. * the target firmware needs for the FW's tx processing, particularly
  793. * for creating the HW msdu descriptor.
  794. * The same HTT tx descriptor is used for HL and LL systems, though
  795. * a few fields within the tx descriptor are used only by LL or
  796. * only by HL.
  797. * The HTT tx descriptor is defined in two manners: by a struct with
  798. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  799. * definitions.
  800. * The target should use the struct def, for simplicitly and clarity,
  801. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  802. * neutral. Specifically, the host shall use the get/set macros built
  803. * around the mask + shift defs.
  804. */
  805. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  806. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  807. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  808. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  809. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  810. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  811. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  812. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  813. #define HTT_TX_VDEV_ID_WORD 0
  814. #define HTT_TX_VDEV_ID_MASK 0x3f
  815. #define HTT_TX_VDEV_ID_SHIFT 16
  816. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  817. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  818. #define HTT_TX_MSDU_LEN_DWORD 1
  819. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  820. /*
  821. * HTT_VAR_PADDR macros
  822. * Allow physical / bus addresses to be either a single 32-bit value,
  823. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  824. */
  825. #define HTT_VAR_PADDR32(var_name) \
  826. A_UINT32 var_name
  827. #define HTT_VAR_PADDR64_LE(var_name) \
  828. struct { \
  829. /* little-endian: lo precedes hi */ \
  830. A_UINT32 lo; \
  831. A_UINT32 hi; \
  832. } var_name
  833. /*
  834. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  835. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  836. * addresses are stored in a XXX-bit field.
  837. * This macro is used to define both htt_tx_msdu_desc32_t and
  838. * htt_tx_msdu_desc64_t structs.
  839. */
  840. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  841. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  842. { \
  843. /* DWORD 0: flags and meta-data */ \
  844. A_UINT32 \
  845. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  846. \
  847. /* pkt_subtype - \
  848. * Detailed specification of the tx frame contents, extending the \
  849. * general specification provided by pkt_type. \
  850. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  851. * pkt_type | pkt_subtype \
  852. * ============================================================== \
  853. * 802.3 | bit 0:3 - Reserved \
  854. * | bit 4: 0x0 - Copy-Engine Classification Results \
  855. * | not appended to the HTT message \
  856. * | 0x1 - Copy-Engine Classification Results \
  857. * | appended to the HTT message in the \
  858. * | format: \
  859. * | [HTT tx desc, frame header, \
  860. * | CE classification results] \
  861. * | The CE classification results begin \
  862. * | at the next 4-byte boundary after \
  863. * | the frame header. \
  864. * ------------+------------------------------------------------- \
  865. * Eth2 | bit 0:3 - Reserved \
  866. * | bit 4: 0x0 - Copy-Engine Classification Results \
  867. * | not appended to the HTT message \
  868. * | 0x1 - Copy-Engine Classification Results \
  869. * | appended to the HTT message. \
  870. * | See the above specification of the \
  871. * | CE classification results location. \
  872. * ------------+------------------------------------------------- \
  873. * native WiFi | bit 0:3 - Reserved \
  874. * | bit 4: 0x0 - Copy-Engine Classification Results \
  875. * | not appended to the HTT message \
  876. * | 0x1 - Copy-Engine Classification Results \
  877. * | appended to the HTT message. \
  878. * | See the above specification of the \
  879. * | CE classification results location. \
  880. * ------------+------------------------------------------------- \
  881. * mgmt | 0x0 - 802.11 MAC header absent \
  882. * | 0x1 - 802.11 MAC header present \
  883. * ------------+------------------------------------------------- \
  884. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  885. * | 0x1 - 802.11 MAC header present \
  886. * | bit 1: 0x0 - allow aggregation \
  887. * | 0x1 - don't allow aggregation \
  888. * | bit 2: 0x0 - perform encryption \
  889. * | 0x1 - don't perform encryption \
  890. * | bit 3: 0x0 - perform tx classification / queuing \
  891. * | 0x1 - don't perform tx classification; \
  892. * | insert the frame into the "misc" \
  893. * | tx queue \
  894. * | bit 4: 0x0 - Copy-Engine Classification Results \
  895. * | not appended to the HTT message \
  896. * | 0x1 - Copy-Engine Classification Results \
  897. * | appended to the HTT message. \
  898. * | See the above specification of the \
  899. * | CE classification results location. \
  900. */ \
  901. pkt_subtype: 5, \
  902. \
  903. /* pkt_type - \
  904. * General specification of the tx frame contents. \
  905. * The htt_pkt_type enum should be used to specify and check the \
  906. * value of this field. \
  907. */ \
  908. pkt_type: 3, \
  909. \
  910. /* vdev_id - \
  911. * ID for the vdev that is sending this tx frame. \
  912. * For certain non-standard packet types, e.g. pkt_type == raw \
  913. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  914. * This field is used primarily for determining where to queue \
  915. * broadcast and multicast frames. \
  916. */ \
  917. vdev_id: 6, \
  918. /* ext_tid - \
  919. * The extended traffic ID. \
  920. * If the TID is unknown, the extended TID is set to \
  921. * HTT_TX_EXT_TID_INVALID. \
  922. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  923. * value of the QoS TID. \
  924. * If the tx frame is non-QoS data, then the extended TID is set to \
  925. * HTT_TX_EXT_TID_NON_QOS. \
  926. * If the tx frame is multicast or broadcast, then the extended TID \
  927. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  928. */ \
  929. ext_tid: 5, \
  930. \
  931. /* postponed - \
  932. * This flag indicates whether the tx frame has been downloaded to \
  933. * the target before but discarded by the target, and now is being \
  934. * downloaded again; or if this is a new frame that is being \
  935. * downloaded for the first time. \
  936. * This flag allows the target to determine the correct order for \
  937. * transmitting new vs. old frames. \
  938. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  939. * This flag only applies to HL systems, since in LL systems, \
  940. * the tx flow control is handled entirely within the target. \
  941. */ \
  942. postponed: 1, \
  943. \
  944. /* extension - \
  945. * This flag indicates whether a HTT tx MSDU extension descriptor \
  946. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  947. * \
  948. * 0x0 - no extension MSDU descriptor is present \
  949. * 0x1 - an extension MSDU descriptor immediately follows the \
  950. * regular MSDU descriptor \
  951. */ \
  952. extension: 1, \
  953. \
  954. /* cksum_offload - \
  955. * This flag indicates whether checksum offload is enabled or not \
  956. * for this frame. Target FW use this flag to turn on HW checksumming \
  957. * 0x0 - No checksum offload \
  958. * 0x1 - L3 header checksum only \
  959. * 0x2 - L4 checksum only \
  960. * 0x3 - L3 header checksum + L4 checksum \
  961. */ \
  962. cksum_offload: 2, \
  963. \
  964. /* tx_comp_req - \
  965. * This flag indicates whether Tx Completion \
  966. * from fw is required or not. \
  967. * This flag is only relevant if tx completion is not \
  968. * universally enabled. \
  969. * For all LL systems, tx completion is mandatory, \
  970. * so this flag will be irrelevant. \
  971. * For HL systems tx completion is optional, but HL systems in which \
  972. * the bus throughput exceeds the WLAN throughput will \
  973. * probably want to always use tx completion, and thus \
  974. * would not check this flag. \
  975. * This flag is required when tx completions are not used universally, \
  976. * but are still required for certain tx frames for which \
  977. * an OTA delivery acknowledgment is needed by the host. \
  978. * In practice, this would be for HL systems in which the \
  979. * bus throughput is less than the WLAN throughput. \
  980. * \
  981. * 0x0 - Tx Completion Indication from Fw not required \
  982. * 0x1 - Tx Completion Indication from Fw is required \
  983. */ \
  984. tx_compl_req: 1; \
  985. \
  986. \
  987. /* DWORD 1: MSDU length and ID */ \
  988. A_UINT32 \
  989. len: 16, /* MSDU length, in bytes */ \
  990. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  991. * and this id is used to calculate fragmentation \
  992. * descriptor pointer inside the target based on \
  993. * the base address, configured inside the target. \
  994. */ \
  995. \
  996. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  997. /* frags_desc_ptr - \
  998. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  999. * where the tx frame's fragments reside in memory. \
  1000. * This field only applies to LL systems, since in HL systems the \
  1001. * (degenerate single-fragment) fragmentation descriptor is created \
  1002. * within the target. \
  1003. */ \
  1004. _paddr__frags_desc_ptr_; \
  1005. \
  1006. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1007. /* \
  1008. * Peer ID : Target can use this value to know which peer-id packet \
  1009. * destined to. \
  1010. * It's intended to be specified by host in case of NAWDS. \
  1011. */ \
  1012. A_UINT16 peerid; \
  1013. \
  1014. /* \
  1015. * Channel frequency: This identifies the desired channel \
  1016. * frequency (in mhz) for tx frames. This is used by FW to help \
  1017. * determine when it is safe to transmit or drop frames for \
  1018. * off-channel operation. \
  1019. * The default value of zero indicates to FW that the corresponding \
  1020. * VDEV's home channel (if there is one) is the desired channel \
  1021. * frequency. \
  1022. */ \
  1023. A_UINT16 chanfreq; \
  1024. \
  1025. /* Reason reserved is commented is increasing the htt structure size \
  1026. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1027. * A_UINT32 reserved_dword3_bits0_31; \
  1028. */ \
  1029. } POSTPACK
  1030. /* define a htt_tx_msdu_desc32_t type */
  1031. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1032. /* define a htt_tx_msdu_desc64_t type */
  1033. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1034. /*
  1035. * Make htt_tx_msdu_desc_t be an alias for either
  1036. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1037. */
  1038. #if HTT_PADDR64
  1039. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1040. #else
  1041. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1042. #endif
  1043. /* decriptor information for Management frame*/
  1044. /*
  1045. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1046. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1047. */
  1048. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1049. extern A_UINT32 mgmt_hdr_len;
  1050. PREPACK struct htt_mgmt_tx_desc_t {
  1051. A_UINT32 msg_type;
  1052. #if HTT_PADDR64
  1053. A_UINT64 frag_paddr; /* DMAble address of the data */
  1054. #else
  1055. A_UINT32 frag_paddr; /* DMAble address of the data */
  1056. #endif
  1057. A_UINT32 desc_id; /* returned to host during completion
  1058. * to free the meory*/
  1059. A_UINT32 len; /* Fragment length */
  1060. A_UINT32 vdev_id; /* virtual device ID*/
  1061. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1062. } POSTPACK;
  1063. PREPACK struct htt_mgmt_tx_compl_ind {
  1064. A_UINT32 desc_id;
  1065. A_UINT32 status;
  1066. } POSTPACK;
  1067. /*
  1068. * This SDU header size comes from the summation of the following:
  1069. * 1. Max of:
  1070. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1071. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1072. * b. 802.11 header, for raw frames: 36 bytes
  1073. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1074. * QoS header, HT header)
  1075. * c. 802.3 header, for ethernet frames: 14 bytes
  1076. * (destination address, source address, ethertype / length)
  1077. * 2. Max of:
  1078. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1079. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1080. * 3. 802.1Q VLAN header: 4 bytes
  1081. * 4. LLC/SNAP header: 8 bytes
  1082. */
  1083. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1084. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1085. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1086. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1087. A_COMPILE_TIME_ASSERT(
  1088. htt_encap_hdr_size_max_check_nwifi,
  1089. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1090. A_COMPILE_TIME_ASSERT(
  1091. htt_encap_hdr_size_max_check_enet,
  1092. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1093. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1094. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1095. #define HTT_TX_HDR_SIZE_802_1Q 4
  1096. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1097. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1098. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1099. HTT_TX_HDR_SIZE_802_1Q + \
  1100. HTT_TX_HDR_SIZE_LLC_SNAP)
  1101. #define HTT_HL_TX_FRM_HDR_LEN \
  1102. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1103. #define HTT_LL_TX_FRM_HDR_LEN \
  1104. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1105. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1106. /* dword 0 */
  1107. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1108. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1109. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1110. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1111. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1112. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1113. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1114. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1115. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1116. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1117. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1118. #define HTT_TX_DESC_PKT_TYPE_S 13
  1119. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1120. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1121. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1122. #define HTT_TX_DESC_VDEV_ID_S 16
  1123. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1124. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1125. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1126. #define HTT_TX_DESC_EXT_TID_S 22
  1127. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1128. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1129. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1130. #define HTT_TX_DESC_POSTPONED_S 27
  1131. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1132. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1133. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1134. #define HTT_TX_DESC_EXTENSION_S 28
  1135. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1136. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1137. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1138. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1139. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1140. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1141. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1142. #define HTT_TX_DESC_TX_COMP_S 31
  1143. /* dword 1 */
  1144. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1145. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1146. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1147. #define HTT_TX_DESC_FRM_LEN_S 0
  1148. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1149. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1150. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1151. #define HTT_TX_DESC_FRM_ID_S 16
  1152. /* dword 2 */
  1153. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1154. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1155. /* for systems using 64-bit format for bus addresses */
  1156. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1157. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1158. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1159. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1160. /* for systems using 32-bit format for bus addresses */
  1161. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1162. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1163. /* dword 3 */
  1164. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1165. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1166. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1167. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1168. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1169. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1170. #if HTT_PADDR64
  1171. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1172. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1173. #else
  1174. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1175. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1176. #endif
  1177. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1178. #define HTT_TX_DESC_PEER_ID_S 0
  1179. /*
  1180. * TEMPORARY:
  1181. * The original definitions for the PEER_ID fields contained typos
  1182. * (with _DESC_PADDR appended to this PEER_ID field name).
  1183. * Retain deprecated original names for PEER_ID fields until all code that
  1184. * refers to them has been updated.
  1185. */
  1186. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1187. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1188. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1189. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1190. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1191. HTT_TX_DESC_PEER_ID_M
  1192. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1193. HTT_TX_DESC_PEER_ID_S
  1194. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1195. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1196. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1197. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1198. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1199. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1200. #if HTT_PADDR64
  1201. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1202. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1203. #else
  1204. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1205. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1206. #endif
  1207. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1208. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1209. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1210. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1211. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1212. do { \
  1213. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1214. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1215. } while (0)
  1216. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1217. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1218. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1219. do { \
  1220. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1221. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1222. } while (0)
  1223. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1224. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1225. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1226. do { \
  1227. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1228. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1229. } while (0)
  1230. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1231. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1232. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1233. do { \
  1234. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1235. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1236. } while (0)
  1237. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1238. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1239. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1240. do { \
  1241. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1242. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1243. } while (0)
  1244. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1245. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1246. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1247. do { \
  1248. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1249. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1250. } while (0)
  1251. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1252. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1253. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1254. do { \
  1255. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1256. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1257. } while (0)
  1258. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1259. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1260. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1261. do { \
  1262. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1263. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1264. } while (0)
  1265. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1266. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1267. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1271. } while (0)
  1272. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1273. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1274. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1278. } while (0)
  1279. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1280. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1281. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1285. } while (0)
  1286. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1287. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1288. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1292. } while (0)
  1293. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1294. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1295. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1299. } while (0)
  1300. /* enums used in the HTT tx MSDU extension descriptor */
  1301. enum {
  1302. htt_tx_guard_interval_regular = 0,
  1303. htt_tx_guard_interval_short = 1,
  1304. };
  1305. enum {
  1306. htt_tx_preamble_type_ofdm = 0,
  1307. htt_tx_preamble_type_cck = 1,
  1308. htt_tx_preamble_type_ht = 2,
  1309. htt_tx_preamble_type_vht = 3,
  1310. };
  1311. enum {
  1312. htt_tx_bandwidth_5MHz = 0,
  1313. htt_tx_bandwidth_10MHz = 1,
  1314. htt_tx_bandwidth_20MHz = 2,
  1315. htt_tx_bandwidth_40MHz = 3,
  1316. htt_tx_bandwidth_80MHz = 4,
  1317. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1318. };
  1319. /**
  1320. * @brief HTT tx MSDU extension descriptor
  1321. * @details
  1322. * If the target supports HTT tx MSDU extension descriptors, the host has
  1323. * the option of appending the following struct following the regular
  1324. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1325. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1326. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1327. * tx specs for each frame.
  1328. */
  1329. PREPACK struct htt_tx_msdu_desc_ext_t {
  1330. /* DWORD 0: flags */
  1331. A_UINT32
  1332. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1333. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1334. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1335. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1336. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1337. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1338. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1339. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1340. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1341. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1342. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1343. /* DWORD 1: tx power, tx rate, tx BW */
  1344. A_UINT32
  1345. /* pwr -
  1346. * Specify what power the tx frame needs to be transmitted at.
  1347. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1348. * The value needs to be appropriately sign-extended when extracting
  1349. * the value from the message and storing it in a variable that is
  1350. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1351. * automatically handles this sign-extension.)
  1352. * If the transmission uses multiple tx chains, this power spec is
  1353. * the total transmit power, assuming incoherent combination of
  1354. * per-chain power to produce the total power.
  1355. */
  1356. pwr: 8,
  1357. /* mcs_mask -
  1358. * Specify the allowable values for MCS index (modulation and coding)
  1359. * to use for transmitting the frame.
  1360. *
  1361. * For HT / VHT preamble types, this mask directly corresponds to
  1362. * the HT or VHT MCS indices that are allowed. For each bit N set
  1363. * within the mask, MCS index N is allowed for transmitting the frame.
  1364. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1365. * rates versus OFDM rates, so the host has the option of specifying
  1366. * that the target must transmit the frame with CCK or OFDM rates
  1367. * (not HT or VHT), but leaving the decision to the target whether
  1368. * to use CCK or OFDM.
  1369. *
  1370. * For CCK and OFDM, the bits within this mask are interpreted as
  1371. * follows:
  1372. * bit 0 -> CCK 1 Mbps rate is allowed
  1373. * bit 1 -> CCK 2 Mbps rate is allowed
  1374. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1375. * bit 3 -> CCK 11 Mbps rate is allowed
  1376. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1377. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1378. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1379. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1380. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1381. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1382. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1383. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1384. *
  1385. * The MCS index specification needs to be compatible with the
  1386. * bandwidth mask specification. For example, a MCS index == 9
  1387. * specification is inconsistent with a preamble type == VHT,
  1388. * Nss == 1, and channel bandwidth == 20 MHz.
  1389. *
  1390. * Furthermore, the host has only a limited ability to specify to
  1391. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1392. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1393. */
  1394. mcs_mask: 12,
  1395. /* nss_mask -
  1396. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1397. * Each bit in this mask corresponds to a Nss value:
  1398. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1399. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1400. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1401. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1402. * The values in the Nss mask must be suitable for the recipient, e.g.
  1403. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1404. * recipient which only supports 2x2 MIMO.
  1405. */
  1406. nss_mask: 4,
  1407. /* guard_interval -
  1408. * Specify a htt_tx_guard_interval enum value to indicate whether
  1409. * the transmission should use a regular guard interval or a
  1410. * short guard interval.
  1411. */
  1412. guard_interval: 1,
  1413. /* preamble_type_mask -
  1414. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1415. * may choose from for transmitting this frame.
  1416. * The bits in this mask correspond to the values in the
  1417. * htt_tx_preamble_type enum. For example, to allow the target
  1418. * to transmit the frame as either CCK or OFDM, this field would
  1419. * be set to
  1420. * (1 << htt_tx_preamble_type_ofdm) |
  1421. * (1 << htt_tx_preamble_type_cck)
  1422. */
  1423. preamble_type_mask: 4,
  1424. reserved1_31_29: 3; /* unused, set to 0x0 */
  1425. /* DWORD 2: tx chain mask, tx retries */
  1426. A_UINT32
  1427. /* chain_mask - specify which chains to transmit from */
  1428. chain_mask: 4,
  1429. /* retry_limit -
  1430. * Specify the maximum number of transmissions, including the
  1431. * initial transmission, to attempt before giving up if no ack
  1432. * is received.
  1433. * If the tx rate is specified, then all retries shall use the
  1434. * same rate as the initial transmission.
  1435. * If no tx rate is specified, the target can choose whether to
  1436. * retain the original rate during the retransmissions, or to
  1437. * fall back to a more robust rate.
  1438. */
  1439. retry_limit: 4,
  1440. /* bandwidth_mask -
  1441. * Specify what channel widths may be used for the transmission.
  1442. * A value of zero indicates "don't care" - the target may choose
  1443. * the transmission bandwidth.
  1444. * The bits within this mask correspond to the htt_tx_bandwidth
  1445. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1446. * The bandwidth_mask must be consistent with the preamble_type_mask
  1447. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1448. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1449. */
  1450. bandwidth_mask: 6,
  1451. reserved2_31_14: 18; /* unused, set to 0x0 */
  1452. /* DWORD 3: tx expiry time (TSF) LSBs */
  1453. A_UINT32 expire_tsf_lo;
  1454. /* DWORD 4: tx expiry time (TSF) MSBs */
  1455. A_UINT32 expire_tsf_hi;
  1456. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1457. } POSTPACK;
  1458. /* DWORD 0 */
  1459. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1460. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1462. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1463. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1464. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1465. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1466. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1467. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1468. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1469. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1470. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1479. /* DWORD 1 */
  1480. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1481. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1482. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1483. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1484. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1485. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1486. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1487. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1488. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1489. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1490. /* DWORD 2 */
  1491. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1492. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1493. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1494. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1495. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1496. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1497. /* DWORD 0 */
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1499. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1500. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1502. do { \
  1503. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1504. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1505. } while (0)
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1507. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1508. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1510. do { \
  1511. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1512. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1513. } while (0)
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1515. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1516. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1518. do { \
  1519. HTT_CHECK_SET_VAL( \
  1520. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1521. ((_var) |= ((_val) \
  1522. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1523. } while (0)
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1525. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1526. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1528. do { \
  1529. HTT_CHECK_SET_VAL( \
  1530. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1531. ((_var) |= ((_val) \
  1532. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1533. } while (0)
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1535. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1536. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1538. do { \
  1539. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1540. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1541. } while (0)
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1543. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1544. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1546. do { \
  1547. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1548. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1549. } while (0)
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1551. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1552. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1554. do { \
  1555. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1556. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1557. } while (0)
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1559. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1560. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1562. do { \
  1563. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1564. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1565. } while (0)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1567. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1568. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1570. do { \
  1571. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1572. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1573. } while (0)
  1574. /* DWORD 1 */
  1575. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1576. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1577. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1578. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1579. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1580. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1581. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1582. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1583. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1584. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1586. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1587. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1590. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1591. } while (0)
  1592. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1593. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1594. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1595. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1596. do { \
  1597. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1598. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1599. } while (0)
  1600. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1601. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1602. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1603. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1604. do { \
  1605. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1606. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1607. } while (0)
  1608. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1609. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1610. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1611. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1612. do { \
  1613. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1614. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1615. } while (0)
  1616. /* DWORD 2 */
  1617. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1618. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1619. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1620. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1621. do { \
  1622. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1623. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1624. } while (0)
  1625. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1626. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1627. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1628. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1629. do { \
  1630. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1631. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1632. } while (0)
  1633. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1635. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1636. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1640. } while (0)
  1641. typedef enum {
  1642. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1643. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1644. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1645. } htt_11ax_ltf_subtype_t;
  1646. typedef enum {
  1647. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1648. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1649. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1650. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1651. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1652. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1653. } htt_tx_ext2_preamble_type_t;
  1654. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1655. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1656. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1657. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1658. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1659. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1660. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1661. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1662. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1663. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1664. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1665. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1666. /**
  1667. * @brief HTT tx MSDU extension descriptor v2
  1668. * @details
  1669. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1670. * is received as tcl_exit_base->host_meta_info in firmware.
  1671. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1672. * are already part of tcl_exit_base.
  1673. */
  1674. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1675. /* DWORD 0: flags */
  1676. A_UINT32
  1677. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1678. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1679. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1680. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1681. valid_retries : 1, /* if set, tx retries spec is valid */
  1682. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1683. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1684. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1685. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1686. valid_key_flags : 1, /* if set, key flags is valid */
  1687. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1688. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1689. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1690. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1691. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1692. 1 = ENCRYPT,
  1693. 2 ~ 3 - Reserved */
  1694. /* retry_limit -
  1695. * Specify the maximum number of transmissions, including the
  1696. * initial transmission, to attempt before giving up if no ack
  1697. * is received.
  1698. * If the tx rate is specified, then all retries shall use the
  1699. * same rate as the initial transmission.
  1700. * If no tx rate is specified, the target can choose whether to
  1701. * retain the original rate during the retransmissions, or to
  1702. * fall back to a more robust rate.
  1703. */
  1704. retry_limit : 4,
  1705. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1706. * Valid only for 11ax preamble types HE_SU
  1707. * and HE_EXT_SU
  1708. */
  1709. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1710. * Valid only for 11ax preamble types HE_SU
  1711. * and HE_EXT_SU
  1712. */
  1713. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1714. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1715. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1716. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1717. */
  1718. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1719. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1720. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1721. * Use cases:
  1722. * Any time firmware uses TQM-BYPASS for Data
  1723. * TID, firmware expect host to set this bit.
  1724. */
  1725. /* DWORD 1: tx power, tx rate */
  1726. A_UINT32
  1727. power : 8, /* unit of the power field is 0.5 dbm
  1728. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1729. * signed value ranging from -64dbm to 63.5 dbm
  1730. */
  1731. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1732. * Setting more than one MCS isn't currently
  1733. * supported by the target (but is supported
  1734. * in the interface in case in the future
  1735. * the target supports specifications of
  1736. * a limited set of MCS values.
  1737. */
  1738. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1739. * Setting more than one Nss isn't currently
  1740. * supported by the target (but is supported
  1741. * in the interface in case in the future
  1742. * the target supports specifications of
  1743. * a limited set of Nss values.
  1744. */
  1745. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1746. update_peer_cache : 1; /* When set these custom values will be
  1747. * used for all packets, until the next
  1748. * update via this ext header.
  1749. * This is to make sure not all packets
  1750. * need to include this header.
  1751. */
  1752. /* DWORD 2: tx chain mask, tx retries */
  1753. A_UINT32
  1754. /* chain_mask - specify which chains to transmit from */
  1755. chain_mask : 8,
  1756. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1757. * TODO: Update Enum values for key_flags
  1758. */
  1759. /*
  1760. * Channel frequency: This identifies the desired channel
  1761. * frequency (in MHz) for tx frames. This is used by FW to help
  1762. * determine when it is safe to transmit or drop frames for
  1763. * off-channel operation.
  1764. * The default value of zero indicates to FW that the corresponding
  1765. * VDEV's home channel (if there is one) is the desired channel
  1766. * frequency.
  1767. */
  1768. chanfreq : 16;
  1769. /* DWORD 3: tx expiry time (TSF) LSBs */
  1770. A_UINT32 expire_tsf_lo;
  1771. /* DWORD 4: tx expiry time (TSF) MSBs */
  1772. A_UINT32 expire_tsf_hi;
  1773. /* DWORD 5: flags to control routing / processing of the MSDU */
  1774. A_UINT32
  1775. /* learning_frame
  1776. * When this flag is set, this frame will be dropped by FW
  1777. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1778. */
  1779. learning_frame : 1,
  1780. /* send_as_standalone
  1781. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1782. * i.e. with no A-MSDU or A-MPDU aggregation.
  1783. * The scope is extended to other use-cases.
  1784. */
  1785. send_as_standalone : 1,
  1786. /* is_host_opaque_valid
  1787. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1788. * with valid information.
  1789. */
  1790. is_host_opaque_valid : 1,
  1791. rsvd0 : 29;
  1792. /* DWORD 6 : Host opaque cookie for special frames */
  1793. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1794. rsvd1 : 16;
  1795. /*
  1796. * This structure can be expanded further up to 40 bytes
  1797. * by adding further DWORDs as needed.
  1798. */
  1799. } POSTPACK;
  1800. /* DWORD 0 */
  1801. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1802. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1803. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1804. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1805. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1806. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1807. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1808. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1809. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1810. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1811. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1827. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1828. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1829. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1830. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1831. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1832. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1833. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1834. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1835. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1836. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1837. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1838. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1839. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1840. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1841. /* DWORD 1 */
  1842. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1843. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1844. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1845. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1846. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1847. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1848. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1849. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1850. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1851. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1852. /* DWORD 2 */
  1853. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1854. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1855. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1856. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1857. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1858. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1859. /* DWORD 5 */
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1866. /* DWORD 6 */
  1867. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1868. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1869. /* DWORD 0 */
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1871. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1872. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1874. do { \
  1875. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1876. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1877. } while (0)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1879. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1880. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1882. do { \
  1883. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1884. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1885. } while (0)
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1887. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1888. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1890. do { \
  1891. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1892. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1893. } while (0)
  1894. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1895. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1896. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1898. do { \
  1899. HTT_CHECK_SET_VAL( \
  1900. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1901. ((_var) |= ((_val) \
  1902. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1903. } while (0)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1905. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1906. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1908. do { \
  1909. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1910. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1911. } while (0)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1913. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1914. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1916. do { \
  1917. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1918. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1919. } while (0)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1921. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1922. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1924. do { \
  1925. HTT_CHECK_SET_VAL( \
  1926. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1927. ((_var) |= ((_val) \
  1928. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1944. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1945. } while (0)
  1946. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1947. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1948. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1950. do { \
  1951. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1952. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1953. } while (0)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1955. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1956. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1958. do { \
  1959. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1960. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1961. } while (0)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1977. } while (0)
  1978. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1979. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1980. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1981. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1985. } while (0)
  1986. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1987. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1988. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1989. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1990. do { \
  1991. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1992. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1993. } while (0)
  1994. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1995. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1996. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1997. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1998. do { \
  1999. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2000. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2001. } while (0)
  2002. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2003. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2004. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2005. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2006. do { \
  2007. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2008. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2009. } while (0)
  2010. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2011. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2012. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2013. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2014. do { \
  2015. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2016. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2017. } while (0)
  2018. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2019. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2020. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2021. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2022. do { \
  2023. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2024. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2025. } while (0)
  2026. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2027. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2028. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2029. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2030. do { \
  2031. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2032. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2033. } while (0)
  2034. /* DWORD 1 */
  2035. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2036. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2037. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2038. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2039. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2040. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2041. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2042. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2043. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2044. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2051. } while (0)
  2052. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2053. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2054. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2055. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2059. } while (0)
  2060. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2061. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2062. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2063. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2067. } while (0)
  2068. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2070. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2071. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2074. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2075. } while (0)
  2076. /* DWORD 2 */
  2077. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2078. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2079. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2080. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2081. do { \
  2082. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2083. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2084. } while (0)
  2085. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2086. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2087. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2088. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2089. do { \
  2090. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2091. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2092. } while (0)
  2093. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2094. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2095. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2096. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2097. do { \
  2098. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2099. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2100. } while (0)
  2101. /* DWORD 5 */
  2102. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2103. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2104. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2105. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2108. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2109. } while (0)
  2110. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2111. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2112. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2113. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2116. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2117. } while (0)
  2118. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2120. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2121. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2125. } while (0)
  2126. /* DWORD 6 */
  2127. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2128. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2129. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2130. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2131. do { \
  2132. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2133. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2134. } while (0)
  2135. typedef enum {
  2136. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2137. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2138. } htt_tcl_metadata_type;
  2139. /**
  2140. * @brief HTT TCL command number format
  2141. * @details
  2142. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2143. * available to firmware as tcl_exit_base->tcl_status_number.
  2144. * For regular / multicast packets host will send vdev and mac id and for
  2145. * NAWDS packets, host will send peer id.
  2146. * A_UINT32 is used to avoid endianness conversion problems.
  2147. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2148. */
  2149. typedef struct {
  2150. A_UINT32
  2151. type: 1, /* vdev_id based or peer_id based */
  2152. rsvd: 31;
  2153. } htt_tx_tcl_vdev_or_peer_t;
  2154. typedef struct {
  2155. A_UINT32
  2156. type: 1, /* vdev_id based or peer_id based */
  2157. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2158. vdev_id: 8,
  2159. pdev_id: 2,
  2160. host_inspected:1,
  2161. rsvd: 19;
  2162. } htt_tx_tcl_vdev_metadata;
  2163. typedef struct {
  2164. A_UINT32
  2165. type: 1, /* vdev_id based or peer_id based */
  2166. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2167. peer_id: 14,
  2168. rsvd: 16;
  2169. } htt_tx_tcl_peer_metadata;
  2170. PREPACK struct htt_tx_tcl_metadata {
  2171. union {
  2172. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2173. htt_tx_tcl_vdev_metadata vdev_meta;
  2174. htt_tx_tcl_peer_metadata peer_meta;
  2175. };
  2176. } POSTPACK;
  2177. /* DWORD 0 */
  2178. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2179. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2180. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2181. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2182. /* VDEV metadata */
  2183. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2184. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2185. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2186. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2187. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2188. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2189. /* PEER metadata */
  2190. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2191. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2192. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2193. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2194. HTT_TX_TCL_METADATA_TYPE_S)
  2195. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2196. do { \
  2197. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2198. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2199. } while (0)
  2200. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2201. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2202. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2203. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2204. do { \
  2205. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2206. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2207. } while (0)
  2208. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2209. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2210. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2211. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2212. do { \
  2213. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2214. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2215. } while (0)
  2216. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2217. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2218. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2219. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2220. do { \
  2221. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2222. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2223. } while (0)
  2224. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2225. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2226. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2227. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2228. do { \
  2229. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2230. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2231. } while (0)
  2232. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2233. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2234. HTT_TX_TCL_METADATA_PEER_ID_S)
  2235. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2236. do { \
  2237. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2238. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2239. } while (0)
  2240. /*------------------------------------------------------------------
  2241. * V2 Version of TCL Data Command
  2242. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2243. * MLO global_seq all flavours of TCL Data Cmd.
  2244. *-----------------------------------------------------------------*/
  2245. typedef enum {
  2246. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2247. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2248. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2249. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2250. } htt_tcl_metadata_type_v2;
  2251. /**
  2252. * @brief HTT TCL command number format
  2253. * @details
  2254. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2255. * available to firmware as tcl_exit_base->tcl_status_number.
  2256. * A_UINT32 is used to avoid endianness conversion problems.
  2257. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2258. */
  2259. typedef struct {
  2260. A_UINT32
  2261. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2262. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2263. vdev_id: 8,
  2264. pdev_id: 2,
  2265. host_inspected:1,
  2266. rsvd: 2,
  2267. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2268. } htt_tx_tcl_vdev_metadata_v2;
  2269. typedef struct {
  2270. A_UINT32
  2271. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2272. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2273. peer_id: 13,
  2274. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2275. } htt_tx_tcl_peer_metadata_v2;
  2276. typedef struct {
  2277. A_UINT32
  2278. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2279. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2280. svc_class_id: 8,
  2281. rsvd: 5,
  2282. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2283. } htt_tx_tcl_svc_class_id_metadata;
  2284. typedef struct {
  2285. A_UINT32
  2286. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2287. host_inspected: 1,
  2288. global_seq_no: 12,
  2289. rsvd: 1,
  2290. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2291. } htt_tx_tcl_global_seq_metadata;
  2292. PREPACK struct htt_tx_tcl_metadata_v2 {
  2293. union {
  2294. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2295. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2296. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2297. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2298. };
  2299. } POSTPACK;
  2300. /* DWORD 0 */
  2301. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2302. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2303. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2304. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2305. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2306. /* VDEV V2 metadata */
  2307. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2308. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2309. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2310. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2311. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2312. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2313. /* PEER V2 metadata */
  2314. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2315. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2316. /* SVC_CLASS_ID metadata */
  2317. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2318. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2319. /* Global Seq no metadata */
  2320. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2321. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2322. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2323. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2324. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2325. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2326. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2327. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2328. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2329. do { \
  2330. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2331. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2332. } while (0)
  2333. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2334. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2335. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2336. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2337. do { \
  2338. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2339. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2340. } while (0)
  2341. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2342. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2343. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2344. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2345. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2346. do { \
  2347. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2348. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2349. } while (0)
  2350. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2351. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2352. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2353. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2354. do { \
  2355. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2356. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2357. } while (0)
  2358. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2359. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2360. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2361. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2362. do { \
  2363. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2364. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2365. } while (0)
  2366. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2367. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2368. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2369. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2370. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2371. do { \
  2372. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2373. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2374. } while (0)
  2375. /*----- Get and Set V2 type field in Service Class fields ----*/
  2376. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2377. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2378. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2379. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2380. do { \
  2381. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2382. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2383. } while (0)
  2384. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2385. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2386. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2387. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2388. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2389. do { \
  2390. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2391. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2392. } while (0)
  2393. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2394. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2395. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2396. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2397. do { \
  2398. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2399. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2400. } while (0)
  2401. /*------------------------------------------------------------------
  2402. * End V2 Version of TCL Data Command
  2403. *-----------------------------------------------------------------*/
  2404. typedef enum {
  2405. HTT_TX_FW2WBM_TX_STATUS_OK,
  2406. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2407. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2408. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2409. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2410. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2411. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2412. HTT_TX_FW2WBM_TX_STATUS_MAX
  2413. } htt_tx_fw2wbm_tx_status_t;
  2414. typedef enum {
  2415. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2416. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2417. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2418. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2419. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2420. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2421. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2422. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2423. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2424. } htt_tx_fw2wbm_reinject_reason_t;
  2425. /**
  2426. * @brief HTT TX WBM Completion from firmware to host
  2427. * @details
  2428. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2429. * DWORD 3 and 4 for software based completions (Exception frames and
  2430. * TQM bypass frames)
  2431. * For software based completions, wbm_release_ring->release_source_module will
  2432. * be set to release_source_fw
  2433. */
  2434. PREPACK struct htt_tx_wbm_completion {
  2435. A_UINT32
  2436. sch_cmd_id: 24,
  2437. exception_frame: 1, /* If set, this packet was queued via exception path */
  2438. rsvd0_31_25: 7;
  2439. A_UINT32
  2440. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2441. * reception of an ACK or BA, this field indicates
  2442. * the RSSI of the received ACK or BA frame.
  2443. * When the frame is removed as result of a direct
  2444. * remove command from the SW, this field is set
  2445. * to 0x0 (which is never a valid value when real
  2446. * RSSI is available).
  2447. * Units: dB w.r.t noise floor
  2448. */
  2449. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2450. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2451. rsvd1_31_16: 16;
  2452. } POSTPACK;
  2453. /* DWORD 0 */
  2454. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2455. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2456. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2457. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2458. /* DWORD 1 */
  2459. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2460. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2461. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2462. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2463. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2464. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2465. /* DWORD 0 */
  2466. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2467. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2468. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2469. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2470. do { \
  2471. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2472. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2473. } while (0)
  2474. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2475. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2476. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2477. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2478. do { \
  2479. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2480. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2481. } while (0)
  2482. /* DWORD 1 */
  2483. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2484. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2485. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2486. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2487. do { \
  2488. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2489. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2490. } while (0)
  2491. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2492. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2493. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2494. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2495. do { \
  2496. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2497. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2498. } while (0)
  2499. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2500. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2501. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2502. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2503. do { \
  2504. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2505. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2506. } while (0)
  2507. /**
  2508. * @brief HTT TX WBM Completion from firmware to host
  2509. * @details
  2510. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2511. * (WBM) offload HW.
  2512. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2513. * For software based completions, release_source_module will
  2514. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2515. * struct wbm_release_ring and then switch to this after looking at
  2516. * release_source_module.
  2517. */
  2518. PREPACK struct htt_tx_wbm_completion_v2 {
  2519. A_UINT32
  2520. used_by_hw0; /* Refer to struct wbm_release_ring */
  2521. A_UINT32
  2522. used_by_hw1; /* Refer to struct wbm_release_ring */
  2523. A_UINT32
  2524. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2525. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2526. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2527. exception_frame: 1,
  2528. rsvd0: 12, /* For future use */
  2529. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2530. rsvd1: 1; /* For future use */
  2531. A_UINT32
  2532. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2533. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2534. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2535. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2536. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2537. */
  2538. A_UINT32
  2539. data1: 32;
  2540. A_UINT32
  2541. data2: 32;
  2542. A_UINT32
  2543. used_by_hw3; /* Refer to struct wbm_release_ring */
  2544. } POSTPACK;
  2545. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2546. /* DWORD 3 */
  2547. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2548. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2549. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2550. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2551. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2552. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2553. /* DWORD 3 */
  2554. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2555. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2556. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2557. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2558. do { \
  2559. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2560. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2561. } while (0)
  2562. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2563. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2564. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2565. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2566. do { \
  2567. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2568. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2569. } while (0)
  2570. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2571. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2572. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2573. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2574. do { \
  2575. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2576. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2577. } while (0)
  2578. typedef enum {
  2579. TX_FRAME_TYPE_UNDEFINED = 0,
  2580. TX_FRAME_TYPE_EAPOL = 1,
  2581. } htt_tx_wbm_status_frame_type;
  2582. /**
  2583. * @brief HTT TX WBM transmit status from firmware to host
  2584. * @details
  2585. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2586. * (WBM) offload HW.
  2587. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2588. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2589. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2590. */
  2591. PREPACK struct htt_tx_wbm_transmit_status {
  2592. A_UINT32
  2593. sch_cmd_id: 24,
  2594. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2595. * reception of an ACK or BA, this field indicates
  2596. * the RSSI of the received ACK or BA frame.
  2597. * When the frame is removed as result of a direct
  2598. * remove command from the SW, this field is set
  2599. * to 0x0 (which is never a valid value when real
  2600. * RSSI is available).
  2601. * Units: dB w.r.t noise floor
  2602. */
  2603. A_UINT32
  2604. sw_peer_id: 16,
  2605. tid_num: 5,
  2606. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2607. * and tid_num fields contain valid data.
  2608. * If this "valid" flag is not set, the
  2609. * sw_peer_id and tid_num fields must be ignored.
  2610. */
  2611. mcast: 1,
  2612. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2613. * contains valid data.
  2614. */
  2615. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2616. reserved: 4;
  2617. A_UINT32
  2618. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2619. * packets in the wbm completion path
  2620. */
  2621. } POSTPACK;
  2622. /* DWORD 4 */
  2623. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2624. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2625. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2626. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2627. /* DWORD 5 */
  2628. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2629. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2630. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2631. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2632. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2633. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2634. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2635. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2636. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2637. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2638. /* DWORD 4 */
  2639. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2640. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2641. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2642. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2643. do { \
  2644. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2645. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2646. } while (0)
  2647. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2648. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2649. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2650. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2651. do { \
  2652. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2653. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2654. } while (0)
  2655. /* DWORD 5 */
  2656. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2657. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2658. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2659. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2660. do { \
  2661. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2662. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2663. } while (0)
  2664. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2665. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2666. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2667. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2668. do { \
  2669. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2670. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2671. } while (0)
  2672. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2673. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2674. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2675. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2676. do { \
  2677. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2678. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2679. } while (0)
  2680. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2681. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2682. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2683. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2684. do { \
  2685. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2686. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2687. } while (0)
  2688. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2689. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2690. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2691. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2692. do { \
  2693. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2694. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2695. } while (0)
  2696. /**
  2697. * @brief HTT TX WBM reinject status from firmware to host
  2698. * @details
  2699. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2700. * (WBM) offload HW.
  2701. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2702. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2703. */
  2704. PREPACK struct htt_tx_wbm_reinject_status {
  2705. A_UINT32
  2706. reserved0: 32;
  2707. A_UINT32
  2708. reserved1: 32;
  2709. A_UINT32
  2710. reserved2: 32;
  2711. } POSTPACK;
  2712. /**
  2713. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2714. * @details
  2715. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2716. * (WBM) offload HW.
  2717. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2718. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2719. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2720. * STA side.
  2721. */
  2722. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2723. A_UINT32
  2724. mec_sa_addr_31_0;
  2725. A_UINT32
  2726. mec_sa_addr_47_32: 16,
  2727. sa_ast_index: 16;
  2728. A_UINT32
  2729. vdev_id: 8,
  2730. reserved0: 24;
  2731. } POSTPACK;
  2732. /* DWORD 4 - mec_sa_addr_31_0 */
  2733. /* DWORD 5 */
  2734. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2735. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2736. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2737. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2738. /* DWORD 6 */
  2739. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2740. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2741. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2742. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2743. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2744. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2745. do { \
  2746. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2747. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2748. } while (0)
  2749. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2750. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2751. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2752. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2753. do { \
  2754. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2755. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2756. } while (0)
  2757. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2758. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2759. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2760. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2761. do { \
  2762. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2763. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2764. } while (0)
  2765. typedef enum {
  2766. TX_FLOW_PRIORITY_BE,
  2767. TX_FLOW_PRIORITY_HIGH,
  2768. TX_FLOW_PRIORITY_LOW,
  2769. } htt_tx_flow_priority_t;
  2770. typedef enum {
  2771. TX_FLOW_LATENCY_SENSITIVE,
  2772. TX_FLOW_LATENCY_INSENSITIVE,
  2773. } htt_tx_flow_latency_t;
  2774. typedef enum {
  2775. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2776. TX_FLOW_INTERACTIVE_TRAFFIC,
  2777. TX_FLOW_PERIODIC_TRAFFIC,
  2778. TX_FLOW_BURSTY_TRAFFIC,
  2779. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2780. } htt_tx_flow_traffic_pattern_t;
  2781. /**
  2782. * @brief HTT TX Flow search metadata format
  2783. * @details
  2784. * Host will set this metadata in flow table's flow search entry along with
  2785. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2786. * firmware and TQM ring if the flow search entry wins.
  2787. * This metadata is available to firmware in that first MSDU's
  2788. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2789. * to one of the available flows for specific tid and returns the tqm flow
  2790. * pointer as part of htt_tx_map_flow_info message.
  2791. */
  2792. PREPACK struct htt_tx_flow_metadata {
  2793. A_UINT32
  2794. rsvd0_1_0: 2,
  2795. tid: 4,
  2796. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2797. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2798. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2799. * Else choose final tid based on latency, priority.
  2800. */
  2801. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2802. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2803. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2804. } POSTPACK;
  2805. /* DWORD 0 */
  2806. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2807. #define HTT_TX_FLOW_METADATA_TID_S 2
  2808. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2809. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2810. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2811. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2812. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2813. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2814. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2815. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2816. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2817. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2818. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2819. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2820. /* DWORD 0 */
  2821. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2822. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2823. HTT_TX_FLOW_METADATA_TID_S)
  2824. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2827. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2828. } while (0)
  2829. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2830. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2831. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2832. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2835. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2836. } while (0)
  2837. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2838. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2839. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2840. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2841. do { \
  2842. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2843. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2844. } while (0)
  2845. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2846. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2847. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2848. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2849. do { \
  2850. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2851. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2852. } while (0)
  2853. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2854. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2855. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2856. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2857. do { \
  2858. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2859. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2860. } while (0)
  2861. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2862. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2863. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2864. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2865. do { \
  2866. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2867. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2868. } while (0)
  2869. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2870. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2871. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2872. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2873. do { \
  2874. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2875. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2876. } while (0)
  2877. /**
  2878. * @brief host -> target ADD WDS Entry
  2879. *
  2880. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2881. *
  2882. * @brief host -> target DELETE WDS Entry
  2883. *
  2884. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2885. *
  2886. * @details
  2887. * HTT wds entry from source port learning
  2888. * Host will learn wds entries from rx and send this message to firmware
  2889. * to enable firmware to configure/delete AST entries for wds clients.
  2890. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2891. * and when SA's entry is deleted, firmware removes this AST entry
  2892. *
  2893. * The message would appear as follows:
  2894. *
  2895. * |31 30|29 |17 16|15 8|7 0|
  2896. * |----------------+----------------+----------------+----------------|
  2897. * | rsvd0 |PDVID| vdev_id | msg_type |
  2898. * |-------------------------------------------------------------------|
  2899. * | sa_addr_31_0 |
  2900. * |-------------------------------------------------------------------|
  2901. * | | ta_peer_id | sa_addr_47_32 |
  2902. * |-------------------------------------------------------------------|
  2903. * Where PDVID = pdev_id
  2904. *
  2905. * The message is interpreted as follows:
  2906. *
  2907. * dword0 - b'0:7 - msg_type: This will be set to
  2908. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2909. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2910. *
  2911. * dword0 - b'8:15 - vdev_id
  2912. *
  2913. * dword0 - b'16:17 - pdev_id
  2914. *
  2915. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2916. *
  2917. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2918. *
  2919. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2920. *
  2921. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2922. */
  2923. PREPACK struct htt_wds_entry {
  2924. A_UINT32
  2925. msg_type: 8,
  2926. vdev_id: 8,
  2927. pdev_id: 2,
  2928. rsvd0: 14;
  2929. A_UINT32 sa_addr_31_0;
  2930. A_UINT32
  2931. sa_addr_47_32: 16,
  2932. ta_peer_id: 14,
  2933. rsvd2: 2;
  2934. } POSTPACK;
  2935. /* DWORD 0 */
  2936. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2937. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2938. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2939. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2940. /* DWORD 2 */
  2941. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2942. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2943. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2944. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2945. /* DWORD 0 */
  2946. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2947. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2948. HTT_WDS_ENTRY_VDEV_ID_S)
  2949. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2952. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2953. } while (0)
  2954. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2955. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2956. HTT_WDS_ENTRY_PDEV_ID_S)
  2957. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2960. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2961. } while (0)
  2962. /* DWORD 2 */
  2963. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2964. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2965. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2966. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2969. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2970. } while (0)
  2971. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2972. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2973. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2974. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2977. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2978. } while (0)
  2979. /**
  2980. * @brief MAC DMA rx ring setup specification
  2981. *
  2982. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2983. *
  2984. * @details
  2985. * To allow for dynamic rx ring reconfiguration and to avoid race
  2986. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2987. * it uses. Instead, it sends this message to the target, indicating how
  2988. * the rx ring used by the host should be set up and maintained.
  2989. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2990. * specifications.
  2991. *
  2992. * |31 16|15 8|7 0|
  2993. * |---------------------------------------------------------------|
  2994. * header: | reserved | num rings | msg type |
  2995. * |---------------------------------------------------------------|
  2996. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2997. #if HTT_PADDR64
  2998. * | FW_IDX shadow register physical address (bits 63:32) |
  2999. #endif
  3000. * |---------------------------------------------------------------|
  3001. * | rx ring base physical address (bits 31:0) |
  3002. #if HTT_PADDR64
  3003. * | rx ring base physical address (bits 63:32) |
  3004. #endif
  3005. * |---------------------------------------------------------------|
  3006. * | rx ring buffer size | rx ring length |
  3007. * |---------------------------------------------------------------|
  3008. * | FW_IDX initial value | enabled flags |
  3009. * |---------------------------------------------------------------|
  3010. * | MSDU payload offset | 802.11 header offset |
  3011. * |---------------------------------------------------------------|
  3012. * | PPDU end offset | PPDU start offset |
  3013. * |---------------------------------------------------------------|
  3014. * | MPDU end offset | MPDU start offset |
  3015. * |---------------------------------------------------------------|
  3016. * | MSDU end offset | MSDU start offset |
  3017. * |---------------------------------------------------------------|
  3018. * | frag info offset | rx attention offset |
  3019. * |---------------------------------------------------------------|
  3020. * payload 2, if present, has the same format as payload 1
  3021. * Header fields:
  3022. * - MSG_TYPE
  3023. * Bits 7:0
  3024. * Purpose: identifies this as an rx ring configuration message
  3025. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3026. * - NUM_RINGS
  3027. * Bits 15:8
  3028. * Purpose: indicates whether the host is setting up one rx ring or two
  3029. * Value: 1 or 2
  3030. * Payload:
  3031. * for systems using 64-bit format for bus addresses:
  3032. * - IDX_SHADOW_REG_PADDR_LO
  3033. * Bits 31:0
  3034. * Value: lower 4 bytes of physical address of the host's
  3035. * FW_IDX shadow register
  3036. * - IDX_SHADOW_REG_PADDR_HI
  3037. * Bits 31:0
  3038. * Value: upper 4 bytes of physical address of the host's
  3039. * FW_IDX shadow register
  3040. * - RING_BASE_PADDR_LO
  3041. * Bits 31:0
  3042. * Value: lower 4 bytes of physical address of the host's rx ring
  3043. * - RING_BASE_PADDR_HI
  3044. * Bits 31:0
  3045. * Value: uppper 4 bytes of physical address of the host's rx ring
  3046. * for systems using 32-bit format for bus addresses:
  3047. * - IDX_SHADOW_REG_PADDR
  3048. * Bits 31:0
  3049. * Value: physical address of the host's FW_IDX shadow register
  3050. * - RING_BASE_PADDR
  3051. * Bits 31:0
  3052. * Value: physical address of the host's rx ring
  3053. * - RING_LEN
  3054. * Bits 15:0
  3055. * Value: number of elements in the rx ring
  3056. * - RING_BUF_SZ
  3057. * Bits 31:16
  3058. * Value: size of the buffers referenced by the rx ring, in byte units
  3059. * - ENABLED_FLAGS
  3060. * Bits 15:0
  3061. * Value: 1-bit flags to show whether different rx fields are enabled
  3062. * bit 0: 802.11 header enabled (1) or disabled (0)
  3063. * bit 1: MSDU payload enabled (1) or disabled (0)
  3064. * bit 2: PPDU start enabled (1) or disabled (0)
  3065. * bit 3: PPDU end enabled (1) or disabled (0)
  3066. * bit 4: MPDU start enabled (1) or disabled (0)
  3067. * bit 5: MPDU end enabled (1) or disabled (0)
  3068. * bit 6: MSDU start enabled (1) or disabled (0)
  3069. * bit 7: MSDU end enabled (1) or disabled (0)
  3070. * bit 8: rx attention enabled (1) or disabled (0)
  3071. * bit 9: frag info enabled (1) or disabled (0)
  3072. * bit 10: unicast rx enabled (1) or disabled (0)
  3073. * bit 11: multicast rx enabled (1) or disabled (0)
  3074. * bit 12: ctrl rx enabled (1) or disabled (0)
  3075. * bit 13: mgmt rx enabled (1) or disabled (0)
  3076. * bit 14: null rx enabled (1) or disabled (0)
  3077. * bit 15: phy data rx enabled (1) or disabled (0)
  3078. * - IDX_INIT_VAL
  3079. * Bits 31:16
  3080. * Purpose: Specify the initial value for the FW_IDX.
  3081. * Value: the number of buffers initially present in the host's rx ring
  3082. * - OFFSET_802_11_HDR
  3083. * Bits 15:0
  3084. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3085. * - OFFSET_MSDU_PAYLOAD
  3086. * Bits 31:16
  3087. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3088. * - OFFSET_PPDU_START
  3089. * Bits 15:0
  3090. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3091. * - OFFSET_PPDU_END
  3092. * Bits 31:16
  3093. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3094. * - OFFSET_MPDU_START
  3095. * Bits 15:0
  3096. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3097. * - OFFSET_MPDU_END
  3098. * Bits 31:16
  3099. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3100. * - OFFSET_MSDU_START
  3101. * Bits 15:0
  3102. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3103. * - OFFSET_MSDU_END
  3104. * Bits 31:16
  3105. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3106. * - OFFSET_RX_ATTN
  3107. * Bits 15:0
  3108. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3109. * - OFFSET_FRAG_INFO
  3110. * Bits 31:16
  3111. * Value: offset in QUAD-bytes of frag info table
  3112. */
  3113. /* header fields */
  3114. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3115. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3116. /* payload fields */
  3117. /* for systems using a 64-bit format for bus addresses */
  3118. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3119. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3120. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3121. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3122. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3123. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3124. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3125. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3126. /* for systems using a 32-bit format for bus addresses */
  3127. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3128. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3129. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3130. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3131. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3132. #define HTT_RX_RING_CFG_LEN_S 0
  3133. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3134. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3135. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3136. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3137. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3138. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3139. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3140. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3141. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3142. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3143. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3144. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3145. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3146. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3147. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3148. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3149. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3150. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3151. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3152. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3153. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3154. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3155. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3156. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3157. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3158. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3159. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3160. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3161. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3162. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3163. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3164. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3165. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3166. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3167. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3168. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3169. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3170. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3171. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3172. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3173. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3174. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3175. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3176. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3177. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3178. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3179. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3180. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3181. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3182. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3183. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3184. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3185. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3186. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3187. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3188. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3189. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3190. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3191. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3192. #if HTT_PADDR64
  3193. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3194. #else
  3195. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3196. #endif
  3197. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3198. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3199. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3200. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3201. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3202. do { \
  3203. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3204. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3205. } while (0)
  3206. /* degenerate case for 32-bit fields */
  3207. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3208. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3209. ((_var) = (_val))
  3210. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3212. ((_var) = (_val))
  3213. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3214. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3215. ((_var) = (_val))
  3216. /* degenerate case for 32-bit fields */
  3217. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3218. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3219. ((_var) = (_val))
  3220. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3221. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3222. ((_var) = (_val))
  3223. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3224. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3225. ((_var) = (_val))
  3226. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3227. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3228. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3229. do { \
  3230. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3231. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3232. } while (0)
  3233. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3234. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3235. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3236. do { \
  3237. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3238. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3239. } while (0)
  3240. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3241. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3242. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3243. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3244. do { \
  3245. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3246. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3247. } while (0)
  3248. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3249. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3250. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3251. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3252. do { \
  3253. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3254. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3255. } while (0)
  3256. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3257. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3258. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3259. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3260. do { \
  3261. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3262. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3263. } while (0)
  3264. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3265. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3266. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3267. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3268. do { \
  3269. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3270. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3271. } while (0)
  3272. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3273. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3274. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3275. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3276. do { \
  3277. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3278. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3279. } while (0)
  3280. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3281. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3282. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3283. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3284. do { \
  3285. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3286. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3287. } while (0)
  3288. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3289. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3290. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3291. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3292. do { \
  3293. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3294. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3295. } while (0)
  3296. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3297. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3298. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3299. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3300. do { \
  3301. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3302. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3303. } while (0)
  3304. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3305. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3306. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3307. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3308. do { \
  3309. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3310. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3311. } while (0)
  3312. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3313. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3314. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3315. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3316. do { \
  3317. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3318. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3319. } while (0)
  3320. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3321. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3322. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3323. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3324. do { \
  3325. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3326. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3327. } while (0)
  3328. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3329. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3330. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3331. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3332. do { \
  3333. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3334. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3335. } while (0)
  3336. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3337. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3338. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3339. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3340. do { \
  3341. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3342. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3343. } while (0)
  3344. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3345. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3346. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3347. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3348. do { \
  3349. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3350. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3351. } while (0)
  3352. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3353. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3354. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3355. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3356. do { \
  3357. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3358. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3359. } while (0)
  3360. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3361. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3362. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3363. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3364. do { \
  3365. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3366. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3367. } while (0)
  3368. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3369. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3370. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3371. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3372. do { \
  3373. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3374. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3375. } while (0)
  3376. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3377. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3378. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3379. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3380. do { \
  3381. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3382. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3383. } while (0)
  3384. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3385. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3386. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3387. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3388. do { \
  3389. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3390. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3391. } while (0)
  3392. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3393. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3394. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3395. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3396. do { \
  3397. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3398. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3399. } while (0)
  3400. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3401. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3402. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3403. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3404. do { \
  3405. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3406. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3407. } while (0)
  3408. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3409. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3410. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3411. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3412. do { \
  3413. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3414. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3415. } while (0)
  3416. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3417. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3418. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3419. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3420. do { \
  3421. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3422. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3423. } while (0)
  3424. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3425. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3426. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3427. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3428. do { \
  3429. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3430. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3431. } while (0)
  3432. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3433. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3434. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3435. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3436. do { \
  3437. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3438. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3439. } while (0)
  3440. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3441. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3442. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3443. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3444. do { \
  3445. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3446. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3447. } while (0)
  3448. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3449. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3450. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3451. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3452. do { \
  3453. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3454. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3455. } while (0)
  3456. /**
  3457. * @brief host -> target FW statistics retrieve
  3458. *
  3459. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3460. *
  3461. * @details
  3462. * The following field definitions describe the format of the HTT host
  3463. * to target FW stats retrieve message. The message specifies the type of
  3464. * stats host wants to retrieve.
  3465. *
  3466. * |31 24|23 16|15 8|7 0|
  3467. * |-----------------------------------------------------------|
  3468. * | stats types request bitmask | msg type |
  3469. * |-----------------------------------------------------------|
  3470. * | stats types reset bitmask | reserved |
  3471. * |-----------------------------------------------------------|
  3472. * | stats type | config value |
  3473. * |-----------------------------------------------------------|
  3474. * | cookie LSBs |
  3475. * |-----------------------------------------------------------|
  3476. * | cookie MSBs |
  3477. * |-----------------------------------------------------------|
  3478. * Header fields:
  3479. * - MSG_TYPE
  3480. * Bits 7:0
  3481. * Purpose: identifies this is a stats upload request message
  3482. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3483. * - UPLOAD_TYPES
  3484. * Bits 31:8
  3485. * Purpose: identifies which types of FW statistics to upload
  3486. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3487. * - RESET_TYPES
  3488. * Bits 31:8
  3489. * Purpose: identifies which types of FW statistics to reset
  3490. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3491. * - CFG_VAL
  3492. * Bits 23:0
  3493. * Purpose: give an opaque configuration value to the specified stats type
  3494. * Value: stats-type specific configuration value
  3495. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3496. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3497. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3498. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3499. * - CFG_STAT_TYPE
  3500. * Bits 31:24
  3501. * Purpose: specify which stats type (if any) the config value applies to
  3502. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3503. * a valid configuration specification
  3504. * - COOKIE_LSBS
  3505. * Bits 31:0
  3506. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3507. * message with its preceding host->target stats request message.
  3508. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3509. * - COOKIE_MSBS
  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: MSBs of the opaque cookie specified by the host-side requestor
  3514. */
  3515. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3516. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3517. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3518. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3519. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3520. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3521. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3522. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3523. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3524. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3525. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3526. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3527. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3528. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3531. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3532. } while (0)
  3533. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3534. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3535. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3536. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3539. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3540. } while (0)
  3541. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3542. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3543. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3544. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3547. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3548. } while (0)
  3549. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3550. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3551. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3552. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3555. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3556. } while (0)
  3557. /**
  3558. * @brief host -> target HTT out-of-band sync request
  3559. *
  3560. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3561. *
  3562. * @details
  3563. * The HTT SYNC tells the target to suspend processing of subsequent
  3564. * HTT host-to-target messages until some other target agent locally
  3565. * informs the target HTT FW that the current sync counter is equal to
  3566. * or greater than (in a modulo sense) the sync counter specified in
  3567. * the SYNC message.
  3568. * This allows other host-target components to synchronize their operation
  3569. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3570. * security key has been downloaded to and activated by the target.
  3571. * In the absence of any explicit synchronization counter value
  3572. * specification, the target HTT FW will use zero as the default current
  3573. * sync value.
  3574. *
  3575. * |31 24|23 16|15 8|7 0|
  3576. * |-----------------------------------------------------------|
  3577. * | reserved | sync count | msg type |
  3578. * |-----------------------------------------------------------|
  3579. * Header fields:
  3580. * - MSG_TYPE
  3581. * Bits 7:0
  3582. * Purpose: identifies this as a sync message
  3583. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3584. * - SYNC_COUNT
  3585. * Bits 15:8
  3586. * Purpose: specifies what sync value the HTT FW will wait for from
  3587. * an out-of-band specification to resume its operation
  3588. * Value: in-band sync counter value to compare against the out-of-band
  3589. * counter spec.
  3590. * The HTT target FW will suspend its host->target message processing
  3591. * as long as
  3592. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3593. */
  3594. #define HTT_H2T_SYNC_MSG_SZ 4
  3595. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3596. #define HTT_H2T_SYNC_COUNT_S 8
  3597. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3598. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3599. HTT_H2T_SYNC_COUNT_S)
  3600. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3601. do { \
  3602. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3603. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3604. } while (0)
  3605. /**
  3606. * @brief host -> target HTT aggregation configuration
  3607. *
  3608. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3609. */
  3610. #define HTT_AGGR_CFG_MSG_SZ 4
  3611. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3612. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3613. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3614. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3615. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3616. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3617. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3618. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3621. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3622. } while (0)
  3623. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3624. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3625. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3626. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3629. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3630. } while (0)
  3631. /**
  3632. * @brief host -> target HTT configure max amsdu info per vdev
  3633. *
  3634. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3635. *
  3636. * @details
  3637. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3638. *
  3639. * |31 21|20 16|15 8|7 0|
  3640. * |-----------------------------------------------------------|
  3641. * | reserved | vdev id | max amsdu | msg type |
  3642. * |-----------------------------------------------------------|
  3643. * Header fields:
  3644. * - MSG_TYPE
  3645. * Bits 7:0
  3646. * Purpose: identifies this as a aggr cfg ex message
  3647. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3648. * - MAX_NUM_AMSDU_SUBFRM
  3649. * Bits 15:8
  3650. * Purpose: max MSDUs per A-MSDU
  3651. * - VDEV_ID
  3652. * Bits 20:16
  3653. * Purpose: ID of the vdev to which this limit is applied
  3654. */
  3655. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3656. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3657. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3658. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3659. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3660. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3661. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3662. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3663. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3664. do { \
  3665. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3666. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3667. } while (0)
  3668. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3669. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3670. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3671. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3672. do { \
  3673. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3674. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3675. } while (0)
  3676. /**
  3677. * @brief HTT WDI_IPA Config Message
  3678. *
  3679. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3680. *
  3681. * @details
  3682. * The HTT WDI_IPA config message is created/sent by host at driver
  3683. * init time. It contains information about data structures used on
  3684. * WDI_IPA TX and RX path.
  3685. * TX CE ring is used for pushing packet metadata from IPA uC
  3686. * to WLAN FW
  3687. * TX Completion ring is used for generating TX completions from
  3688. * WLAN FW to IPA uC
  3689. * RX Indication ring is used for indicating RX packets from FW
  3690. * to IPA uC
  3691. * RX Ring2 is used as either completion ring or as second
  3692. * indication ring. when Ring2 is used as completion ring, IPA uC
  3693. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3694. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3695. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3696. * indicated in RX Indication ring. Please see WDI_IPA specification
  3697. * for more details.
  3698. * |31 24|23 16|15 8|7 0|
  3699. * |----------------+----------------+----------------+----------------|
  3700. * | tx pkt pool size | Rsvd | msg_type |
  3701. * |-------------------------------------------------------------------|
  3702. * | tx comp ring base (bits 31:0) |
  3703. #if HTT_PADDR64
  3704. * | tx comp ring base (bits 63:32) |
  3705. #endif
  3706. * |-------------------------------------------------------------------|
  3707. * | tx comp ring size |
  3708. * |-------------------------------------------------------------------|
  3709. * | tx comp WR_IDX physical address (bits 31:0) |
  3710. #if HTT_PADDR64
  3711. * | tx comp WR_IDX physical address (bits 63:32) |
  3712. #endif
  3713. * |-------------------------------------------------------------------|
  3714. * | tx CE WR_IDX physical address (bits 31:0) |
  3715. #if HTT_PADDR64
  3716. * | tx CE WR_IDX physical address (bits 63:32) |
  3717. #endif
  3718. * |-------------------------------------------------------------------|
  3719. * | rx indication ring base (bits 31:0) |
  3720. #if HTT_PADDR64
  3721. * | rx indication ring base (bits 63:32) |
  3722. #endif
  3723. * |-------------------------------------------------------------------|
  3724. * | rx indication ring size |
  3725. * |-------------------------------------------------------------------|
  3726. * | rx ind RD_IDX physical address (bits 31:0) |
  3727. #if HTT_PADDR64
  3728. * | rx ind RD_IDX physical address (bits 63:32) |
  3729. #endif
  3730. * |-------------------------------------------------------------------|
  3731. * | rx ind WR_IDX physical address (bits 31:0) |
  3732. #if HTT_PADDR64
  3733. * | rx ind WR_IDX physical address (bits 63:32) |
  3734. #endif
  3735. * |-------------------------------------------------------------------|
  3736. * |-------------------------------------------------------------------|
  3737. * | rx ring2 base (bits 31:0) |
  3738. #if HTT_PADDR64
  3739. * | rx ring2 base (bits 63:32) |
  3740. #endif
  3741. * |-------------------------------------------------------------------|
  3742. * | rx ring2 size |
  3743. * |-------------------------------------------------------------------|
  3744. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3745. #if HTT_PADDR64
  3746. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3747. #endif
  3748. * |-------------------------------------------------------------------|
  3749. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3750. #if HTT_PADDR64
  3751. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3752. #endif
  3753. * |-------------------------------------------------------------------|
  3754. *
  3755. * Header fields:
  3756. * Header fields:
  3757. * - MSG_TYPE
  3758. * Bits 7:0
  3759. * Purpose: Identifies this as WDI_IPA config message
  3760. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3761. * - TX_PKT_POOL_SIZE
  3762. * Bits 15:0
  3763. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3764. * WDI_IPA TX path
  3765. * For systems using 32-bit format for bus addresses:
  3766. * - TX_COMP_RING_BASE_ADDR
  3767. * Bits 31:0
  3768. * Purpose: TX Completion Ring base address in DDR
  3769. * - TX_COMP_RING_SIZE
  3770. * Bits 31:0
  3771. * Purpose: TX Completion Ring size (must be power of 2)
  3772. * - TX_COMP_WR_IDX_ADDR
  3773. * Bits 31:0
  3774. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3775. * updates the Write Index for WDI_IPA TX completion ring
  3776. * - TX_CE_WR_IDX_ADDR
  3777. * Bits 31:0
  3778. * Purpose: DDR address where IPA uC
  3779. * updates the WR Index for TX CE ring
  3780. * (needed for fusion platforms)
  3781. * - RX_IND_RING_BASE_ADDR
  3782. * Bits 31:0
  3783. * Purpose: RX Indication Ring base address in DDR
  3784. * - RX_IND_RING_SIZE
  3785. * Bits 31:0
  3786. * Purpose: RX Indication Ring size
  3787. * - RX_IND_RD_IDX_ADDR
  3788. * Bits 31:0
  3789. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3790. * RX indication ring
  3791. * - RX_IND_WR_IDX_ADDR
  3792. * Bits 31:0
  3793. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3794. * updates the Write Index for WDI_IPA RX indication ring
  3795. * - RX_RING2_BASE_ADDR
  3796. * Bits 31:0
  3797. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3798. * - RX_RING2_SIZE
  3799. * Bits 31:0
  3800. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3801. * - RX_RING2_RD_IDX_ADDR
  3802. * Bits 31:0
  3803. * Purpose: If Second RX ring is Indication ring, DDR address where
  3804. * IPA uC updates the Read Index for Ring2.
  3805. * If Second RX ring is completion ring, this is NOT used
  3806. * - RX_RING2_WR_IDX_ADDR
  3807. * Bits 31:0
  3808. * Purpose: If Second RX ring is Indication ring, DDR address where
  3809. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3810. * If second RX ring is completion ring, DDR address where
  3811. * IPA uC updates the Write Index for Ring 2.
  3812. * For systems using 64-bit format for bus addresses:
  3813. * - TX_COMP_RING_BASE_ADDR_LO
  3814. * Bits 31:0
  3815. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3816. * - TX_COMP_RING_BASE_ADDR_HI
  3817. * Bits 31:0
  3818. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3819. * - TX_COMP_RING_SIZE
  3820. * Bits 31:0
  3821. * Purpose: TX Completion Ring size (must be power of 2)
  3822. * - TX_COMP_WR_IDX_ADDR_LO
  3823. * Bits 31:0
  3824. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3825. * Lower 4 bytes of DDR address where WIFI FW
  3826. * updates the Write Index for WDI_IPA TX completion ring
  3827. * - TX_COMP_WR_IDX_ADDR_HI
  3828. * Bits 31:0
  3829. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3830. * Higher 4 bytes of DDR address where WIFI FW
  3831. * updates the Write Index for WDI_IPA TX completion ring
  3832. * - TX_CE_WR_IDX_ADDR_LO
  3833. * Bits 31:0
  3834. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3835. * updates the WR Index for TX CE ring
  3836. * (needed for fusion platforms)
  3837. * - TX_CE_WR_IDX_ADDR_HI
  3838. * Bits 31:0
  3839. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3840. * updates the WR Index for TX CE ring
  3841. * (needed for fusion platforms)
  3842. * - RX_IND_RING_BASE_ADDR_LO
  3843. * Bits 31:0
  3844. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3845. * - RX_IND_RING_BASE_ADDR_HI
  3846. * Bits 31:0
  3847. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3848. * - RX_IND_RING_SIZE
  3849. * Bits 31:0
  3850. * Purpose: RX Indication Ring size
  3851. * - RX_IND_RD_IDX_ADDR_LO
  3852. * Bits 31:0
  3853. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3854. * for WDI_IPA RX indication ring
  3855. * - RX_IND_RD_IDX_ADDR_HI
  3856. * Bits 31:0
  3857. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3858. * for WDI_IPA RX indication ring
  3859. * - RX_IND_WR_IDX_ADDR_LO
  3860. * Bits 31:0
  3861. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3862. * Lower 4 bytes of DDR address where WIFI FW
  3863. * updates the Write Index for WDI_IPA RX indication ring
  3864. * - RX_IND_WR_IDX_ADDR_HI
  3865. * Bits 31:0
  3866. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3867. * Higher 4 bytes of DDR address where WIFI FW
  3868. * updates the Write Index for WDI_IPA RX indication ring
  3869. * - RX_RING2_BASE_ADDR_LO
  3870. * Bits 31:0
  3871. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3872. * - RX_RING2_BASE_ADDR_HI
  3873. * Bits 31:0
  3874. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3875. * - RX_RING2_SIZE
  3876. * Bits 31:0
  3877. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3878. * - RX_RING2_RD_IDX_ADDR_LO
  3879. * Bits 31:0
  3880. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3881. * DDR address where IPA uC updates the Read Index for Ring2.
  3882. * If Second RX ring is completion ring, this is NOT used
  3883. * - RX_RING2_RD_IDX_ADDR_HI
  3884. * Bits 31:0
  3885. * Purpose: If Second RX ring is Indication ring, higher 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_WR_IDX_ADDR_LO
  3889. * Bits 31:0
  3890. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3891. * DDR address where WIFI FW updates the Write Index
  3892. * for WDI_IPA RX ring2
  3893. * If second RX ring is completion ring, lower 4 bytes of
  3894. * DDR address where IPA uC updates the Write Index for Ring 2.
  3895. * - RX_RING2_WR_IDX_ADDR_HI
  3896. * Bits 31:0
  3897. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3898. * DDR address where WIFI FW updates the Write Index
  3899. * for WDI_IPA RX ring2
  3900. * If second RX ring is completion ring, higher 4 bytes of
  3901. * DDR address where IPA uC updates the Write Index for Ring 2.
  3902. */
  3903. #if HTT_PADDR64
  3904. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3905. #else
  3906. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3907. #endif
  3908. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3909. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3910. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3911. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3912. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3913. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3914. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3915. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3916. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3917. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3918. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3919. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3920. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3921. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3922. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3923. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3924. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3925. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3926. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3927. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3928. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3929. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3930. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3931. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3932. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3933. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3934. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3935. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3936. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3937. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3938. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3939. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3940. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3941. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3942. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3943. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3944. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3945. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3946. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3947. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3948. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3949. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3950. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3951. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3952. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3953. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3954. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3955. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3956. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3957. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3958. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3962. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3963. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3964. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3965. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3966. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3970. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3971. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3972. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3973. do { \
  3974. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3975. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3976. } while (0)
  3977. /* for systems using 32-bit format for bus addr */
  3978. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3979. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3980. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3981. do { \
  3982. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3983. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3984. } while (0)
  3985. /* for systems using 64-bit format for bus addr */
  3986. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3987. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3988. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3989. do { \
  3990. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3991. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3992. } while (0)
  3993. /* for systems using 64-bit format for bus addr */
  3994. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3995. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3996. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3997. do { \
  3998. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3999. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4000. } while (0)
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4002. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4004. do { \
  4005. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4006. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4007. } while (0)
  4008. /* for systems using 32-bit format for bus addr */
  4009. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4010. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4011. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4012. do { \
  4013. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4014. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4015. } while (0)
  4016. /* for systems using 64-bit format for bus addr */
  4017. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4018. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4019. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4020. do { \
  4021. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4022. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4023. } while (0)
  4024. /* for systems using 64-bit format for bus addr */
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4026. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4027. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4028. do { \
  4029. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4030. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4031. } while (0)
  4032. /* for systems using 32-bit format for bus addr */
  4033. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4034. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4035. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4036. do { \
  4037. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4038. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4039. } while (0)
  4040. /* for systems using 64-bit format for bus addr */
  4041. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4042. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4043. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4044. do { \
  4045. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4046. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4047. } while (0)
  4048. /* for systems using 64-bit format for bus addr */
  4049. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4050. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4051. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4052. do { \
  4053. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4054. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4055. } while (0)
  4056. /* for systems using 32-bit format for bus addr */
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4058. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4060. do { \
  4061. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4062. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4063. } while (0)
  4064. /* for systems using 64-bit format for bus addr */
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4066. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4068. do { \
  4069. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4070. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4071. } while (0)
  4072. /* for systems using 64-bit format for bus addr */
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4074. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4076. do { \
  4077. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4078. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4079. } while (0)
  4080. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4081. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4082. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4083. do { \
  4084. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4085. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4086. } while (0)
  4087. /* for systems using 32-bit format for bus addr */
  4088. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4089. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4090. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4091. do { \
  4092. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4093. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4094. } while (0)
  4095. /* for systems using 64-bit format for bus addr */
  4096. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4097. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4098. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4099. do { \
  4100. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4101. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4102. } while (0)
  4103. /* for systems using 64-bit format for bus addr */
  4104. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4105. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4106. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4109. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4110. } while (0)
  4111. /* for systems using 32-bit format for bus addr */
  4112. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4113. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4114. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4117. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4118. } while (0)
  4119. /* for systems using 64-bit format for bus addr */
  4120. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4121. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4122. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4125. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4126. } while (0)
  4127. /* for systems using 64-bit format for bus addr */
  4128. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4129. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4130. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4131. do { \
  4132. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4133. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4134. } while (0)
  4135. /* for systems using 32-bit format for bus addr */
  4136. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4137. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4138. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4139. do { \
  4140. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4141. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4142. } while (0)
  4143. /* for systems using 64-bit format for bus addr */
  4144. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4145. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4146. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4147. do { \
  4148. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4149. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4150. } while (0)
  4151. /* for systems using 64-bit format for bus addr */
  4152. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4153. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4154. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4155. do { \
  4156. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4157. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4158. } while (0)
  4159. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4160. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4161. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4164. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4165. } while (0)
  4166. /* for systems using 32-bit format for bus addr */
  4167. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4168. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4169. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4172. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4173. } while (0)
  4174. /* for systems using 64-bit format for bus addr */
  4175. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4176. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4177. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4180. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4181. } while (0)
  4182. /* for systems using 64-bit format for bus addr */
  4183. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4184. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4185. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4188. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4189. } while (0)
  4190. /* for systems using 32-bit format for bus addr */
  4191. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4192. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4193. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4196. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4197. } while (0)
  4198. /* for systems using 64-bit format for bus addr */
  4199. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4200. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4201. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4204. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4205. } while (0)
  4206. /* for systems using 64-bit format for bus addr */
  4207. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4208. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4209. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4210. do { \
  4211. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4212. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4213. } while (0)
  4214. /*
  4215. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4216. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4217. * addresses are stored in a XXX-bit field.
  4218. * This macro is used to define both htt_wdi_ipa_config32_t and
  4219. * htt_wdi_ipa_config64_t structs.
  4220. */
  4221. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4222. _paddr__tx_comp_ring_base_addr_, \
  4223. _paddr__tx_comp_wr_idx_addr_, \
  4224. _paddr__tx_ce_wr_idx_addr_, \
  4225. _paddr__rx_ind_ring_base_addr_, \
  4226. _paddr__rx_ind_rd_idx_addr_, \
  4227. _paddr__rx_ind_wr_idx_addr_, \
  4228. _paddr__rx_ring2_base_addr_,\
  4229. _paddr__rx_ring2_rd_idx_addr_,\
  4230. _paddr__rx_ring2_wr_idx_addr_) \
  4231. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4232. { \
  4233. /* DWORD 0: flags and meta-data */ \
  4234. A_UINT32 \
  4235. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4236. reserved: 8, \
  4237. tx_pkt_pool_size: 16;\
  4238. /* DWORD 1 */\
  4239. _paddr__tx_comp_ring_base_addr_;\
  4240. /* DWORD 2 (or 3)*/\
  4241. A_UINT32 tx_comp_ring_size;\
  4242. /* DWORD 3 (or 4)*/\
  4243. _paddr__tx_comp_wr_idx_addr_;\
  4244. /* DWORD 4 (or 6)*/\
  4245. _paddr__tx_ce_wr_idx_addr_;\
  4246. /* DWORD 5 (or 8)*/\
  4247. _paddr__rx_ind_ring_base_addr_;\
  4248. /* DWORD 6 (or 10)*/\
  4249. A_UINT32 rx_ind_ring_size;\
  4250. /* DWORD 7 (or 11)*/\
  4251. _paddr__rx_ind_rd_idx_addr_;\
  4252. /* DWORD 8 (or 13)*/\
  4253. _paddr__rx_ind_wr_idx_addr_;\
  4254. /* DWORD 9 (or 15)*/\
  4255. _paddr__rx_ring2_base_addr_;\
  4256. /* DWORD 10 (or 17) */\
  4257. A_UINT32 rx_ring2_size;\
  4258. /* DWORD 11 (or 18) */\
  4259. _paddr__rx_ring2_rd_idx_addr_;\
  4260. /* DWORD 12 (or 20) */\
  4261. _paddr__rx_ring2_wr_idx_addr_;\
  4262. } POSTPACK
  4263. /* define a htt_wdi_ipa_config32_t type */
  4264. 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));
  4265. /* define a htt_wdi_ipa_config64_t type */
  4266. 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));
  4267. #if HTT_PADDR64
  4268. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4269. #else
  4270. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4271. #endif
  4272. enum htt_wdi_ipa_op_code {
  4273. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4274. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4275. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4276. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4277. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4278. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4279. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4280. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4281. /* keep this last */
  4282. HTT_WDI_IPA_OPCODE_MAX
  4283. };
  4284. /**
  4285. * @brief HTT WDI_IPA Operation Request Message
  4286. *
  4287. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4288. *
  4289. * @details
  4290. * HTT WDI_IPA Operation Request message is sent by host
  4291. * to either suspend or resume WDI_IPA TX or RX path.
  4292. * |31 24|23 16|15 8|7 0|
  4293. * |----------------+----------------+----------------+----------------|
  4294. * | op_code | Rsvd | msg_type |
  4295. * |-------------------------------------------------------------------|
  4296. *
  4297. * Header fields:
  4298. * - MSG_TYPE
  4299. * Bits 7:0
  4300. * Purpose: Identifies this as WDI_IPA Operation Request message
  4301. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4302. * - OP_CODE
  4303. * Bits 31:16
  4304. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4305. * value: = enum htt_wdi_ipa_op_code
  4306. */
  4307. PREPACK struct htt_wdi_ipa_op_request_t
  4308. {
  4309. /* DWORD 0: flags and meta-data */
  4310. A_UINT32
  4311. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4312. reserved: 8,
  4313. op_code: 16;
  4314. } POSTPACK;
  4315. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4316. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4317. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4318. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4319. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4320. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4321. do { \
  4322. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4323. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4324. } while (0)
  4325. /*
  4326. * @brief host -> target HTT_SRING_SETUP message
  4327. *
  4328. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4329. *
  4330. * @details
  4331. * After target is booted up, Host can send SRING setup message for
  4332. * each host facing LMAC SRING. Target setups up HW registers based
  4333. * on setup message and confirms back to Host if response_required is set.
  4334. * Host should wait for confirmation message before sending new SRING
  4335. * setup message
  4336. *
  4337. * The message would appear as follows:
  4338. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4339. * |--------------- +-----------------+-----------------+-----------------|
  4340. * | ring_type | ring_id | pdev_id | msg_type |
  4341. * |----------------------------------------------------------------------|
  4342. * | ring_base_addr_lo |
  4343. * |----------------------------------------------------------------------|
  4344. * | ring_base_addr_hi |
  4345. * |----------------------------------------------------------------------|
  4346. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4347. * |----------------------------------------------------------------------|
  4348. * | ring_head_offset32_remote_addr_lo |
  4349. * |----------------------------------------------------------------------|
  4350. * | ring_head_offset32_remote_addr_hi |
  4351. * |----------------------------------------------------------------------|
  4352. * | ring_tail_offset32_remote_addr_lo |
  4353. * |----------------------------------------------------------------------|
  4354. * | ring_tail_offset32_remote_addr_hi |
  4355. * |----------------------------------------------------------------------|
  4356. * | ring_msi_addr_lo |
  4357. * |----------------------------------------------------------------------|
  4358. * | ring_msi_addr_hi |
  4359. * |----------------------------------------------------------------------|
  4360. * | ring_msi_data |
  4361. * |----------------------------------------------------------------------|
  4362. * | intr_timer_th |IM| intr_batch_counter_th |
  4363. * |----------------------------------------------------------------------|
  4364. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4365. * |----------------------------------------------------------------------|
  4366. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4367. * |----------------------------------------------------------------------|
  4368. * Where
  4369. * IM = sw_intr_mode
  4370. * RR = response_required
  4371. * PTCF = prefetch_timer_cfg
  4372. * IP = IPA drop flag
  4373. *
  4374. * The message is interpreted as follows:
  4375. * dword0 - b'0:7 - msg_type: This will be set to
  4376. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4377. * b'8:15 - pdev_id:
  4378. * 0 (for rings at SOC/UMAC level),
  4379. * 1/2/3 mac id (for rings at LMAC level)
  4380. * b'16:23 - ring_id: identify which ring is to setup,
  4381. * more details can be got from enum htt_srng_ring_id
  4382. * b'24:31 - ring_type: identify type of host rings,
  4383. * more details can be got from enum htt_srng_ring_type
  4384. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4385. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4386. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4387. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4388. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4389. * SW_TO_HW_RING.
  4390. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4391. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4392. * Lower 32 bits of memory address of the remote variable
  4393. * storing the 4-byte word offset that identifies the head
  4394. * element within the ring.
  4395. * (The head offset variable has type A_UINT32.)
  4396. * Valid for HW_TO_SW and SW_TO_SW rings.
  4397. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4398. * Upper 32 bits of memory address of the remote variable
  4399. * storing the 4-byte word offset that identifies the head
  4400. * element within the ring.
  4401. * (The head offset variable has type A_UINT32.)
  4402. * Valid for HW_TO_SW and SW_TO_SW rings.
  4403. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4404. * Lower 32 bits of memory address of the remote variable
  4405. * storing the 4-byte word offset that identifies the tail
  4406. * element within the ring.
  4407. * (The tail offset variable has type A_UINT32.)
  4408. * Valid for HW_TO_SW and SW_TO_SW rings.
  4409. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4410. * Upper 32 bits of memory address of the remote variable
  4411. * storing the 4-byte word offset that identifies the tail
  4412. * element within the ring.
  4413. * (The tail offset variable has type A_UINT32.)
  4414. * Valid for HW_TO_SW and SW_TO_SW rings.
  4415. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4416. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4417. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4418. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4419. * dword10 - b'0:31 - ring_msi_data: MSI data
  4420. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4421. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4422. * dword11 - b'0:14 - intr_batch_counter_th:
  4423. * batch counter threshold is in units of 4-byte words.
  4424. * HW internally maintains and increments batch count.
  4425. * (see SRING spec for detail description).
  4426. * When batch count reaches threshold value, an interrupt
  4427. * is generated by HW.
  4428. * b'15 - sw_intr_mode:
  4429. * This configuration shall be static.
  4430. * Only programmed at power up.
  4431. * 0: generate pulse style sw interrupts
  4432. * 1: generate level style sw interrupts
  4433. * b'16:31 - intr_timer_th:
  4434. * The timer init value when timer is idle or is
  4435. * initialized to start downcounting.
  4436. * In 8us units (to cover a range of 0 to 524 ms)
  4437. * dword12 - b'0:15 - intr_low_threshold:
  4438. * Used only by Consumer ring to generate ring_sw_int_p.
  4439. * Ring entries low threshold water mark, that is used
  4440. * in combination with the interrupt timer as well as
  4441. * the the clearing of the level interrupt.
  4442. * b'16:18 - prefetch_timer_cfg:
  4443. * Used only by Consumer ring to set timer mode to
  4444. * support Application prefetch handling.
  4445. * The external tail offset/pointer will be updated
  4446. * at following intervals:
  4447. * 3'b000: (Prefetch feature disabled; used only for debug)
  4448. * 3'b001: 1 usec
  4449. * 3'b010: 4 usec
  4450. * 3'b011: 8 usec (default)
  4451. * 3'b100: 16 usec
  4452. * Others: Reserverd
  4453. * b'19 - response_required:
  4454. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4455. * b'20 - ipa_drop_flag:
  4456. Indicates that host will config ipa drop threshold percentage
  4457. * b'21:31 - reserved: reserved for future use
  4458. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4459. * b'8:15 - ipa drop high threshold percentage:
  4460. * b'16:31 - Reserved
  4461. */
  4462. PREPACK struct htt_sring_setup_t {
  4463. A_UINT32 msg_type: 8,
  4464. pdev_id: 8,
  4465. ring_id: 8,
  4466. ring_type: 8;
  4467. A_UINT32 ring_base_addr_lo;
  4468. A_UINT32 ring_base_addr_hi;
  4469. A_UINT32 ring_size: 16,
  4470. ring_entry_size: 8,
  4471. ring_misc_cfg_flag: 8;
  4472. A_UINT32 ring_head_offset32_remote_addr_lo;
  4473. A_UINT32 ring_head_offset32_remote_addr_hi;
  4474. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4475. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4476. A_UINT32 ring_msi_addr_lo;
  4477. A_UINT32 ring_msi_addr_hi;
  4478. A_UINT32 ring_msi_data;
  4479. A_UINT32 intr_batch_counter_th: 15,
  4480. sw_intr_mode: 1,
  4481. intr_timer_th: 16;
  4482. A_UINT32 intr_low_threshold: 16,
  4483. prefetch_timer_cfg: 3,
  4484. response_required: 1,
  4485. ipa_drop_flag: 1,
  4486. reserved1: 11;
  4487. A_UINT32 ipa_drop_low_threshold: 8,
  4488. ipa_drop_high_threshold: 8,
  4489. reserved: 16;
  4490. } POSTPACK;
  4491. enum htt_srng_ring_type {
  4492. HTT_HW_TO_SW_RING = 0,
  4493. HTT_SW_TO_HW_RING,
  4494. HTT_SW_TO_SW_RING,
  4495. /* Insert new ring types above this line */
  4496. };
  4497. enum htt_srng_ring_id {
  4498. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4499. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4500. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4501. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4502. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4503. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4504. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4505. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4506. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4507. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4508. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4509. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4510. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4511. /* Add Other SRING which can't be directly configured by host software above this line */
  4512. };
  4513. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4514. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4515. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4516. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4517. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4518. HTT_SRING_SETUP_PDEV_ID_S)
  4519. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4520. do { \
  4521. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4522. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4523. } while (0)
  4524. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4525. #define HTT_SRING_SETUP_RING_ID_S 16
  4526. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4527. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4528. HTT_SRING_SETUP_RING_ID_S)
  4529. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4530. do { \
  4531. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4532. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4533. } while (0)
  4534. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4535. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4536. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4537. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4538. HTT_SRING_SETUP_RING_TYPE_S)
  4539. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4540. do { \
  4541. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4542. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4543. } while (0)
  4544. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4545. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4546. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4547. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4548. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4549. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4550. do { \
  4551. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4552. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4553. } while (0)
  4554. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4555. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4556. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4557. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4558. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4559. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4560. do { \
  4561. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4562. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4563. } while (0)
  4564. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4565. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4566. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4567. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4568. HTT_SRING_SETUP_RING_SIZE_S)
  4569. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4570. do { \
  4571. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4572. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4573. } while (0)
  4574. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4575. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4576. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4577. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4578. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4579. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4580. do { \
  4581. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4582. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4583. } while (0)
  4584. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4585. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4586. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4587. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4588. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4589. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4590. do { \
  4591. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4592. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4593. } while (0)
  4594. /* This control bit is applicable to only Producer, which updates Ring ID field
  4595. * of each descriptor before pushing into the ring.
  4596. * 0: updates ring_id(default)
  4597. * 1: ring_id updating disabled */
  4598. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4599. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4600. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4601. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4602. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4603. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4604. do { \
  4605. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4606. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4607. } while (0)
  4608. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4609. * of each descriptor before pushing into the ring.
  4610. * 0: updates Loopcnt(default)
  4611. * 1: Loopcnt updating disabled */
  4612. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4613. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4614. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4615. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4616. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4617. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4618. do { \
  4619. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4620. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4621. } while (0)
  4622. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4623. * into security_id port of GXI/AXI. */
  4624. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4625. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4626. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4627. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4628. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4629. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4630. do { \
  4631. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4632. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4633. } while (0)
  4634. /* During MSI write operation, SRNG drives value of this register bit into
  4635. * swap bit of GXI/AXI. */
  4636. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4637. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4638. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4639. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4640. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4641. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4642. do { \
  4643. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4644. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4645. } while (0)
  4646. /* During Pointer write operation, SRNG drives value of this register bit into
  4647. * swap bit of GXI/AXI. */
  4648. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4649. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4650. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4651. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4652. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4653. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4654. do { \
  4655. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4656. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4657. } while (0)
  4658. /* During any data or TLV write operation, SRNG drives value of this register
  4659. * bit into swap bit of GXI/AXI. */
  4660. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4661. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4662. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4663. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4664. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4665. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4666. do { \
  4667. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4668. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4669. } while (0)
  4670. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4671. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4672. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4673. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4674. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4675. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4676. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4677. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4678. do { \
  4679. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4680. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4681. } while (0)
  4682. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4683. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4684. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4685. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4686. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4687. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4688. do { \
  4689. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4690. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4691. } while (0)
  4692. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4693. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4694. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4695. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4696. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4697. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4698. do { \
  4699. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4700. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4701. } while (0)
  4702. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4703. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4704. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4705. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4706. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4707. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4708. do { \
  4709. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4710. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4711. } while (0)
  4712. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4713. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4714. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4715. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4716. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4717. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4718. do { \
  4719. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4720. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4721. } while (0)
  4722. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4723. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4724. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4725. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4726. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4727. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4728. do { \
  4729. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4730. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4731. } while (0)
  4732. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4733. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4734. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4735. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4736. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4737. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4740. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4741. } while (0)
  4742. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4743. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4744. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4745. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4746. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4747. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4748. do { \
  4749. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4750. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4751. } while (0)
  4752. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4753. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4754. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4755. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4756. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4757. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4758. do { \
  4759. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4760. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4761. } while (0)
  4762. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4763. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4764. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4765. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4766. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4767. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4770. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4771. } while (0)
  4772. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4773. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4774. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4775. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4776. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4777. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4778. do { \
  4779. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4780. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4781. } while (0)
  4782. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4783. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4784. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4785. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4786. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4787. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4788. do { \
  4789. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4790. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4791. } while (0)
  4792. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4793. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4794. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4795. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4796. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4797. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4798. do { \
  4799. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4800. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4801. } while (0)
  4802. /**
  4803. * @brief host -> target RX ring selection config message
  4804. *
  4805. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4806. *
  4807. * @details
  4808. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4809. * configure RXDMA rings.
  4810. * The configuration is per ring based and includes both packet subtypes
  4811. * and PPDU/MPDU TLVs.
  4812. *
  4813. * The message would appear as follows:
  4814. *
  4815. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4816. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4817. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4818. * |-------------------------------------------------------------------|
  4819. * | rsvd2 | ring_buffer_size |
  4820. * |-------------------------------------------------------------------|
  4821. * | packet_type_enable_flags_0 |
  4822. * |-------------------------------------------------------------------|
  4823. * | packet_type_enable_flags_1 |
  4824. * |-------------------------------------------------------------------|
  4825. * | packet_type_enable_flags_2 |
  4826. * |-------------------------------------------------------------------|
  4827. * | packet_type_enable_flags_3 |
  4828. * |-------------------------------------------------------------------|
  4829. * | tlv_filter_in_flags |
  4830. * |-------------------------------------------------------------------|
  4831. * | rx_header_offset | rx_packet_offset |
  4832. * |-------------------------------------------------------------------|
  4833. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4834. * |-------------------------------------------------------------------|
  4835. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4836. * |-------------------------------------------------------------------|
  4837. * | rsvd3 | rx_attention_offset |
  4838. * |-------------------------------------------------------------------|
  4839. * | rsvd4 | mo| fp| rx_drop_threshold |
  4840. * | |ndp|ndp| |
  4841. * |-------------------------------------------------------------------|
  4842. * Where:
  4843. * PS = pkt_swap
  4844. * SS = status_swap
  4845. * OV = rx_offsets_valid
  4846. * DT = drop_thresh_valid
  4847. * The message is interpreted as follows:
  4848. * dword0 - b'0:7 - msg_type: This will be set to
  4849. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4850. * b'8:15 - pdev_id:
  4851. * 0 (for rings at SOC/UMAC level),
  4852. * 1/2/3 mac id (for rings at LMAC level)
  4853. * b'16:23 - ring_id : Identify the ring to configure.
  4854. * More details can be got from enum htt_srng_ring_id
  4855. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4856. * BUF_RING_CFG_0 defs within HW .h files,
  4857. * e.g. wmac_top_reg_seq_hwioreg.h
  4858. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4859. * BUF_RING_CFG_0 defs within HW .h files,
  4860. * e.g. wmac_top_reg_seq_hwioreg.h
  4861. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4862. * configuration fields are valid
  4863. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4864. * rx_drop_threshold field is valid
  4865. * b'28:31 - rsvd1: reserved for future use
  4866. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4867. * in byte units.
  4868. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4869. * - b'16:31 - rsvd2: Reserved for future use
  4870. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4871. * Enable MGMT packet from 0b0000 to 0b1001
  4872. * bits from low to high: FP, MD, MO - 3 bits
  4873. * FP: Filter_Pass
  4874. * MD: Monitor_Direct
  4875. * MO: Monitor_Other
  4876. * 10 mgmt subtypes * 3 bits -> 30 bits
  4877. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4878. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4879. * Enable MGMT packet from 0b1010 to 0b1111
  4880. * bits from low to high: FP, MD, MO - 3 bits
  4881. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4882. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4883. * Enable CTRL packet from 0b0000 to 0b1001
  4884. * bits from low to high: FP, MD, MO - 3 bits
  4885. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4886. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4887. * Enable CTRL packet from 0b1010 to 0b1111,
  4888. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4889. * bits from low to high: FP, MD, MO - 3 bits
  4890. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4891. * dword6 - b'0:31 - tlv_filter_in_flags:
  4892. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4893. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4894. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4895. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4896. * A value of 0 will be considered as ignore this config.
  4897. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4898. * e.g. wmac_top_reg_seq_hwioreg.h
  4899. * - b'16:31 - rx_header_offset: rx_header_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. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_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_2 defs within HW .h files,
  4908. * e.g. wmac_top_reg_seq_hwioreg.h
  4909. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_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. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_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_3 defs within HW .h files,
  4918. * e.g. wmac_top_reg_seq_hwioreg.h
  4919. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_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. * dword10- b'0:15 - rx_attention_offset: rx_attention_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_4 defs within HW .h files,
  4928. * e.g. wmac_top_reg_seq_hwioreg.h
  4929. * - b'16:31 - rsvd3 for future use
  4930. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4931. * to source rings. Consumer drops packets if the available
  4932. * words in the ring falls below the configured threshold
  4933. * value.
  4934. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4935. * by host. 1 -> subscribed
  4936. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4937. * by host. 1 -> subscribed
  4938. */
  4939. PREPACK struct htt_rx_ring_selection_cfg_t {
  4940. A_UINT32 msg_type: 8,
  4941. pdev_id: 8,
  4942. ring_id: 8,
  4943. status_swap: 1,
  4944. pkt_swap: 1,
  4945. rx_offsets_valid: 1,
  4946. drop_thresh_valid: 1,
  4947. rsvd1: 4;
  4948. A_UINT32 ring_buffer_size: 16,
  4949. rsvd2: 16;
  4950. A_UINT32 packet_type_enable_flags_0;
  4951. A_UINT32 packet_type_enable_flags_1;
  4952. A_UINT32 packet_type_enable_flags_2;
  4953. A_UINT32 packet_type_enable_flags_3;
  4954. A_UINT32 tlv_filter_in_flags;
  4955. A_UINT32 rx_packet_offset: 16,
  4956. rx_header_offset: 16;
  4957. A_UINT32 rx_mpdu_end_offset: 16,
  4958. rx_mpdu_start_offset: 16;
  4959. A_UINT32 rx_msdu_end_offset: 16,
  4960. rx_msdu_start_offset: 16;
  4961. A_UINT32 rx_attn_offset: 16,
  4962. rsvd3: 16;
  4963. A_UINT32 rx_drop_threshold: 10,
  4964. fp_ndp: 1,
  4965. mo_ndp: 1,
  4966. rsvd4: 20;
  4967. } POSTPACK;
  4968. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4969. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4970. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4971. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4972. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4973. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4974. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4977. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4978. } while (0)
  4979. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4980. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4981. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4982. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4983. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4984. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4985. do { \
  4986. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4987. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4988. } while (0)
  4989. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4990. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4991. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4992. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4993. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4994. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4997. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4998. } while (0)
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5002. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5003. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5005. do { \
  5006. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5007. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5008. } while (0)
  5009. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5010. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5011. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5012. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5013. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5014. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5015. do { \
  5016. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5017. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5018. } while (0)
  5019. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5020. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5021. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5022. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5023. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5024. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5025. do { \
  5026. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5027. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5028. } while (0)
  5029. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5030. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5031. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5032. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5033. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5034. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5035. do { \
  5036. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5037. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5038. } while (0)
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5042. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5043. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5045. do { \
  5046. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5047. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5048. } while (0)
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5052. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5053. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5055. do { \
  5056. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5057. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5058. } while (0)
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5062. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5063. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5065. do { \
  5066. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5067. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5068. } while (0)
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5072. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5073. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5075. do { \
  5076. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5077. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5078. } while (0)
  5079. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5080. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5081. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5082. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5083. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5084. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5085. do { \
  5086. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5087. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5088. } while (0)
  5089. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5090. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5091. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5092. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5093. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5094. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5095. do { \
  5096. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5097. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5098. } while (0)
  5099. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5100. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5101. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5102. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5103. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5104. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5105. do { \
  5106. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5107. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5108. } while (0)
  5109. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5110. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5111. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5112. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5113. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5114. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5115. do { \
  5116. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5117. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5118. } while (0)
  5119. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5120. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5121. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5122. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5123. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5124. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5125. do { \
  5126. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5127. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5128. } while (0)
  5129. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5130. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5131. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5132. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5133. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5134. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5135. do { \
  5136. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5137. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5138. } while (0)
  5139. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5140. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5141. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5142. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5143. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5144. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5145. do { \
  5146. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5147. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5148. } while (0)
  5149. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5150. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5151. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5152. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5153. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5154. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5155. do { \
  5156. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5157. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5158. } while (0)
  5159. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5160. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5161. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5162. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5163. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5164. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5165. do { \
  5166. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5167. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5168. } while (0)
  5169. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5170. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5171. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5172. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5173. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5174. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5175. do { \
  5176. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5177. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5178. } while (0)
  5179. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5180. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5181. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5182. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5183. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5184. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5185. do { \
  5186. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5187. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5188. } while (0)
  5189. /*
  5190. * Subtype based MGMT frames enable bits.
  5191. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5192. */
  5193. /* association request */
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5200. /* association response */
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5207. /* Reassociation request */
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5214. /* Reassociation response */
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5221. /* Probe request */
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5228. /* Probe response */
  5229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5233. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5234. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5235. /* Timing Advertisement */
  5236. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5237. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5238. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5239. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5240. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5241. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5242. /* Reserved */
  5243. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5244. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5245. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5246. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5247. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5248. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5249. /* Beacon */
  5250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5253. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5254. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5255. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5256. /* ATIM */
  5257. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5258. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5259. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5260. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5261. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5262. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5263. /* Disassociation */
  5264. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5265. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5266. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5267. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5268. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5269. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5270. /* Authentication */
  5271. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5272. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5273. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5274. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5275. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5276. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5277. /* Deauthentication */
  5278. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5279. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5280. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5281. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5282. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5283. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5284. /* Action */
  5285. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5286. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5287. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5288. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5289. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5290. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5291. /* Action No Ack */
  5292. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5293. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5294. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5295. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5296. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5297. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5298. /* Reserved */
  5299. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5300. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5301. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5302. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5303. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5304. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5305. /*
  5306. * Subtype based CTRL frames enable bits.
  5307. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5308. */
  5309. /* Reserved */
  5310. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5311. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5312. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5313. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5314. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5315. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5316. /* Reserved */
  5317. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5318. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5319. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5320. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5321. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5322. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5323. /* Reserved */
  5324. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5325. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5326. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5327. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5328. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5329. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5330. /* Reserved */
  5331. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5332. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5333. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5334. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5335. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5336. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5337. /* Reserved */
  5338. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5339. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5340. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5341. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5342. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5343. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5344. /* Reserved */
  5345. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5346. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5347. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5348. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5349. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5350. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5351. /* Reserved */
  5352. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5354. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5356. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5357. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5358. /* Control Wrapper */
  5359. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5360. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5361. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5362. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5365. /* Block Ack Request */
  5366. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5367. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5369. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5370. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5371. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5372. /* Block Ack*/
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5379. /* PS-POLL */
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5381. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5382. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5386. /* RTS */
  5387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5393. /* CTS */
  5394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5395. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5398. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5400. /* ACK */
  5401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5402. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5407. /* CF-END */
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5414. /* CF-END + CF-ACK */
  5415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5421. /* Multicast data */
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5428. /* Unicast data */
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5435. /* NULL data */
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5443. do { \
  5444. HTT_CHECK_SET_VAL(httsym, value); \
  5445. (word) |= (value) << httsym##_S; \
  5446. } while (0)
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5448. (((word) & httsym##_M) >> httsym##_S)
  5449. #define htt_rx_ring_pkt_enable_subtype_set( \
  5450. word, flag, mode, type, subtype, val) \
  5451. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5452. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5453. #define htt_rx_ring_pkt_enable_subtype_get( \
  5454. word, flag, mode, type, subtype) \
  5455. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5456. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5457. /* Definition to filter in TLVs */
  5458. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5459. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5460. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5461. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5462. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5464. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5467. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5468. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5469. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5470. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5471. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5472. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5473. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5474. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5475. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5476. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5477. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5478. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5479. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5480. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5481. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5482. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5483. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5484. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5485. do { \
  5486. HTT_CHECK_SET_VAL(httsym, enable); \
  5487. (word) |= (enable) << httsym##_S; \
  5488. } while (0)
  5489. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5490. (((word) & httsym##_M) >> httsym##_S)
  5491. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5492. HTT_RX_RING_TLV_ENABLE_SET( \
  5493. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5494. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5495. HTT_RX_RING_TLV_ENABLE_GET( \
  5496. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5497. /**
  5498. * @brief host -> target TX monitor config message
  5499. *
  5500. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5501. *
  5502. * @details
  5503. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5504. * configure RXDMA rings.
  5505. * The configuration is per ring based and includes both packet types
  5506. * and PPDU/MPDU TLVs.
  5507. *
  5508. * The message would appear as follows:
  5509. *
  5510. * |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|
  5511. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5512. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5513. * |-----------+--------+--------+-----+------------------------------------|
  5514. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5515. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5516. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5517. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5518. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5519. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5520. * |------------------------------------------------------------------------|
  5521. * | tlv_filter_mask_in0 |
  5522. * |------------------------------------------------------------------------|
  5523. * | tlv_filter_mask_in1 |
  5524. * |------------------------------------------------------------------------|
  5525. * | tlv_filter_mask_in2 |
  5526. * |------------------------------------------------------------------------|
  5527. * | tlv_filter_mask_in3 |
  5528. * |-----------------+-----------------+---------------------+--------------|
  5529. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5530. * |------------------------------------------------------------------------|
  5531. * | pcu_ppdu_setup_word_mask |
  5532. * |--------------------+--+--+--+-----+---------------------+--------------|
  5533. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5534. * |------------------------------------------------------------------------|
  5535. *
  5536. * Where:
  5537. * PS = pkt_swap
  5538. * SS = status_swap
  5539. * The message is interpreted as follows:
  5540. * dword0 - b'0:7 - msg_type: This will be set to
  5541. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5542. * b'8:15 - pdev_id:
  5543. * 0 (for rings at SOC level),
  5544. * 1/2/3 mac id (for rings at LMAC level)
  5545. * b'16:23 - ring_id : Identify the ring to configure.
  5546. * More details can be got from enum htt_srng_ring_id
  5547. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5548. * BUF_RING_CFG_0 defs within HW .h files,
  5549. * e.g. wmac_top_reg_seq_hwioreg.h
  5550. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5551. * BUF_RING_CFG_0 defs within HW .h files,
  5552. * e.g. wmac_top_reg_seq_hwioreg.h
  5553. * b'26:31 - rsvd1: reserved for future use
  5554. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5555. * in byte units.
  5556. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5557. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5558. * 64, 128, 256.
  5559. * If all 3 bits are set config length is > 256.
  5560. * if val is '0', then ignore this field.
  5561. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5562. * 64, 128, 256.
  5563. * If all 3 bits are set config length is > 256.
  5564. * if val is '0', then ignore this field.
  5565. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5566. * 64, 128, 256.
  5567. * If all 3 bits are set config length is > 256.
  5568. * If val is '0', then ignore this field.
  5569. * - b'25:31 - rsvd2: Reserved for future use
  5570. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5571. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5572. * If packet_type_enable_flags is '1' for MGMT type,
  5573. * monitor will ignore this bit and allow this TLV.
  5574. * If packet_type_enable_flags is '0' for MGMT type,
  5575. * monitor will use this bit to enable/disable logging
  5576. * of this TLV.
  5577. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5578. * If packet_type_enable_flags is '1' for CTRL type,
  5579. * monitor will ignore this bit and allow this TLV.
  5580. * If packet_type_enable_flags is '0' for CTRL type,
  5581. * monitor will use this bit to enable/disable logging
  5582. * of this TLV.
  5583. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5584. * If packet_type_enable_flags is '1' for DATA type,
  5585. * monitor will ignore this bit and allow this TLV.
  5586. * If packet_type_enable_flags is '0' for DATA type,
  5587. * monitor will use this bit to enable/disable logging
  5588. * of this TLV.
  5589. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5590. * If packet_type_enable_flags is '1' for MGMT type,
  5591. * monitor will ignore this bit and allow this TLV.
  5592. * If packet_type_enable_flags is '0' for MGMT type,
  5593. * monitor will use this bit to enable/disable logging
  5594. * of this TLV.
  5595. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5596. * If packet_type_enable_flags is '1' for CTRL type,
  5597. * monitor will ignore this bit and allow this TLV.
  5598. * If packet_type_enable_flags is '0' for CTRL type,
  5599. * monitor will use this bit to enable/disable logging
  5600. * of this TLV.
  5601. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5602. * If packet_type_enable_flags is '1' for DATA type,
  5603. * monitor will ignore this bit and allow this TLV.
  5604. * If packet_type_enable_flags is '0' for DATA type,
  5605. * monitor will use this bit to enable/disable logging
  5606. * of this TLV.
  5607. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5608. * If packet_type_enable_flags is '1' for MGMT type,
  5609. * monitor will ignore this bit and allow this TLV.
  5610. * If packet_type_enable_flags is '0' for MGMT type,
  5611. * monitor will use this bit to enable/disable logging
  5612. * of this TLV.
  5613. * If filter_in_TX_MPDU_START = 1 it is recommended
  5614. * to set this bit.
  5615. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5616. * If packet_type_enable_flags is '1' for CTRL type,
  5617. * monitor will ignore this bit and allow this TLV.
  5618. * If packet_type_enable_flags is '0' for CTRL type,
  5619. * monitor will use this bit to enable/disable logging
  5620. * of this TLV.
  5621. * If filter_in_TX_MPDU_START = 1 it is recommended
  5622. * to set this bit.
  5623. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5624. * If packet_type_enable_flags is '1' for DATA type,
  5625. * monitor will ignore this bit and allow this TLV.
  5626. * If packet_type_enable_flags is '0' for DATA type,
  5627. * monitor will use this bit to enable/disable logging
  5628. * of this TLV.
  5629. * If filter_in_TX_MPDU_START = 1 it is recommended
  5630. * to set this bit.
  5631. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5632. * If packet_type_enable_flags is '1' for MGMT type,
  5633. * monitor will ignore this bit and allow this TLV.
  5634. * If packet_type_enable_flags is '0' for MGMT type,
  5635. * monitor will use this bit to enable/disable logging
  5636. * of this TLV.
  5637. * If filter_in_TX_MSDU_START = 1 it is recommended
  5638. * to set this bit.
  5639. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5640. * If packet_type_enable_flags is '1' for CTRL type,
  5641. * monitor will ignore this bit and allow this TLV.
  5642. * If packet_type_enable_flags is '0' for CTRL type,
  5643. * monitor will use this bit to enable/disable logging
  5644. * of this TLV.
  5645. * If filter_in_TX_MSDU_START = 1 it is recommended
  5646. * to set this bit.
  5647. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5648. * If packet_type_enable_flags is '1' for DATA type,
  5649. * monitor will ignore this bit and allow this TLV.
  5650. * If packet_type_enable_flags is '0' for DATA type,
  5651. * monitor will use this bit to enable/disable logging
  5652. * of this TLV.
  5653. * If filter_in_TX_MSDU_START = 1 it is recommended
  5654. * to set this bit.
  5655. * b'15:31 - rsvd3: Reserved for future use
  5656. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5657. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5658. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5659. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5660. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5661. * - b'8:15 - tx_peer_entry_word_mask:
  5662. * - b'16:23 - tx_queue_ext_word_mask:
  5663. * - b'24:31 - tx_msdu_start_word_mask:
  5664. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5665. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5666. * - b'8:15 - rxpcu_user_setup_word_mask:
  5667. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5668. * MGMT, CTRL, DATA
  5669. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5670. * 0 -> MSDU level logging is enabled
  5671. * (valid only if bit is set in
  5672. * pkt_type_enable_msdu_or_mpdu_logging)
  5673. * 1 -> MPDU level logging is enabled
  5674. * (valid only if bit is set in
  5675. * pkt_type_enable_msdu_or_mpdu_logging)
  5676. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5677. * 0 -> MSDU level logging is enabled
  5678. * (valid only if bit is set in
  5679. * pkt_type_enable_msdu_or_mpdu_logging)
  5680. * 1 -> MPDU level logging is enabled
  5681. * (valid only if bit is set in
  5682. * pkt_type_enable_msdu_or_mpdu_logging)
  5683. * - b'21 - dma_mpdu_data(D) : For DATA
  5684. * 0 -> MSDU level logging is enabled
  5685. * (valid only if bit is set in
  5686. * pkt_type_enable_msdu_or_mpdu_logging)
  5687. * 1 -> MPDU level logging is enabled
  5688. * (valid only if bit is set in
  5689. * pkt_type_enable_msdu_or_mpdu_logging)
  5690. * - b'22:31 - rsvd4 for future use
  5691. */
  5692. PREPACK struct htt_tx_monitor_cfg_t {
  5693. A_UINT32 msg_type: 8,
  5694. pdev_id: 8,
  5695. ring_id: 8,
  5696. status_swap: 1,
  5697. pkt_swap: 1,
  5698. rsvd1: 6;
  5699. A_UINT32 ring_buffer_size: 16,
  5700. config_length_mgmt: 3,
  5701. config_length_ctrl: 3,
  5702. config_length_data: 3,
  5703. rsvd2: 7;
  5704. A_UINT32 pkt_type_enable_flags: 3,
  5705. filter_in_tx_mpdu_start_mgmt: 1,
  5706. filter_in_tx_mpdu_start_ctrl: 1,
  5707. filter_in_tx_mpdu_start_data: 1,
  5708. filter_in_tx_msdu_start_mgmt: 1,
  5709. filter_in_tx_msdu_start_ctrl: 1,
  5710. filter_in_tx_msdu_start_data: 1,
  5711. filter_in_tx_mpdu_end_mgmt: 1,
  5712. filter_in_tx_mpdu_end_ctrl: 1,
  5713. filter_in_tx_mpdu_end_data: 1,
  5714. filter_in_tx_msdu_end_mgmt: 1,
  5715. filter_in_tx_msdu_end_ctrl: 1,
  5716. filter_in_tx_msdu_end_data: 1,
  5717. rsvd3: 17;
  5718. A_UINT32 tlv_filter_mask_in0;
  5719. A_UINT32 tlv_filter_mask_in1;
  5720. A_UINT32 tlv_filter_mask_in2;
  5721. A_UINT32 tlv_filter_mask_in3;
  5722. A_UINT32 tx_fes_setup_word_mask: 8,
  5723. tx_peer_entry_word_mask: 8,
  5724. tx_queue_ext_word_mask: 8,
  5725. tx_msdu_start_word_mask: 8;
  5726. A_UINT32 pcu_ppdu_setup_word_mask;
  5727. A_UINT32 tx_mpdu_start_word_mask: 8,
  5728. rxpcu_user_setup_word_mask: 8,
  5729. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5730. dma_mpdu_mgmt: 1,
  5731. dma_mpdu_ctrl: 1,
  5732. dma_mpdu_data: 1,
  5733. rsvd4: 10;
  5734. } POSTPACK;
  5735. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5736. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5737. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5738. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5739. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5740. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5741. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5742. do { \
  5743. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5744. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5745. } while (0)
  5746. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5747. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5748. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5749. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5750. HTT_TX_MONITOR_CFG_RING_ID_S)
  5751. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5752. do { \
  5753. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5754. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5755. } while (0)
  5756. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5757. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5758. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5759. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5760. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5761. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5762. do { \
  5763. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5764. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5765. } while (0)
  5766. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5767. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5768. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5769. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5770. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5771. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5772. do { \
  5773. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5774. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5775. } while (0)
  5776. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5777. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5778. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5779. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5780. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5781. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5782. do { \
  5783. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5784. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5785. } while (0)
  5786. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5787. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  5788. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5789. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5790. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5791. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5792. do { \
  5793. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5794. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5795. } while (0)
  5796. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5797. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  5798. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5799. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5800. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5801. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5802. do { \
  5803. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5804. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5805. } while (0)
  5806. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5807. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  5808. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5809. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5810. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5811. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5812. do { \
  5813. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5814. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5815. } while (0)
  5816. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5817. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5818. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5819. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5820. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5821. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5822. do { \
  5823. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5824. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5825. } while (0)
  5826. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  5827. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  5828. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  5829. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  5830. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  5831. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  5832. do { \
  5833. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  5834. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  5835. } while (0)
  5836. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  5837. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  5838. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  5839. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  5840. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  5841. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  5842. do { \
  5843. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  5844. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  5845. } while (0
  5846. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  5847. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  5848. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  5849. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  5850. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  5851. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  5852. do { \
  5853. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  5854. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  5855. } while (0)
  5856. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  5857. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  5858. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  5859. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  5860. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  5861. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  5862. do { \
  5863. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  5864. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  5865. } while (0)
  5866. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  5867. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  5868. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  5869. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  5870. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  5871. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  5872. do { \
  5873. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  5874. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  5875. } while (0
  5876. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  5877. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  5878. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  5879. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  5880. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  5881. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  5882. do { \
  5883. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  5884. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  5885. } while (0)
  5886. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  5887. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  5888. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  5889. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  5890. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  5891. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  5892. do { \
  5893. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  5894. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  5895. } while (0)
  5896. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  5897. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  5898. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  5899. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  5900. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  5901. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  5902. do { \
  5903. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  5904. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  5905. } while (0
  5906. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  5907. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  5908. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  5909. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  5910. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  5911. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  5912. do { \
  5913. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  5914. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  5915. } while (0)
  5916. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  5917. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  5918. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  5919. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  5920. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  5921. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  5922. do { \
  5923. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  5924. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  5925. } while (0)
  5926. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  5927. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  5928. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  5929. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  5930. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  5931. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  5932. do { \
  5933. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  5934. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  5935. } while (0
  5936. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  5937. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  5938. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  5939. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  5940. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  5941. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  5942. do { \
  5943. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  5944. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  5945. } while (0)
  5946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5949. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5950. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5952. do { \
  5953. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5954. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5955. } while (0)
  5956. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  5957. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5958. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5959. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5960. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5961. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5962. do { \
  5963. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5964. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5965. } while (0)
  5966. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  5967. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  5968. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5969. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5970. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5971. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5972. do { \
  5973. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5974. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5975. } while (0)
  5976. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  5977. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  5978. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5979. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5980. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5981. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5982. do { \
  5983. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5984. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5985. } while (0)
  5986. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  5987. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  5988. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5989. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5990. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5991. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5992. do { \
  5993. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5994. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5995. } while (0)
  5996. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  5997. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  5998. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5999. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6000. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6001. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6002. do { \
  6003. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6004. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6005. } while (0)
  6006. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6007. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6008. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6009. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6010. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6011. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6012. do { \
  6013. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6014. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6015. } while (0)
  6016. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6017. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6018. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6019. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6020. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6021. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6022. do { \
  6023. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6024. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6025. } while (0)
  6026. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6027. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6028. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6029. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6030. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6031. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6032. do { \
  6033. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6034. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6035. } while (0)
  6036. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6037. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6038. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6039. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6040. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6041. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6042. do { \
  6043. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6044. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6045. } while (0)
  6046. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6047. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6048. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6049. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6050. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6051. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6052. do { \
  6053. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6054. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6055. } while (0)
  6056. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6057. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6058. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6059. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6060. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6061. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6062. do { \
  6063. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6064. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6065. } while (0)
  6066. /*
  6067. * pkt_type_enable_flags
  6068. */
  6069. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6070. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6071. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6072. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6073. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6074. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6075. /*
  6076. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6077. */
  6078. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6079. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6080. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6081. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6082. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6083. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6084. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6085. do { \
  6086. HTT_CHECK_SET_VAL(httsym, value); \
  6087. (word) |= (value) << httsym##_S; \
  6088. } while (0)
  6089. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6090. (((word) & httsym##_M) >> httsym##_S)
  6091. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6092. * type -> MGMT, CTRL, DATA*/
  6093. #define htt_tx_ring_pkt_type_set( \
  6094. word, mode, type, val) \
  6095. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6096. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6097. #define htt_tx_ring_pkt_type_get( \
  6098. word, mode, type) \
  6099. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6100. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6101. /* Definition to filter in TLVs */
  6102. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6103. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6104. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6105. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6106. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6107. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6108. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6109. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6110. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6111. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6112. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6113. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6114. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6115. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6116. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6117. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6118. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6119. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6120. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6121. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6122. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6123. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6124. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6125. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6126. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6130. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6131. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6133. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6134. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6135. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6136. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6137. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6138. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6139. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6140. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6141. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6142. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6143. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6144. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6145. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6146. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6147. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6148. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6149. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6150. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6151. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6152. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6153. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6154. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6155. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6156. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6157. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6158. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6159. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6160. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6161. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6162. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6163. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6164. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6165. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6166. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6167. do { \
  6168. HTT_CHECK_SET_VAL(httsym, enable); \
  6169. (word) |= (enable) << httsym##_S; \
  6170. } while (0)
  6171. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6172. (((word) & httsym##_M) >> httsym##_S)
  6173. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6174. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6175. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6176. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6177. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6178. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6179. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6180. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6181. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6182. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6183. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6184. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6185. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6186. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6187. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6188. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6189. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6190. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6191. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6192. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6193. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6194. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6195. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6196. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6197. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6198. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6199. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6200. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6201. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6202. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6203. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6204. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6205. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6206. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6207. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6208. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6209. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6210. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6211. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6212. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6213. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6214. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6215. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6216. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6217. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6218. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6219. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6220. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6221. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6222. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6223. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6224. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6225. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6226. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6227. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6228. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6229. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6230. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6231. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6232. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6233. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6234. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6235. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6236. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6237. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6238. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6239. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6240. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6241. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6242. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6243. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6244. do { \
  6245. HTT_CHECK_SET_VAL(httsym, enable); \
  6246. (word) |= (enable) << httsym##_S; \
  6247. } while (0)
  6248. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6249. (((word) & httsym##_M) >> httsym##_S)
  6250. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6251. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6252. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6253. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6254. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6255. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6256. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6257. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6258. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6259. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6260. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6261. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6262. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6263. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6264. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6265. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6266. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6267. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6268. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6269. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6270. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6271. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6272. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6273. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6274. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6275. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6276. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6277. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6278. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6279. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6280. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6281. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6282. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6283. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6284. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6285. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6286. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6287. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6288. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6289. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6290. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6291. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6292. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6293. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6294. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6295. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6296. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6297. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6298. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6299. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6300. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6301. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6302. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6303. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6304. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6305. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6306. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6307. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6308. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6309. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6310. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6311. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6312. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6313. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6314. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6315. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6316. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6317. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6318. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6319. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6320. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6321. do { \
  6322. HTT_CHECK_SET_VAL(httsym, enable); \
  6323. (word) |= (enable) << httsym##_S; \
  6324. } while (0)
  6325. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6326. (((word) & httsym##_M) >> httsym##_S)
  6327. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6328. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6329. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6330. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6331. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6332. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6333. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6334. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6335. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6336. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6337. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6338. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6339. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6340. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6341. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6342. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6343. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6344. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6345. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6346. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6347. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6348. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6349. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6350. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6351. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6352. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6353. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6354. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6355. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6356. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6357. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6358. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6359. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6360. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6361. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6362. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6363. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6364. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6365. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6366. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6367. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6368. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6369. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6370. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6371. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6372. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6373. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6374. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6375. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6376. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6377. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6378. do { \
  6379. HTT_CHECK_SET_VAL(httsym, enable); \
  6380. (word) |= (enable) << httsym##_S; \
  6381. } while (0)
  6382. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6383. (((word) & httsym##_M) >> httsym##_S)
  6384. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6385. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6386. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6387. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6388. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6389. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6390. /**
  6391. * @brief host --> target Receive Flow Steering configuration message definition
  6392. *
  6393. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6394. *
  6395. * host --> target Receive Flow Steering configuration message definition.
  6396. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6397. * The reason for this is we want RFS to be configured and ready before MAC
  6398. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6399. *
  6400. * |31 24|23 16|15 9|8|7 0|
  6401. * |----------------+----------------+----------------+----------------|
  6402. * | reserved |E| msg type |
  6403. * |-------------------------------------------------------------------|
  6404. * Where E = RFS enable flag
  6405. *
  6406. * The RFS_CONFIG message consists of a single 4-byte word.
  6407. *
  6408. * Header fields:
  6409. * - MSG_TYPE
  6410. * Bits 7:0
  6411. * Purpose: identifies this as a RFS config msg
  6412. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6413. * - RFS_CONFIG
  6414. * Bit 8
  6415. * Purpose: Tells target whether to enable (1) or disable (0)
  6416. * flow steering feature when sending rx indication messages to host
  6417. */
  6418. #define HTT_H2T_RFS_CONFIG_M 0x100
  6419. #define HTT_H2T_RFS_CONFIG_S 8
  6420. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6421. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6422. HTT_H2T_RFS_CONFIG_S)
  6423. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6424. do { \
  6425. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6426. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6427. } while (0)
  6428. #define HTT_RFS_CFG_REQ_BYTES 4
  6429. /**
  6430. * @brief host -> target FW extended statistics retrieve
  6431. *
  6432. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6433. *
  6434. * @details
  6435. * The following field definitions describe the format of the HTT host
  6436. * to target FW extended stats retrieve message.
  6437. * The message specifies the type of stats the host wants to retrieve.
  6438. *
  6439. * |31 24|23 16|15 8|7 0|
  6440. * |-----------------------------------------------------------|
  6441. * | reserved | stats type | pdev_mask | msg type |
  6442. * |-----------------------------------------------------------|
  6443. * | config param [0] |
  6444. * |-----------------------------------------------------------|
  6445. * | config param [1] |
  6446. * |-----------------------------------------------------------|
  6447. * | config param [2] |
  6448. * |-----------------------------------------------------------|
  6449. * | config param [3] |
  6450. * |-----------------------------------------------------------|
  6451. * | reserved |
  6452. * |-----------------------------------------------------------|
  6453. * | cookie LSBs |
  6454. * |-----------------------------------------------------------|
  6455. * | cookie MSBs |
  6456. * |-----------------------------------------------------------|
  6457. * Header fields:
  6458. * - MSG_TYPE
  6459. * Bits 7:0
  6460. * Purpose: identifies this is a extended stats upload request message
  6461. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6462. * - PDEV_MASK
  6463. * Bits 8:15
  6464. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6465. * Value: This is a overloaded field, refer to usage and interpretation of
  6466. * PDEV in interface document.
  6467. * Bit 8 : Reserved for SOC stats
  6468. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6469. * Indicates MACID_MASK in DBS
  6470. * - STATS_TYPE
  6471. * Bits 23:16
  6472. * Purpose: identifies which FW statistics to upload
  6473. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6474. * - Reserved
  6475. * Bits 31:24
  6476. * - CONFIG_PARAM [0]
  6477. * Bits 31:0
  6478. * Purpose: give an opaque configuration value to the specified stats type
  6479. * Value: stats-type specific configuration value
  6480. * Refer to htt_stats.h for interpretation for each stats sub_type
  6481. * - CONFIG_PARAM [1]
  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 [2]
  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 [3]
  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. * - Reserved [31:0] for future use.
  6497. * - COOKIE_LSBS
  6498. * Bits 31:0
  6499. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6500. * message with its preceding host->target stats request message.
  6501. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6502. * - COOKIE_MSBS
  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: MSBs of the opaque cookie specified by the host-side requestor
  6507. */
  6508. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6509. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6510. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6511. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6512. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6513. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6514. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6515. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6516. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6517. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6518. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6519. do { \
  6520. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6521. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6522. } while (0)
  6523. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6524. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6525. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6526. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6529. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6530. } while (0)
  6531. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6532. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6533. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6534. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6535. do { \
  6536. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6537. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6538. } while (0)
  6539. /**
  6540. * @brief host -> target FW PPDU_STATS request message
  6541. *
  6542. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6543. *
  6544. * @details
  6545. * The following field definitions describe the format of the HTT host
  6546. * to target FW for PPDU_STATS_CFG msg.
  6547. * The message allows the host to configure the PPDU_STATS_IND messages
  6548. * produced by the target.
  6549. *
  6550. * |31 24|23 16|15 8|7 0|
  6551. * |-----------------------------------------------------------|
  6552. * | REQ bit mask | pdev_mask | msg type |
  6553. * |-----------------------------------------------------------|
  6554. * Header fields:
  6555. * - MSG_TYPE
  6556. * Bits 7:0
  6557. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6558. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6559. * - PDEV_MASK
  6560. * Bits 8:15
  6561. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6562. * Value: This is a overloaded field, refer to usage and interpretation of
  6563. * PDEV in interface document.
  6564. * Bit 8 : Reserved for SOC stats
  6565. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6566. * Indicates MACID_MASK in DBS
  6567. * - REQ_TLV_BIT_MASK
  6568. * Bits 16:31
  6569. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6570. * needs to be included in the target's PPDU_STATS_IND messages.
  6571. * Value: refer htt_ppdu_stats_tlv_tag_t
  6572. *
  6573. */
  6574. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6575. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6576. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6577. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6578. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6579. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6580. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6581. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6582. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6583. do { \
  6584. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6585. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6586. } while (0)
  6587. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6588. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6589. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6590. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6593. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6594. } while (0)
  6595. /**
  6596. * @brief Host-->target HTT RX FSE setup message
  6597. *
  6598. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6599. *
  6600. * @details
  6601. * Through this message, the host will provide details of the flow tables
  6602. * in host DDR along with hash keys.
  6603. * This message can be sent per SOC or per PDEV, which is differentiated
  6604. * by pdev id values.
  6605. * The host will allocate flow search table and sends table size,
  6606. * physical DMA address of flow table, and hash keys to firmware to
  6607. * program into the RXOLE FSE HW block.
  6608. *
  6609. * The following field definitions describe the format of the RX FSE setup
  6610. * message sent from the host to target
  6611. *
  6612. * Header fields:
  6613. * dword0 - b'7:0 - msg_type: This will be set to
  6614. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6615. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6616. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6617. * pdev's LMAC ring.
  6618. * b'31:16 - reserved : Reserved for future use
  6619. * dword1 - b'19:0 - number of records: This field indicates the number of
  6620. * entries in the flow table. For example: 8k number of
  6621. * records is equivalent to
  6622. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6623. * b'27:20 - max search: This field specifies the skid length to FSE
  6624. * parser HW module whenever match is not found at the
  6625. * exact index pointed by hash.
  6626. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6627. * Refer htt_ip_da_sa_prefix below for more details.
  6628. * b'31:30 - reserved: Reserved for future use
  6629. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6630. * table allocated by host in DDR
  6631. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6632. * table allocated by host in DDR
  6633. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6634. * entry hashing
  6635. *
  6636. *
  6637. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6638. * |---------------------------------------------------------------|
  6639. * | reserved | pdev_id | MSG_TYPE |
  6640. * |---------------------------------------------------------------|
  6641. * |resvd|IPDSA| max_search | Number of records |
  6642. * |---------------------------------------------------------------|
  6643. * | base address lo |
  6644. * |---------------------------------------------------------------|
  6645. * | base address high |
  6646. * |---------------------------------------------------------------|
  6647. * | toeplitz key 31_0 |
  6648. * |---------------------------------------------------------------|
  6649. * | toeplitz key 63_32 |
  6650. * |---------------------------------------------------------------|
  6651. * | toeplitz key 95_64 |
  6652. * |---------------------------------------------------------------|
  6653. * | toeplitz key 127_96 |
  6654. * |---------------------------------------------------------------|
  6655. * | toeplitz key 159_128 |
  6656. * |---------------------------------------------------------------|
  6657. * | toeplitz key 191_160 |
  6658. * |---------------------------------------------------------------|
  6659. * | toeplitz key 223_192 |
  6660. * |---------------------------------------------------------------|
  6661. * | toeplitz key 255_224 |
  6662. * |---------------------------------------------------------------|
  6663. * | toeplitz key 287_256 |
  6664. * |---------------------------------------------------------------|
  6665. * | reserved | toeplitz key 314_288(26:0 bits) |
  6666. * |---------------------------------------------------------------|
  6667. * where:
  6668. * IPDSA = ip_da_sa
  6669. */
  6670. /**
  6671. * @brief: htt_ip_da_sa_prefix
  6672. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6673. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6674. * documentation per RFC3849
  6675. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6676. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6677. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6678. */
  6679. enum htt_ip_da_sa_prefix {
  6680. HTT_RX_IPV6_20010db8,
  6681. HTT_RX_IPV4_MAPPED_IPV6,
  6682. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6683. HTT_RX_IPV6_64FF9B,
  6684. };
  6685. /**
  6686. * @brief Host-->target HTT RX FISA configure and enable
  6687. *
  6688. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6689. *
  6690. * @details
  6691. * The host will send this command down to configure and enable the FISA
  6692. * operational params.
  6693. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6694. * register.
  6695. * Should configure both the MACs.
  6696. *
  6697. * dword0 - b'7:0 - msg_type:
  6698. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6699. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6700. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6701. * pdev's LMAC ring.
  6702. * b'31:16 - reserved : Reserved for future use
  6703. *
  6704. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6705. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6706. * packets. 1 flow search will be skipped
  6707. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6708. * tcp,udp packets
  6709. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6710. * calculation
  6711. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6712. * calculation
  6713. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6714. * calculation
  6715. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6716. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6717. * length
  6718. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6719. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6720. * length
  6721. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6722. * num jump
  6723. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6724. * num jump
  6725. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6726. * data type switch has happend for MPDU Sequence num jump
  6727. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6728. * for MPDU Sequence num jump
  6729. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6730. * for decrypt errors
  6731. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6732. * while aggregating a msdu
  6733. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6734. * The aggregation is done until (number of MSDUs aggregated
  6735. * < LIMIT + 1)
  6736. * b'31:18 - Reserved
  6737. *
  6738. * fisa_control_value - 32bit value FW can write to register
  6739. *
  6740. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6741. * Threshold value for FISA timeout (units are microseconds).
  6742. * When the global timestamp exceeds this threshold, FISA
  6743. * aggregation will be restarted.
  6744. * A value of 0 means timeout is disabled.
  6745. * Compare the threshold register with timestamp field in
  6746. * flow entry to generate timeout for the flow.
  6747. *
  6748. * |31 18 |17 16|15 8|7 0|
  6749. * |-------------------------------------------------------------|
  6750. * | reserved | pdev_mask | msg type |
  6751. * |-------------------------------------------------------------|
  6752. * | reserved | FISA_CTRL |
  6753. * |-------------------------------------------------------------|
  6754. * | FISA_TIMEOUT_THRESH |
  6755. * |-------------------------------------------------------------|
  6756. */
  6757. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6758. A_UINT32 msg_type:8,
  6759. pdev_id:8,
  6760. reserved0:16;
  6761. /**
  6762. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6763. * [17:0]
  6764. */
  6765. union {
  6766. /*
  6767. * fisa_control_bits structure is deprecated.
  6768. * Please use fisa_control_bits_v2 going forward.
  6769. */
  6770. struct {
  6771. A_UINT32 fisa_enable: 1,
  6772. ipsec_skip_search: 1,
  6773. nontcp_skip_search: 1,
  6774. add_ipv4_fixed_hdr_len: 1,
  6775. add_ipv6_fixed_hdr_len: 1,
  6776. add_tcp_fixed_hdr_len: 1,
  6777. add_udp_hdr_len: 1,
  6778. chksum_cum_ip_len_en: 1,
  6779. disable_tid_check: 1,
  6780. disable_ta_check: 1,
  6781. disable_qos_check: 1,
  6782. disable_raw_check: 1,
  6783. disable_decrypt_err_check: 1,
  6784. disable_msdu_drop_check: 1,
  6785. fisa_aggr_limit: 4,
  6786. reserved: 14;
  6787. } fisa_control_bits;
  6788. struct {
  6789. A_UINT32 fisa_enable: 1,
  6790. fisa_aggr_limit: 4,
  6791. reserved: 27;
  6792. } fisa_control_bits_v2;
  6793. A_UINT32 fisa_control_value;
  6794. } u_fisa_control;
  6795. /**
  6796. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6797. * timeout threshold for aggregation. Unit in usec.
  6798. * [31:0]
  6799. */
  6800. A_UINT32 fisa_timeout_threshold;
  6801. } POSTPACK;
  6802. /* DWord 0: pdev-ID */
  6803. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6804. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6805. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6806. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6807. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6808. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6809. do { \
  6810. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6811. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6812. } while (0)
  6813. /* Dword 1: fisa_control_value fisa config */
  6814. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6815. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6816. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6817. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6818. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6819. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6820. do { \
  6821. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6822. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6823. } while (0)
  6824. /* Dword 1: fisa_control_value ipsec_skip_search */
  6825. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6826. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6827. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6828. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6829. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6830. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6831. do { \
  6832. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6833. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6834. } while (0)
  6835. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6836. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6837. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6838. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6839. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6840. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6841. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6842. do { \
  6843. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6844. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6845. } while (0)
  6846. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6847. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6848. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6849. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6850. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6851. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6852. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6853. do { \
  6854. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6855. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6856. } while (0)
  6857. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6858. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6859. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6860. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6861. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6862. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6863. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6864. do { \
  6865. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6866. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6867. } while (0)
  6868. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6869. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6870. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6871. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6872. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6873. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6874. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6875. do { \
  6876. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6877. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6878. } while (0)
  6879. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6880. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6881. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6882. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6883. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6884. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6885. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6886. do { \
  6887. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6888. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6889. } while (0)
  6890. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6891. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6892. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6893. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6894. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6895. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6896. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6897. do { \
  6898. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6899. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6900. } while (0)
  6901. /* Dword 1: fisa_control_value disable_tid_check */
  6902. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6903. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6904. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6905. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6906. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6907. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6908. do { \
  6909. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6910. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6911. } while (0)
  6912. /* Dword 1: fisa_control_value disable_ta_check */
  6913. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6914. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6915. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6916. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6917. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6918. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6919. do { \
  6920. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6921. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6922. } while (0)
  6923. /* Dword 1: fisa_control_value disable_qos_check */
  6924. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6925. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6926. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6927. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6928. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6929. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6930. do { \
  6931. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6932. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6933. } while (0)
  6934. /* Dword 1: fisa_control_value disable_raw_check */
  6935. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6936. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6937. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6938. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6939. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6940. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6941. do { \
  6942. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6943. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6944. } while (0)
  6945. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6946. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6947. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6948. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6949. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6950. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6951. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6952. do { \
  6953. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6954. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6955. } while (0)
  6956. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6957. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6958. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6959. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6960. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6961. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6962. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6963. do { \
  6964. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6965. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6966. } while (0)
  6967. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6968. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6969. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6970. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6971. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6972. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6973. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6974. do { \
  6975. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6976. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6977. } while (0)
  6978. /* Dword 1: fisa_control_value fisa config */
  6979. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6980. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6981. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6982. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6983. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6984. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6985. do { \
  6986. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6987. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6988. } while (0)
  6989. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6990. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6991. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6992. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6993. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6994. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6995. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6996. do { \
  6997. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6998. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6999. } while (0)
  7000. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7001. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7002. pdev_id:8,
  7003. reserved0:16;
  7004. A_UINT32 num_records:20,
  7005. max_search:8,
  7006. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7007. reserved1:2;
  7008. A_UINT32 base_addr_lo;
  7009. A_UINT32 base_addr_hi;
  7010. A_UINT32 toeplitz31_0;
  7011. A_UINT32 toeplitz63_32;
  7012. A_UINT32 toeplitz95_64;
  7013. A_UINT32 toeplitz127_96;
  7014. A_UINT32 toeplitz159_128;
  7015. A_UINT32 toeplitz191_160;
  7016. A_UINT32 toeplitz223_192;
  7017. A_UINT32 toeplitz255_224;
  7018. A_UINT32 toeplitz287_256;
  7019. A_UINT32 toeplitz314_288:27,
  7020. reserved2:5;
  7021. } POSTPACK;
  7022. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7023. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7024. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7025. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7026. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7027. /* DWORD 0: Pdev ID */
  7028. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7029. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7030. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7031. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7032. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7033. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7036. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7037. } while (0)
  7038. /* DWORD 1:num of records */
  7039. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7040. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7041. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7042. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7043. HTT_RX_FSE_SETUP_NUM_REC_S)
  7044. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7045. do { \
  7046. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7047. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7048. } while (0)
  7049. /* DWORD 1:max_search */
  7050. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7051. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7052. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7053. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7054. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7055. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7056. do { \
  7057. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7058. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7059. } while (0)
  7060. /* DWORD 1:ip_da_sa prefix */
  7061. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7062. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7063. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7064. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7065. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7066. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7067. do { \
  7068. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7069. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7070. } while (0)
  7071. /* DWORD 2: Base Address LO */
  7072. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7073. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7074. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7075. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7076. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7077. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7078. do { \
  7079. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7080. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7081. } while (0)
  7082. /* DWORD 3: Base Address High */
  7083. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7084. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7085. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7086. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7087. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7088. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7091. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7092. } while (0)
  7093. /* DWORD 4-12: Hash Value */
  7094. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7095. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7096. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7097. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7098. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7099. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7100. do { \
  7101. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7102. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7103. } while (0)
  7104. /* DWORD 13: Hash Value 314:288 bits */
  7105. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7106. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7107. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7108. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7109. do { \
  7110. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7111. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7112. } while (0)
  7113. /**
  7114. * @brief Host-->target HTT RX FSE operation message
  7115. *
  7116. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7117. *
  7118. * @details
  7119. * The host will send this Flow Search Engine (FSE) operation message for
  7120. * every flow add/delete operation.
  7121. * The FSE operation includes FSE full cache invalidation or individual entry
  7122. * invalidation.
  7123. * This message can be sent per SOC or per PDEV which is differentiated
  7124. * by pdev id values.
  7125. *
  7126. * |31 16|15 8|7 1|0|
  7127. * |-------------------------------------------------------------|
  7128. * | reserved | pdev_id | MSG_TYPE |
  7129. * |-------------------------------------------------------------|
  7130. * | reserved | operation |I|
  7131. * |-------------------------------------------------------------|
  7132. * | ip_src_addr_31_0 |
  7133. * |-------------------------------------------------------------|
  7134. * | ip_src_addr_63_32 |
  7135. * |-------------------------------------------------------------|
  7136. * | ip_src_addr_95_64 |
  7137. * |-------------------------------------------------------------|
  7138. * | ip_src_addr_127_96 |
  7139. * |-------------------------------------------------------------|
  7140. * | ip_dst_addr_31_0 |
  7141. * |-------------------------------------------------------------|
  7142. * | ip_dst_addr_63_32 |
  7143. * |-------------------------------------------------------------|
  7144. * | ip_dst_addr_95_64 |
  7145. * |-------------------------------------------------------------|
  7146. * | ip_dst_addr_127_96 |
  7147. * |-------------------------------------------------------------|
  7148. * | l4_dst_port | l4_src_port |
  7149. * | (32-bit SPI incase of IPsec) |
  7150. * |-------------------------------------------------------------|
  7151. * | reserved | l4_proto |
  7152. * |-------------------------------------------------------------|
  7153. *
  7154. * where I is 1-bit ipsec_valid.
  7155. *
  7156. * The following field definitions describe the format of the RX FSE operation
  7157. * message sent from the host to target for every add/delete flow entry to flow
  7158. * table.
  7159. *
  7160. * Header fields:
  7161. * dword0 - b'7:0 - msg_type: This will be set to
  7162. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7163. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7164. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7165. * specified pdev's LMAC ring.
  7166. * b'31:16 - reserved : Reserved for future use
  7167. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7168. * (Internet Protocol Security).
  7169. * IPsec describes the framework for providing security at
  7170. * IP layer. IPsec is defined for both versions of IP:
  7171. * IPV4 and IPV6.
  7172. * Please refer to htt_rx_flow_proto enumeration below for
  7173. * more info.
  7174. * ipsec_valid = 1 for IPSEC packets
  7175. * ipsec_valid = 0 for IP Packets
  7176. * b'7:1 - operation: This indicates types of FSE operation.
  7177. * Refer to htt_rx_fse_operation enumeration:
  7178. * 0 - No Cache Invalidation required
  7179. * 1 - Cache invalidate only one entry given by IP
  7180. * src/dest address at DWORD[2:9]
  7181. * 2 - Complete FSE Cache Invalidation
  7182. * 3 - FSE Disable
  7183. * 4 - FSE Enable
  7184. * b'31:8 - reserved: Reserved for future use
  7185. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7186. * for per flow addition/deletion
  7187. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7188. * and the subsequent 3 A_UINT32 will be padding bytes.
  7189. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7190. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7191. * from 0 to 65535 but only 0 to 1023 are designated as
  7192. * well-known ports. Refer to [RFC1700] for more details.
  7193. * This field is valid only if
  7194. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7195. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7196. * range from 0 to 65535 but only 0 to 1023 are designated
  7197. * as 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. * - SPI (31:0): Security Parameters Index is an
  7201. * identification tag added to the header while using IPsec
  7202. * for tunneling the IP traffici.
  7203. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7204. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7205. * Assigned Internet Protocol Numbers.
  7206. * l4_proto numbers for standard protocol like UDP/TCP
  7207. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7208. * l4_proto = 17 for UDP etc.
  7209. * b'31:8 - reserved: Reserved for future use.
  7210. *
  7211. */
  7212. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7213. A_UINT32 msg_type:8,
  7214. pdev_id:8,
  7215. reserved0:16;
  7216. A_UINT32 ipsec_valid:1,
  7217. operation:7,
  7218. reserved1:24;
  7219. A_UINT32 ip_src_addr_31_0;
  7220. A_UINT32 ip_src_addr_63_32;
  7221. A_UINT32 ip_src_addr_95_64;
  7222. A_UINT32 ip_src_addr_127_96;
  7223. A_UINT32 ip_dest_addr_31_0;
  7224. A_UINT32 ip_dest_addr_63_32;
  7225. A_UINT32 ip_dest_addr_95_64;
  7226. A_UINT32 ip_dest_addr_127_96;
  7227. union {
  7228. A_UINT32 spi;
  7229. struct {
  7230. A_UINT32 l4_src_port:16,
  7231. l4_dest_port:16;
  7232. } ip;
  7233. } u;
  7234. A_UINT32 l4_proto:8,
  7235. reserved:24;
  7236. } POSTPACK;
  7237. /**
  7238. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7239. *
  7240. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7241. *
  7242. * @details
  7243. * The host will send this Full monitor mode register configuration message.
  7244. * This message can be sent per SOC or per PDEV which is differentiated
  7245. * by pdev id values.
  7246. *
  7247. * |31 16|15 11|10 8|7 3|2|1|0|
  7248. * |-------------------------------------------------------------|
  7249. * | reserved | pdev_id | MSG_TYPE |
  7250. * |-------------------------------------------------------------|
  7251. * | reserved |Release Ring |N|Z|E|
  7252. * |-------------------------------------------------------------|
  7253. *
  7254. * where E is 1-bit full monitor mode enable/disable.
  7255. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7256. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7257. *
  7258. * The following field definitions describe the format of the full monitor
  7259. * mode configuration message sent from the host to target for each pdev.
  7260. *
  7261. * Header fields:
  7262. * dword0 - b'7:0 - msg_type: This will be set to
  7263. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7264. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7265. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7266. * specified pdev's LMAC ring.
  7267. * b'31:16 - reserved : Reserved for future use.
  7268. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7269. * monitor mode rxdma register is to be enabled or disabled.
  7270. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7271. * additional descriptors at ppdu end for zero mpdus
  7272. * enabled or disabled.
  7273. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7274. * additional descriptors at ppdu end for non zero mpdus
  7275. * enabled or disabled.
  7276. * b'10:3 - release_ring: This indicates the destination ring
  7277. * selection for the descriptor at the end of PPDU
  7278. * 0 - REO ring select
  7279. * 1 - FW ring select
  7280. * 2 - SW ring select
  7281. * 3 - Release ring select
  7282. * Refer to htt_rx_full_mon_release_ring.
  7283. * b'31:11 - reserved for future use
  7284. */
  7285. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7286. A_UINT32 msg_type:8,
  7287. pdev_id:8,
  7288. reserved0:16;
  7289. A_UINT32 full_monitor_mode_enable:1,
  7290. addnl_descs_zero_mpdus_end:1,
  7291. addnl_descs_non_zero_mpdus_end:1,
  7292. release_ring:8,
  7293. reserved1:21;
  7294. } POSTPACK;
  7295. /**
  7296. * Enumeration for full monitor mode destination ring select
  7297. * 0 - REO destination ring select
  7298. * 1 - FW destination ring select
  7299. * 2 - SW destination ring select
  7300. * 3 - Release destination ring select
  7301. */
  7302. enum htt_rx_full_mon_release_ring {
  7303. HTT_RX_MON_RING_REO,
  7304. HTT_RX_MON_RING_FW,
  7305. HTT_RX_MON_RING_SW,
  7306. HTT_RX_MON_RING_RELEASE,
  7307. };
  7308. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7309. /* DWORD 0: Pdev ID */
  7310. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7311. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7312. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7313. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7314. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7315. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7316. do { \
  7317. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7318. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7319. } while (0)
  7320. /* DWORD 1:ENABLE */
  7321. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7322. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7323. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7324. do { \
  7325. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7326. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7327. } while (0)
  7328. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7329. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7330. /* DWORD 1:ZERO_MPDU */
  7331. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7332. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7333. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7334. do { \
  7335. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7336. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7337. } while (0)
  7338. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7339. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7340. /* DWORD 1:NON_ZERO_MPDU */
  7341. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7342. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7343. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7344. do { \
  7345. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7346. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7347. } while (0)
  7348. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7349. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7350. /* DWORD 1:RELEASE_RINGS */
  7351. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7352. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7353. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7354. do { \
  7355. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7356. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7357. } while (0)
  7358. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7359. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7360. /**
  7361. * Enumeration for IP Protocol or IPSEC Protocol
  7362. * IPsec describes the framework for providing security at IP layer.
  7363. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7364. */
  7365. enum htt_rx_flow_proto {
  7366. HTT_RX_FLOW_IP_PROTO,
  7367. HTT_RX_FLOW_IPSEC_PROTO,
  7368. };
  7369. /**
  7370. * Enumeration for FSE Cache Invalidation
  7371. * 0 - No Cache Invalidation required
  7372. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7373. * 2 - Complete FSE Cache Invalidation
  7374. * 3 - FSE Disable
  7375. * 4 - FSE Enable
  7376. */
  7377. enum htt_rx_fse_operation {
  7378. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7379. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7380. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7381. HTT_RX_FSE_DISABLE,
  7382. HTT_RX_FSE_ENABLE,
  7383. };
  7384. /* DWORD 0: Pdev ID */
  7385. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7386. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7387. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7388. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7389. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7390. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7391. do { \
  7392. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7393. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7394. } while (0)
  7395. /* DWORD 1:IP PROTO or IPSEC */
  7396. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7397. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7398. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7399. do { \
  7400. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7401. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7402. } while (0)
  7403. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7404. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7405. /* DWORD 1:FSE Operation */
  7406. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7407. #define HTT_RX_FSE_OPERATION_S 1
  7408. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7409. do { \
  7410. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7411. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7412. } while (0)
  7413. #define HTT_RX_FSE_OPERATION_GET(word) \
  7414. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7415. /* DWORD 2-9:IP Address */
  7416. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7417. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7418. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7419. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7420. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7421. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7422. do { \
  7423. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7424. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7425. } while (0)
  7426. /* DWORD 10:Source Port Number */
  7427. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7428. #define HTT_RX_FSE_SOURCEPORT_S 0
  7429. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7430. do { \
  7431. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7432. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7433. } while (0)
  7434. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7435. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7436. /* DWORD 11:Destination Port Number */
  7437. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7438. #define HTT_RX_FSE_DESTPORT_S 16
  7439. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7440. do { \
  7441. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7442. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7443. } while (0)
  7444. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7445. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7446. /* DWORD 10-11:SPI (In case of IPSEC) */
  7447. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7448. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7449. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7450. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7451. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7452. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7453. do { \
  7454. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7455. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7456. } while (0)
  7457. /* DWORD 12:L4 PROTO */
  7458. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7459. #define HTT_RX_FSE_L4_PROTO_S 0
  7460. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7461. do { \
  7462. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7463. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7464. } while (0)
  7465. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7466. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7467. /**
  7468. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7469. *
  7470. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7471. *
  7472. * |31 24|23 |15 8|7 2|1|0|
  7473. * |----------------+----------------+----------------+----------------|
  7474. * | reserved | pdev_id | msg_type |
  7475. * |---------------------------------+----------------+----------------|
  7476. * | reserved |E|F|
  7477. * |---------------------------------+----------------+----------------|
  7478. * Where E = Configure the target to provide the 3-tuple hash value in
  7479. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7480. * F = Configure the target to provide the 3-tuple hash value in
  7481. * flow_id_toeplitz field of rx_msdu_start tlv
  7482. *
  7483. * The following field definitions describe the format of the 3 tuple hash value
  7484. * message sent from the host to target as part of initialization sequence.
  7485. *
  7486. * Header fields:
  7487. * dword0 - b'7:0 - msg_type: This will be set to
  7488. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7489. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7490. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7491. * specified pdev's LMAC ring.
  7492. * b'31:16 - reserved : Reserved for future use
  7493. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7494. * b'1 - toeplitz_hash_2_or_4_field_enable
  7495. * b'31:2 - reserved : Reserved for future use
  7496. * ---------+------+----------------------------------------------------------
  7497. * bit1 | bit0 | Functionality
  7498. * ---------+------+----------------------------------------------------------
  7499. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7500. * | | in flow_id_toeplitz field
  7501. * ---------+------+----------------------------------------------------------
  7502. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7503. * | | in toeplitz_hash_2_or_4 field
  7504. * ---------+------+----------------------------------------------------------
  7505. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7506. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7507. * ---------+------+----------------------------------------------------------
  7508. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7509. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7510. * | | toeplitz_hash_2_or_4 field
  7511. *----------------------------------------------------------------------------
  7512. */
  7513. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7514. A_UINT32 msg_type :8,
  7515. pdev_id :8,
  7516. reserved0 :16;
  7517. A_UINT32 flow_id_toeplitz_field_enable :1,
  7518. toeplitz_hash_2_or_4_field_enable :1,
  7519. reserved1 :30;
  7520. } POSTPACK;
  7521. /* DWORD0 : pdev_id configuration Macros */
  7522. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7523. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7524. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7525. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7526. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7527. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7528. do { \
  7529. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7530. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7531. } while (0)
  7532. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7533. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7534. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7535. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7536. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7537. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7538. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7539. do { \
  7540. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7541. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7542. } while (0)
  7543. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7544. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7545. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7546. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7547. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7548. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7549. do { \
  7550. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7551. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7552. } while (0)
  7553. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7554. /**
  7555. * @brief host --> target Host PA Address Size
  7556. *
  7557. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7558. *
  7559. * @details
  7560. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7561. * provide the physical start address and size of each of the memory
  7562. * areas within host DDR that the target FW may need to access.
  7563. *
  7564. * For example, the host can use this message to allow the target FW
  7565. * to set up access to the host's pools of TQM link descriptors.
  7566. * The message would appear as follows:
  7567. *
  7568. * |31 24|23 16|15 8|7 0|
  7569. * |----------------+----------------+----------------+----------------|
  7570. * | reserved | num_entries | msg_type |
  7571. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7572. * | mem area 0 size |
  7573. * |----------------+----------------+----------------+----------------|
  7574. * | mem area 0 physical_address_lo |
  7575. * |----------------+----------------+----------------+----------------|
  7576. * | mem area 0 physical_address_hi |
  7577. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7578. * | mem area 1 size |
  7579. * |----------------+----------------+----------------+----------------|
  7580. * | mem area 1 physical_address_lo |
  7581. * |----------------+----------------+----------------+----------------|
  7582. * | mem area 1 physical_address_hi |
  7583. * |----------------+----------------+----------------+----------------|
  7584. * ...
  7585. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7586. * | mem area N size |
  7587. * |----------------+----------------+----------------+----------------|
  7588. * | mem area N physical_address_lo |
  7589. * |----------------+----------------+----------------+----------------|
  7590. * | mem area N physical_address_hi |
  7591. * |----------------+----------------+----------------+----------------|
  7592. *
  7593. * The message is interpreted as follows:
  7594. * dword0 - b'0:7 - msg_type: This will be set to
  7595. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7596. * b'8:15 - number_entries: Indicated the number of host memory
  7597. * areas specified within the remainder of the message
  7598. * b'16:31 - reserved.
  7599. * dword1 - b'0:31 - memory area 0 size in bytes
  7600. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7601. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7602. * and similar for memory area 1 through memory area N.
  7603. */
  7604. PREPACK struct htt_h2t_host_paddr_size {
  7605. A_UINT32 msg_type: 8,
  7606. num_entries: 8,
  7607. reserved: 16;
  7608. } POSTPACK;
  7609. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7610. A_UINT32 size;
  7611. A_UINT32 physical_address_lo;
  7612. A_UINT32 physical_address_hi;
  7613. } POSTPACK;
  7614. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7615. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7616. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7617. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7618. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7619. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7620. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7621. do { \
  7622. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7623. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7624. } while (0)
  7625. /**
  7626. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7627. *
  7628. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7629. *
  7630. * @details
  7631. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7632. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7633. *
  7634. * The message would appear as follows:
  7635. *
  7636. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7637. * |---------------------------------+---+---+----------+-+-----------|
  7638. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7639. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7640. *
  7641. *
  7642. * The message is interpreted as follows:
  7643. * dword0 - b'0:7 - msg_type: This will be set to
  7644. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7645. * b'8 - override bit to drive MSDUs to PPE ring
  7646. * b'9:13 - REO destination ring indication
  7647. * b'14 - Multi buffer msdu override enable bit
  7648. * b'15 - Intra BSS override
  7649. * b'16 - Decap raw override
  7650. * b'17 - Decap Native wifi override
  7651. * b'18 - IP frag override
  7652. * b'19:31 - reserved
  7653. */
  7654. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7655. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7656. override: 1,
  7657. reo_destination_indication: 5,
  7658. multi_buffer_msdu_override_en: 1,
  7659. intra_bss_override: 1,
  7660. decap_raw_override: 1,
  7661. decap_nwifi_override: 1,
  7662. ip_frag_override: 1,
  7663. reserved: 13;
  7664. } POSTPACK;
  7665. /* DWORD 0: Override */
  7666. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7667. #define HTT_PPE_CFG_OVERRIDE_S 8
  7668. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7669. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7670. HTT_PPE_CFG_OVERRIDE_S)
  7671. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7672. do { \
  7673. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7674. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7675. } while (0)
  7676. /* DWORD 0: REO Destination Indication*/
  7677. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7678. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7679. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7680. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7681. HTT_PPE_CFG_REO_DEST_IND_S)
  7682. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7683. do { \
  7684. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7685. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7686. } while (0)
  7687. /* DWORD 0: Multi buffer MSDU override */
  7688. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7689. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7690. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7691. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7692. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7693. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7694. do { \
  7695. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7696. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7697. } while (0)
  7698. /* DWORD 0: Intra BSS override */
  7699. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7700. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7701. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7702. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7703. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7704. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7705. do { \
  7706. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7707. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7708. } while (0)
  7709. /* DWORD 0: Decap RAW override */
  7710. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7711. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7712. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7713. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7714. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7715. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7718. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7719. } while (0)
  7720. /* DWORD 0: Decap NWIFI override */
  7721. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7722. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7723. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7724. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7725. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7726. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7727. do { \
  7728. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7729. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7730. } while (0)
  7731. /* DWORD 0: IP frag override */
  7732. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7733. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7734. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7735. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7736. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7737. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7738. do { \
  7739. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7740. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7741. } while (0)
  7742. /*
  7743. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7744. *
  7745. * @details
  7746. * The following field definitions describe the format of the HTT host
  7747. * to target FW VDEV TX RX stats retrieve message.
  7748. * The message specifies the type of stats the host wants to retrieve.
  7749. *
  7750. * |31 27|26 25|24 17|16|15 8|7 0|
  7751. * |-----------------------------------------------------------|
  7752. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7753. * |-----------------------------------------------------------|
  7754. * | vdev_id lower bitmask |
  7755. * |-----------------------------------------------------------|
  7756. * | vdev_id upper bitmask |
  7757. * |-----------------------------------------------------------|
  7758. * Header fields:
  7759. * Where:
  7760. * dword0 - b'7:0 - msg_type: This will be set to
  7761. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7762. * b'15:8 - pdev id
  7763. * b'16(E) - Enable/Disable the vdev HW stats
  7764. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7765. * b'25:26(R) - Reset stats bits
  7766. * 0: don't reset stats
  7767. * 1: reset stats once
  7768. * 2: reset stats at the start of each periodic interval
  7769. * b'27:31 - reserved for future use
  7770. * dword1 - b'0:31 - vdev_id lower bitmask
  7771. * dword2 - b'0:31 - vdev_id upper bitmask
  7772. */
  7773. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7774. A_UINT32 msg_type :8,
  7775. pdev_id :8,
  7776. enable :1,
  7777. periodic_interval :8,
  7778. reset_stats_bits :2,
  7779. reserved0 :5;
  7780. A_UINT32 vdev_id_lower_bitmask;
  7781. A_UINT32 vdev_id_upper_bitmask;
  7782. } POSTPACK;
  7783. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7784. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7785. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7786. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7787. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7788. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7789. do { \
  7790. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7791. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7792. } while (0)
  7793. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7794. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7795. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7796. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7797. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7798. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7799. do { \
  7800. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7801. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7802. } while (0)
  7803. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7804. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7805. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7806. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7807. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7808. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7809. do { \
  7810. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7811. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7812. } while (0)
  7813. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7814. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7815. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7816. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7817. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7818. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7819. do { \
  7820. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7821. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7822. } while (0)
  7823. /*=== target -> host messages ===============================================*/
  7824. enum htt_t2h_msg_type {
  7825. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7826. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7827. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7828. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7829. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7830. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7831. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7832. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7833. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7834. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7835. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7836. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7837. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7838. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7839. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7840. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7841. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7842. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7843. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7844. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7845. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7846. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7847. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7848. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7849. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7850. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7851. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7852. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7853. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7854. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7855. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7856. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7857. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7858. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7859. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7860. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7861. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7862. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7863. /* TX_OFFLOAD_DELIVER_IND:
  7864. * Forward the target's locally-generated packets to the host,
  7865. * to provide to the monitor mode interface.
  7866. */
  7867. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7868. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7869. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7870. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7871. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7872. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7873. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7874. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7875. HTT_T2H_MSG_TYPE_TEST,
  7876. /* keep this last */
  7877. HTT_T2H_NUM_MSGS
  7878. };
  7879. /*
  7880. * HTT target to host message type -
  7881. * stored in bits 7:0 of the first word of the message
  7882. */
  7883. #define HTT_T2H_MSG_TYPE_M 0xff
  7884. #define HTT_T2H_MSG_TYPE_S 0
  7885. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7886. do { \
  7887. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7888. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7889. } while (0)
  7890. #define HTT_T2H_MSG_TYPE_GET(word) \
  7891. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7892. /**
  7893. * @brief target -> host version number confirmation message definition
  7894. *
  7895. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7896. *
  7897. * |31 24|23 16|15 8|7 0|
  7898. * |----------------+----------------+----------------+----------------|
  7899. * | reserved | major number | minor number | msg type |
  7900. * |-------------------------------------------------------------------|
  7901. * : option request TLV (optional) |
  7902. * :...................................................................:
  7903. *
  7904. * The VER_CONF message may consist of a single 4-byte word, or may be
  7905. * extended with TLVs that specify HTT options selected by the target.
  7906. * The following option TLVs may be appended to the VER_CONF message:
  7907. * - LL_BUS_ADDR_SIZE
  7908. * - HL_SUPPRESS_TX_COMPL_IND
  7909. * - MAX_TX_QUEUE_GROUPS
  7910. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7911. * may be appended to the VER_CONF message (but only one TLV of each type).
  7912. *
  7913. * Header fields:
  7914. * - MSG_TYPE
  7915. * Bits 7:0
  7916. * Purpose: identifies this as a version number confirmation message
  7917. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7918. * - VER_MINOR
  7919. * Bits 15:8
  7920. * Purpose: Specify the minor number of the HTT message library version
  7921. * in use by the target firmware.
  7922. * The minor number specifies the specific revision within a range
  7923. * of fundamentally compatible HTT message definition revisions.
  7924. * Compatible revisions involve adding new messages or perhaps
  7925. * adding new fields to existing messages, in a backwards-compatible
  7926. * manner.
  7927. * Incompatible revisions involve changing the message type values,
  7928. * or redefining existing messages.
  7929. * Value: minor number
  7930. * - VER_MAJOR
  7931. * Bits 15:8
  7932. * Purpose: Specify the major number of the HTT message library version
  7933. * in use by the target firmware.
  7934. * The major number specifies the family of minor revisions that are
  7935. * fundamentally compatible with each other, but not with prior or
  7936. * later families.
  7937. * Value: major number
  7938. */
  7939. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7940. #define HTT_VER_CONF_MINOR_S 8
  7941. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7942. #define HTT_VER_CONF_MAJOR_S 16
  7943. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7944. do { \
  7945. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7946. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7947. } while (0)
  7948. #define HTT_VER_CONF_MINOR_GET(word) \
  7949. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7950. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7951. do { \
  7952. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7953. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7954. } while (0)
  7955. #define HTT_VER_CONF_MAJOR_GET(word) \
  7956. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7957. #define HTT_VER_CONF_BYTES 4
  7958. /**
  7959. * @brief - target -> host HTT Rx In order indication message
  7960. *
  7961. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7962. *
  7963. * @details
  7964. *
  7965. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7966. * |----------------+-------------------+---------------------+---------------|
  7967. * | peer ID | P| F| O| ext TID | msg type |
  7968. * |--------------------------------------------------------------------------|
  7969. * | MSDU count | Reserved | vdev id |
  7970. * |--------------------------------------------------------------------------|
  7971. * | MSDU 0 bus address (bits 31:0) |
  7972. #if HTT_PADDR64
  7973. * | MSDU 0 bus address (bits 63:32) |
  7974. #endif
  7975. * |--------------------------------------------------------------------------|
  7976. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7977. * |--------------------------------------------------------------------------|
  7978. * | MSDU 1 bus address (bits 31:0) |
  7979. #if HTT_PADDR64
  7980. * | MSDU 1 bus address (bits 63:32) |
  7981. #endif
  7982. * |--------------------------------------------------------------------------|
  7983. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7984. * |--------------------------------------------------------------------------|
  7985. */
  7986. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7987. *
  7988. * @details
  7989. * bits
  7990. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7991. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7992. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7993. * | | frag | | | | fail |chksum fail|
  7994. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7995. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7996. */
  7997. struct htt_rx_in_ord_paddr_ind_hdr_t
  7998. {
  7999. A_UINT32 /* word 0 */
  8000. msg_type: 8,
  8001. ext_tid: 5,
  8002. offload: 1,
  8003. frag: 1,
  8004. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8005. peer_id: 16;
  8006. A_UINT32 /* word 1 */
  8007. vap_id: 8,
  8008. /* NOTE:
  8009. * This reserved_1 field is not truly reserved - certain targets use
  8010. * this field internally to store debug information, and do not zero
  8011. * out the contents of the field before uploading the message to the
  8012. * host. Thus, any host-target communication supported by this field
  8013. * is limited to using values that are never used by the debug
  8014. * information stored by certain targets in the reserved_1 field.
  8015. * In particular, the targets in question don't use the value 0x3
  8016. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8017. * so this previously-unused value within these bits is available to
  8018. * use as the host / target PKT_CAPTURE_MODE flag.
  8019. */
  8020. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8021. /* if pkt_capture_mode == 0x3, host should
  8022. * send rx frames to monitor mode interface
  8023. */
  8024. msdu_cnt: 16;
  8025. };
  8026. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8027. {
  8028. A_UINT32 dma_addr;
  8029. A_UINT32
  8030. length: 16,
  8031. fw_desc: 8,
  8032. msdu_info:8;
  8033. };
  8034. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8035. {
  8036. A_UINT32 dma_addr_lo;
  8037. A_UINT32 dma_addr_hi;
  8038. A_UINT32
  8039. length: 16,
  8040. fw_desc: 8,
  8041. msdu_info:8;
  8042. };
  8043. #if HTT_PADDR64
  8044. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8045. #else
  8046. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8047. #endif
  8048. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8049. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8050. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8051. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8052. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8053. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8054. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8055. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8056. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8057. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8058. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8059. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8060. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8061. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8062. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8063. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8064. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8065. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8066. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8067. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8068. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8069. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8070. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8071. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8072. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8073. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8074. /* for systems using 64-bit format for bus addresses */
  8075. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8076. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8077. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8078. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8079. /* for systems using 32-bit format for bus addresses */
  8080. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8081. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8082. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8083. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8084. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8085. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8086. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8087. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8088. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8089. do { \
  8090. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8091. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8092. } while (0)
  8093. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8094. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8095. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8096. do { \
  8097. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8098. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8099. } while (0)
  8100. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8101. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8102. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8103. do { \
  8104. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8105. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8106. } while (0)
  8107. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8108. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8109. /*
  8110. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8111. * deliver the rx frames to the monitor mode interface.
  8112. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8113. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8114. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8115. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8116. */
  8117. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8118. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8119. do { \
  8120. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8121. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8122. } while (0)
  8123. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8124. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8125. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8126. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8127. do { \
  8128. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8129. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8130. } while (0)
  8131. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8132. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8133. /* for systems using 64-bit format for bus addresses */
  8134. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8135. do { \
  8136. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8137. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8138. } while (0)
  8139. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8140. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8141. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8142. do { \
  8143. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8144. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8145. } while (0)
  8146. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8147. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8148. /* for systems using 32-bit format for bus addresses */
  8149. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8150. do { \
  8151. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8152. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8153. } while (0)
  8154. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8155. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8156. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8157. do { \
  8158. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8159. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8160. } while (0)
  8161. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8162. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8163. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8164. do { \
  8165. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8166. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8167. } while (0)
  8168. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8169. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8170. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8171. do { \
  8172. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8173. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8174. } while (0)
  8175. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8176. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8177. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8178. do { \
  8179. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8180. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8181. } while (0)
  8182. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8183. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8184. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8185. do { \
  8186. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8187. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8188. } while (0)
  8189. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8190. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8191. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8192. do { \
  8193. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8194. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8195. } while (0)
  8196. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8197. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8198. /* definitions used within target -> host rx indication message */
  8199. PREPACK struct htt_rx_ind_hdr_prefix_t
  8200. {
  8201. A_UINT32 /* word 0 */
  8202. msg_type: 8,
  8203. ext_tid: 5,
  8204. release_valid: 1,
  8205. flush_valid: 1,
  8206. reserved0: 1,
  8207. peer_id: 16;
  8208. A_UINT32 /* word 1 */
  8209. flush_start_seq_num: 6,
  8210. flush_end_seq_num: 6,
  8211. release_start_seq_num: 6,
  8212. release_end_seq_num: 6,
  8213. num_mpdu_ranges: 8;
  8214. } POSTPACK;
  8215. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8216. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8217. #define HTT_TGT_RSSI_INVALID 0x80
  8218. PREPACK struct htt_rx_ppdu_desc_t
  8219. {
  8220. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8221. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8222. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8223. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8224. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8225. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8226. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8227. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8228. A_UINT32 /* word 0 */
  8229. rssi_cmb: 8,
  8230. timestamp_submicrosec: 8,
  8231. phy_err_code: 8,
  8232. phy_err: 1,
  8233. legacy_rate: 4,
  8234. legacy_rate_sel: 1,
  8235. end_valid: 1,
  8236. start_valid: 1;
  8237. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8238. union {
  8239. A_UINT32 /* word 1 */
  8240. rssi0_pri20: 8,
  8241. rssi0_ext20: 8,
  8242. rssi0_ext40: 8,
  8243. rssi0_ext80: 8;
  8244. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8245. } u0;
  8246. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8247. union {
  8248. A_UINT32 /* word 2 */
  8249. rssi1_pri20: 8,
  8250. rssi1_ext20: 8,
  8251. rssi1_ext40: 8,
  8252. rssi1_ext80: 8;
  8253. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8254. } u1;
  8255. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8256. union {
  8257. A_UINT32 /* word 3 */
  8258. rssi2_pri20: 8,
  8259. rssi2_ext20: 8,
  8260. rssi2_ext40: 8,
  8261. rssi2_ext80: 8;
  8262. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8263. } u2;
  8264. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8265. union {
  8266. A_UINT32 /* word 4 */
  8267. rssi3_pri20: 8,
  8268. rssi3_ext20: 8,
  8269. rssi3_ext40: 8,
  8270. rssi3_ext80: 8;
  8271. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8272. } u3;
  8273. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8274. A_UINT32 tsf32; /* word 5 */
  8275. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8276. A_UINT32 timestamp_microsec; /* word 6 */
  8277. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8278. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8279. A_UINT32 /* word 7 */
  8280. vht_sig_a1: 24,
  8281. preamble_type: 8;
  8282. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8283. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8284. A_UINT32 /* word 8 */
  8285. vht_sig_a2: 24,
  8286. /* sa_ant_matrix
  8287. * For cases where a single rx chain has options to be connected to
  8288. * different rx antennas, show which rx antennas were in use during
  8289. * receipt of a given PPDU.
  8290. * This sa_ant_matrix provides a bitmask of the antennas used while
  8291. * receiving this frame.
  8292. */
  8293. sa_ant_matrix: 8;
  8294. } POSTPACK;
  8295. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8296. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8297. PREPACK struct htt_rx_ind_hdr_suffix_t
  8298. {
  8299. A_UINT32 /* word 0 */
  8300. fw_rx_desc_bytes: 16,
  8301. reserved0: 16;
  8302. } POSTPACK;
  8303. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8304. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8305. PREPACK struct htt_rx_ind_hdr_t
  8306. {
  8307. struct htt_rx_ind_hdr_prefix_t prefix;
  8308. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8309. struct htt_rx_ind_hdr_suffix_t suffix;
  8310. } POSTPACK;
  8311. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8312. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8313. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8314. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8315. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8316. /*
  8317. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8318. * the offset into the HTT rx indication message at which the
  8319. * FW rx PPDU descriptor resides
  8320. */
  8321. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8322. /*
  8323. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8324. * the offset into the HTT rx indication message at which the
  8325. * header suffix (FW rx MSDU byte count) resides
  8326. */
  8327. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8328. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8329. /*
  8330. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8331. * the offset into the HTT rx indication message at which the per-MSDU
  8332. * information starts
  8333. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8334. * per-MSDU information portion of the message. The per-MSDU info itself
  8335. * starts at byte 12.
  8336. */
  8337. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8338. /**
  8339. * @brief target -> host rx indication message definition
  8340. *
  8341. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8342. *
  8343. * @details
  8344. * The following field definitions describe the format of the rx indication
  8345. * message sent from the target to the host.
  8346. * The message consists of three major sections:
  8347. * 1. a fixed-length header
  8348. * 2. a variable-length list of firmware rx MSDU descriptors
  8349. * 3. one or more 4-octet MPDU range information elements
  8350. * The fixed length header itself has two sub-sections
  8351. * 1. the message meta-information, including identification of the
  8352. * sender and type of the received data, and a 4-octet flush/release IE
  8353. * 2. the firmware rx PPDU descriptor
  8354. *
  8355. * The format of the message is depicted below.
  8356. * in this depiction, the following abbreviations are used for information
  8357. * elements within the message:
  8358. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8359. * elements associated with the PPDU start are valid.
  8360. * Specifically, the following fields are valid only if SV is set:
  8361. * RSSI (all variants), L, legacy rate, preamble type, service,
  8362. * VHT-SIG-A
  8363. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8364. * elements associated with the PPDU end are valid.
  8365. * Specifically, the following fields are valid only if EV is set:
  8366. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8367. * - L - Legacy rate selector - if legacy rates are used, this flag
  8368. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8369. * (L == 0) PHY.
  8370. * - P - PHY error flag - boolean indication of whether the rx frame had
  8371. * a PHY error
  8372. *
  8373. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8374. * |----------------+-------------------+---------------------+---------------|
  8375. * | peer ID | |RV|FV| ext TID | msg type |
  8376. * |--------------------------------------------------------------------------|
  8377. * | num | release | release | flush | flush |
  8378. * | MPDU | end | start | end | start |
  8379. * | ranges | seq num | seq num | seq num | seq num |
  8380. * |==========================================================================|
  8381. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8382. * |V|V| | rate | | | timestamp | RSSI |
  8383. * |--------------------------------------------------------------------------|
  8384. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8385. * |--------------------------------------------------------------------------|
  8386. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8387. * |--------------------------------------------------------------------------|
  8388. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8389. * |--------------------------------------------------------------------------|
  8390. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8391. * |--------------------------------------------------------------------------|
  8392. * | TSF LSBs |
  8393. * |--------------------------------------------------------------------------|
  8394. * | microsec timestamp |
  8395. * |--------------------------------------------------------------------------|
  8396. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8397. * |--------------------------------------------------------------------------|
  8398. * | service | HT-SIG / VHT-SIG-A2 |
  8399. * |==========================================================================|
  8400. * | reserved | FW rx desc bytes |
  8401. * |--------------------------------------------------------------------------|
  8402. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8403. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8404. * |--------------------------------------------------------------------------|
  8405. * : : :
  8406. * |--------------------------------------------------------------------------|
  8407. * | alignment | MSDU Rx |
  8408. * | padding | desc Bn |
  8409. * |--------------------------------------------------------------------------|
  8410. * | reserved | MPDU range status | MPDU count |
  8411. * |--------------------------------------------------------------------------|
  8412. * : reserved : MPDU range status : MPDU count :
  8413. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8414. *
  8415. * Header fields:
  8416. * - MSG_TYPE
  8417. * Bits 7:0
  8418. * Purpose: identifies this as an rx indication message
  8419. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8420. * - EXT_TID
  8421. * Bits 12:8
  8422. * Purpose: identify the traffic ID of the rx data, including
  8423. * special "extended" TID values for multicast, broadcast, and
  8424. * non-QoS data frames
  8425. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8426. * - FLUSH_VALID (FV)
  8427. * Bit 13
  8428. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8429. * is valid
  8430. * Value:
  8431. * 1 -> flush IE is valid and needs to be processed
  8432. * 0 -> flush IE is not valid and should be ignored
  8433. * - REL_VALID (RV)
  8434. * Bit 13
  8435. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8436. * is valid
  8437. * Value:
  8438. * 1 -> release IE is valid and needs to be processed
  8439. * 0 -> release IE is not valid and should be ignored
  8440. * - PEER_ID
  8441. * Bits 31:16
  8442. * Purpose: Identify, by ID, which peer sent the rx data
  8443. * Value: ID of the peer who sent the rx data
  8444. * - FLUSH_SEQ_NUM_START
  8445. * Bits 5:0
  8446. * Purpose: Indicate the start of a series of MPDUs to flush
  8447. * Not all MPDUs within this series are necessarily valid - the host
  8448. * must check each sequence number within this range to see if the
  8449. * corresponding MPDU is actually present.
  8450. * This field is only valid if the FV bit is set.
  8451. * Value:
  8452. * The sequence number for the first MPDUs to check to flush.
  8453. * The sequence number is masked by 0x3f.
  8454. * - FLUSH_SEQ_NUM_END
  8455. * Bits 11:6
  8456. * Purpose: Indicate the end of a series of MPDUs to flush
  8457. * Value:
  8458. * The sequence number one larger than the sequence number of the
  8459. * last MPDU to check to flush.
  8460. * The sequence number is masked by 0x3f.
  8461. * Not all MPDUs within this series are necessarily valid - the host
  8462. * must check each sequence number within this range to see if the
  8463. * corresponding MPDU is actually present.
  8464. * This field is only valid if the FV bit is set.
  8465. * - REL_SEQ_NUM_START
  8466. * Bits 17:12
  8467. * Purpose: Indicate the start of a series of MPDUs to release.
  8468. * All MPDUs within this series are present and valid - the host
  8469. * need not check each sequence number within this range to see if
  8470. * the corresponding MPDU is actually present.
  8471. * This field is only valid if the RV bit is set.
  8472. * Value:
  8473. * The sequence number for the first MPDUs to check to release.
  8474. * The sequence number is masked by 0x3f.
  8475. * - REL_SEQ_NUM_END
  8476. * Bits 23:18
  8477. * Purpose: Indicate the end of a series of MPDUs to release.
  8478. * Value:
  8479. * The sequence number one larger than the sequence number of the
  8480. * last MPDU to check to release.
  8481. * The sequence number is masked by 0x3f.
  8482. * All MPDUs within this series are present and valid - the host
  8483. * need not check each sequence number within this range to see if
  8484. * the corresponding MPDU is actually present.
  8485. * This field is only valid if the RV bit is set.
  8486. * - NUM_MPDU_RANGES
  8487. * Bits 31:24
  8488. * Purpose: Indicate how many ranges of MPDUs are present.
  8489. * Each MPDU range consists of a series of contiguous MPDUs within the
  8490. * rx frame sequence which all have the same MPDU status.
  8491. * Value: 1-63 (typically a small number, like 1-3)
  8492. *
  8493. * Rx PPDU descriptor fields:
  8494. * - RSSI_CMB
  8495. * Bits 7:0
  8496. * Purpose: Combined RSSI from all active rx chains, across the active
  8497. * bandwidth.
  8498. * Value: RSSI dB units w.r.t. noise floor
  8499. * - TIMESTAMP_SUBMICROSEC
  8500. * Bits 15:8
  8501. * Purpose: high-resolution timestamp
  8502. * Value:
  8503. * Sub-microsecond time of PPDU reception.
  8504. * This timestamp ranges from [0,MAC clock MHz).
  8505. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8506. * to form a high-resolution, large range rx timestamp.
  8507. * - PHY_ERR_CODE
  8508. * Bits 23:16
  8509. * Purpose:
  8510. * If the rx frame processing resulted in a PHY error, indicate what
  8511. * type of rx PHY error occurred.
  8512. * Value:
  8513. * This field is valid if the "P" (PHY_ERR) flag is set.
  8514. * TBD: document/specify the values for this field
  8515. * - PHY_ERR
  8516. * Bit 24
  8517. * Purpose: indicate whether the rx PPDU had a PHY error
  8518. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8519. * - LEGACY_RATE
  8520. * Bits 28:25
  8521. * Purpose:
  8522. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8523. * specify which rate was used.
  8524. * Value:
  8525. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8526. * flag.
  8527. * If LEGACY_RATE_SEL is 0:
  8528. * 0x8: OFDM 48 Mbps
  8529. * 0x9: OFDM 24 Mbps
  8530. * 0xA: OFDM 12 Mbps
  8531. * 0xB: OFDM 6 Mbps
  8532. * 0xC: OFDM 54 Mbps
  8533. * 0xD: OFDM 36 Mbps
  8534. * 0xE: OFDM 18 Mbps
  8535. * 0xF: OFDM 9 Mbps
  8536. * If LEGACY_RATE_SEL is 1:
  8537. * 0x8: CCK 11 Mbps long preamble
  8538. * 0x9: CCK 5.5 Mbps long preamble
  8539. * 0xA: CCK 2 Mbps long preamble
  8540. * 0xB: CCK 1 Mbps long preamble
  8541. * 0xC: CCK 11 Mbps short preamble
  8542. * 0xD: CCK 5.5 Mbps short preamble
  8543. * 0xE: CCK 2 Mbps short preamble
  8544. * - LEGACY_RATE_SEL
  8545. * Bit 29
  8546. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8547. * Value:
  8548. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8549. * used a legacy rate.
  8550. * 0 -> OFDM, 1 -> CCK
  8551. * - END_VALID
  8552. * Bit 30
  8553. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8554. * the start of the PPDU are valid. Specifically, the following
  8555. * fields are only valid if END_VALID is set:
  8556. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8557. * TIMESTAMP_SUBMICROSEC
  8558. * Value:
  8559. * 0 -> rx PPDU desc end fields are not valid
  8560. * 1 -> rx PPDU desc end fields are valid
  8561. * - START_VALID
  8562. * Bit 31
  8563. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8564. * the end of the PPDU are valid. Specifically, the following
  8565. * fields are only valid if START_VALID is set:
  8566. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8567. * VHT-SIG-A
  8568. * Value:
  8569. * 0 -> rx PPDU desc start fields are not valid
  8570. * 1 -> rx PPDU desc start fields are valid
  8571. * - RSSI0_PRI20
  8572. * Bits 7:0
  8573. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8574. * Value: RSSI dB units w.r.t. noise floor
  8575. *
  8576. * - RSSI0_EXT20
  8577. * Bits 7:0
  8578. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8579. * (if the rx bandwidth was >= 40 MHz)
  8580. * Value: RSSI dB units w.r.t. noise floor
  8581. * - RSSI0_EXT40
  8582. * Bits 7:0
  8583. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8584. * (if the rx bandwidth was >= 80 MHz)
  8585. * Value: RSSI dB units w.r.t. noise floor
  8586. * - RSSI0_EXT80
  8587. * Bits 7:0
  8588. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8589. * (if the rx bandwidth was >= 160 MHz)
  8590. * Value: RSSI dB units w.r.t. noise floor
  8591. *
  8592. * - RSSI1_PRI20
  8593. * Bits 7:0
  8594. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8595. * Value: RSSI dB units w.r.t. noise floor
  8596. * - RSSI1_EXT20
  8597. * Bits 7:0
  8598. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8599. * (if the rx bandwidth was >= 40 MHz)
  8600. * Value: RSSI dB units w.r.t. noise floor
  8601. * - RSSI1_EXT40
  8602. * Bits 7:0
  8603. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8604. * (if the rx bandwidth was >= 80 MHz)
  8605. * Value: RSSI dB units w.r.t. noise floor
  8606. * - RSSI1_EXT80
  8607. * Bits 7:0
  8608. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8609. * (if the rx bandwidth was >= 160 MHz)
  8610. * Value: RSSI dB units w.r.t. noise floor
  8611. *
  8612. * - RSSI2_PRI20
  8613. * Bits 7:0
  8614. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8615. * Value: RSSI dB units w.r.t. noise floor
  8616. * - RSSI2_EXT20
  8617. * Bits 7:0
  8618. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8619. * (if the rx bandwidth was >= 40 MHz)
  8620. * Value: RSSI dB units w.r.t. noise floor
  8621. * - RSSI2_EXT40
  8622. * Bits 7:0
  8623. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8624. * (if the rx bandwidth was >= 80 MHz)
  8625. * Value: RSSI dB units w.r.t. noise floor
  8626. * - RSSI2_EXT80
  8627. * Bits 7:0
  8628. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8629. * (if the rx bandwidth was >= 160 MHz)
  8630. * Value: RSSI dB units w.r.t. noise floor
  8631. *
  8632. * - RSSI3_PRI20
  8633. * Bits 7:0
  8634. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8635. * Value: RSSI dB units w.r.t. noise floor
  8636. * - RSSI3_EXT20
  8637. * Bits 7:0
  8638. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8639. * (if the rx bandwidth was >= 40 MHz)
  8640. * Value: RSSI dB units w.r.t. noise floor
  8641. * - RSSI3_EXT40
  8642. * Bits 7:0
  8643. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8644. * (if the rx bandwidth was >= 80 MHz)
  8645. * Value: RSSI dB units w.r.t. noise floor
  8646. * - RSSI3_EXT80
  8647. * Bits 7:0
  8648. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8649. * (if the rx bandwidth was >= 160 MHz)
  8650. * Value: RSSI dB units w.r.t. noise floor
  8651. *
  8652. * - TSF32
  8653. * Bits 31:0
  8654. * Purpose: specify the time the rx PPDU was received, in TSF units
  8655. * Value: 32 LSBs of the TSF
  8656. * - TIMESTAMP_MICROSEC
  8657. * Bits 31:0
  8658. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8659. * Value: PPDU rx time, in microseconds
  8660. * - VHT_SIG_A1
  8661. * Bits 23:0
  8662. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8663. * from the rx PPDU
  8664. * Value:
  8665. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8666. * VHT-SIG-A1 data.
  8667. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8668. * first 24 bits of the HT-SIG data.
  8669. * Otherwise, this field is invalid.
  8670. * Refer to the the 802.11 protocol for the definition of the
  8671. * HT-SIG and VHT-SIG-A1 fields
  8672. * - VHT_SIG_A2
  8673. * Bits 23:0
  8674. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8675. * from the rx PPDU
  8676. * Value:
  8677. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8678. * VHT-SIG-A2 data.
  8679. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8680. * last 24 bits of the HT-SIG data.
  8681. * Otherwise, this field is invalid.
  8682. * Refer to the the 802.11 protocol for the definition of the
  8683. * HT-SIG and VHT-SIG-A2 fields
  8684. * - PREAMBLE_TYPE
  8685. * Bits 31:24
  8686. * Purpose: indicate the PHY format of the received burst
  8687. * Value:
  8688. * 0x4: Legacy (OFDM/CCK)
  8689. * 0x8: HT
  8690. * 0x9: HT with TxBF
  8691. * 0xC: VHT
  8692. * 0xD: VHT with TxBF
  8693. * - SERVICE
  8694. * Bits 31:24
  8695. * Purpose: TBD
  8696. * Value: TBD
  8697. *
  8698. * Rx MSDU descriptor fields:
  8699. * - FW_RX_DESC_BYTES
  8700. * Bits 15:0
  8701. * Purpose: Indicate how many bytes in the Rx indication are used for
  8702. * FW Rx descriptors
  8703. *
  8704. * Payload fields:
  8705. * - MPDU_COUNT
  8706. * Bits 7:0
  8707. * Purpose: Indicate how many sequential MPDUs share the same status.
  8708. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8709. * - MPDU_STATUS
  8710. * Bits 15:8
  8711. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8712. * received successfully.
  8713. * Value:
  8714. * 0x1: success
  8715. * 0x2: FCS error
  8716. * 0x3: duplicate error
  8717. * 0x4: replay error
  8718. * 0x5: invalid peer
  8719. */
  8720. /* header fields */
  8721. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8722. #define HTT_RX_IND_EXT_TID_S 8
  8723. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8724. #define HTT_RX_IND_FLUSH_VALID_S 13
  8725. #define HTT_RX_IND_REL_VALID_M 0x4000
  8726. #define HTT_RX_IND_REL_VALID_S 14
  8727. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8728. #define HTT_RX_IND_PEER_ID_S 16
  8729. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8730. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8731. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8732. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8733. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8734. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8735. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8736. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8737. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8738. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8739. /* rx PPDU descriptor fields */
  8740. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8741. #define HTT_RX_IND_RSSI_CMB_S 0
  8742. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8743. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8744. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8745. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8746. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8747. #define HTT_RX_IND_PHY_ERR_S 24
  8748. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8749. #define HTT_RX_IND_LEGACY_RATE_S 25
  8750. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8751. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8752. #define HTT_RX_IND_END_VALID_M 0x40000000
  8753. #define HTT_RX_IND_END_VALID_S 30
  8754. #define HTT_RX_IND_START_VALID_M 0x80000000
  8755. #define HTT_RX_IND_START_VALID_S 31
  8756. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8757. #define HTT_RX_IND_RSSI_PRI20_S 0
  8758. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8759. #define HTT_RX_IND_RSSI_EXT20_S 8
  8760. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8761. #define HTT_RX_IND_RSSI_EXT40_S 16
  8762. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8763. #define HTT_RX_IND_RSSI_EXT80_S 24
  8764. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8765. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8766. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8767. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8768. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8769. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8770. #define HTT_RX_IND_SERVICE_M 0xff000000
  8771. #define HTT_RX_IND_SERVICE_S 24
  8772. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8773. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8774. /* rx MSDU descriptor fields */
  8775. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8776. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8777. /* payload fields */
  8778. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8779. #define HTT_RX_IND_MPDU_COUNT_S 0
  8780. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8781. #define HTT_RX_IND_MPDU_STATUS_S 8
  8782. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8783. do { \
  8784. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8785. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8786. } while (0)
  8787. #define HTT_RX_IND_EXT_TID_GET(word) \
  8788. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8789. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8790. do { \
  8791. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8792. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8793. } while (0)
  8794. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8795. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8796. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8797. do { \
  8798. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8799. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8800. } while (0)
  8801. #define HTT_RX_IND_REL_VALID_GET(word) \
  8802. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8803. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8804. do { \
  8805. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8806. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8807. } while (0)
  8808. #define HTT_RX_IND_PEER_ID_GET(word) \
  8809. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8810. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8811. do { \
  8812. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8813. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8814. } while (0)
  8815. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8816. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8817. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8818. do { \
  8819. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8820. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8821. } while (0)
  8822. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8823. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8824. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8825. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8826. do { \
  8827. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8828. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8829. } while (0)
  8830. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8831. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8832. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8833. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8834. do { \
  8835. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8836. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8837. } while (0)
  8838. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8839. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8840. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8841. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8842. do { \
  8843. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8844. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8845. } while (0)
  8846. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8847. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8848. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8849. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8850. do { \
  8851. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8852. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8853. } while (0)
  8854. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8855. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8856. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8857. /* FW rx PPDU descriptor fields */
  8858. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8859. do { \
  8860. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8861. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8862. } while (0)
  8863. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8864. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8865. HTT_RX_IND_RSSI_CMB_S)
  8866. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8867. do { \
  8868. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8869. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8870. } while (0)
  8871. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8872. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8873. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8874. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8875. do { \
  8876. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8877. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8878. } while (0)
  8879. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8880. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8881. HTT_RX_IND_PHY_ERR_CODE_S)
  8882. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8883. do { \
  8884. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8885. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8886. } while (0)
  8887. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8888. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8889. HTT_RX_IND_PHY_ERR_S)
  8890. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8891. do { \
  8892. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8893. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8894. } while (0)
  8895. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8896. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8897. HTT_RX_IND_LEGACY_RATE_S)
  8898. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8899. do { \
  8900. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8901. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8902. } while (0)
  8903. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8904. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8905. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8906. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8907. do { \
  8908. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8909. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8910. } while (0)
  8911. #define HTT_RX_IND_END_VALID_GET(word) \
  8912. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8913. HTT_RX_IND_END_VALID_S)
  8914. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8915. do { \
  8916. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8917. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8918. } while (0)
  8919. #define HTT_RX_IND_START_VALID_GET(word) \
  8920. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8921. HTT_RX_IND_START_VALID_S)
  8922. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8923. do { \
  8924. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8925. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8926. } while (0)
  8927. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8928. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8929. HTT_RX_IND_RSSI_PRI20_S)
  8930. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8931. do { \
  8932. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8933. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8934. } while (0)
  8935. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8936. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8937. HTT_RX_IND_RSSI_EXT20_S)
  8938. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8941. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8942. } while (0)
  8943. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8944. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8945. HTT_RX_IND_RSSI_EXT40_S)
  8946. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8947. do { \
  8948. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8949. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8950. } while (0)
  8951. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8952. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8953. HTT_RX_IND_RSSI_EXT80_S)
  8954. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8955. do { \
  8956. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8957. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8958. } while (0)
  8959. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8960. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8961. HTT_RX_IND_VHT_SIG_A1_S)
  8962. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8963. do { \
  8964. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8965. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8966. } while (0)
  8967. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8968. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8969. HTT_RX_IND_VHT_SIG_A2_S)
  8970. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8971. do { \
  8972. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8973. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8974. } while (0)
  8975. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8976. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8977. HTT_RX_IND_PREAMBLE_TYPE_S)
  8978. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8979. do { \
  8980. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8981. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8982. } while (0)
  8983. #define HTT_RX_IND_SERVICE_GET(word) \
  8984. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8985. HTT_RX_IND_SERVICE_S)
  8986. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8989. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8990. } while (0)
  8991. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8992. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8993. HTT_RX_IND_SA_ANT_MATRIX_S)
  8994. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8997. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8998. } while (0)
  8999. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9000. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9001. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9002. do { \
  9003. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9004. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9005. } while (0)
  9006. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9007. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9008. #define HTT_RX_IND_HL_BYTES \
  9009. (HTT_RX_IND_HDR_BYTES + \
  9010. 4 /* single FW rx MSDU descriptor */ + \
  9011. 4 /* single MPDU range information element */)
  9012. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9013. /* Could we use one macro entry? */
  9014. #define HTT_WORD_SET(word, field, value) \
  9015. do { \
  9016. HTT_CHECK_SET_VAL(field, value); \
  9017. (word) |= ((value) << field ## _S); \
  9018. } while (0)
  9019. #define HTT_WORD_GET(word, field) \
  9020. (((word) & field ## _M) >> field ## _S)
  9021. PREPACK struct hl_htt_rx_ind_base {
  9022. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9023. } POSTPACK;
  9024. /*
  9025. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9026. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9027. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9028. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9029. * htt_rx_ind_hl_rx_desc_t.
  9030. */
  9031. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9032. struct htt_rx_ind_hl_rx_desc_t {
  9033. A_UINT8 ver;
  9034. A_UINT8 len;
  9035. struct {
  9036. A_UINT8
  9037. first_msdu: 1,
  9038. last_msdu: 1,
  9039. c3_failed: 1,
  9040. c4_failed: 1,
  9041. ipv6: 1,
  9042. tcp: 1,
  9043. udp: 1,
  9044. reserved: 1;
  9045. } flags;
  9046. /* NOTE: no reserved space - don't append any new fields here */
  9047. };
  9048. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9049. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9050. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9051. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9052. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9053. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9054. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9055. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9056. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9057. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9058. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9059. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9060. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9061. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9062. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9063. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9064. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9065. /* This structure is used in HL, the basic descriptor information
  9066. * used by host. the structure is translated by FW from HW desc
  9067. * or generated by FW. But in HL monitor mode, the host would use
  9068. * the same structure with LL.
  9069. */
  9070. PREPACK struct hl_htt_rx_desc_base {
  9071. A_UINT32
  9072. seq_num:12,
  9073. encrypted:1,
  9074. chan_info_present:1,
  9075. resv0:2,
  9076. mcast_bcast:1,
  9077. fragment:1,
  9078. key_id_oct:8,
  9079. resv1:6;
  9080. A_UINT32
  9081. pn_31_0;
  9082. union {
  9083. struct {
  9084. A_UINT16 pn_47_32;
  9085. A_UINT16 pn_63_48;
  9086. } pn16;
  9087. A_UINT32 pn_63_32;
  9088. } u0;
  9089. A_UINT32
  9090. pn_95_64;
  9091. A_UINT32
  9092. pn_127_96;
  9093. } POSTPACK;
  9094. /*
  9095. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9096. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9097. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9098. * Please see htt_chan_change_t for description of the fields.
  9099. */
  9100. PREPACK struct htt_chan_info_t
  9101. {
  9102. A_UINT32 primary_chan_center_freq_mhz: 16,
  9103. contig_chan1_center_freq_mhz: 16;
  9104. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9105. phy_mode: 8,
  9106. reserved: 8;
  9107. } POSTPACK;
  9108. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9109. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9110. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9111. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9112. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9113. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9114. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9115. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9116. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9117. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9118. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9119. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9120. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9121. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9122. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9123. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9124. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9125. /* Channel information */
  9126. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9127. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9128. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9129. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9130. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9131. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9132. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9133. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9134. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9135. do { \
  9136. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9137. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9138. } while (0)
  9139. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9140. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9141. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9142. do { \
  9143. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9144. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9145. } while (0)
  9146. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9147. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9148. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9149. do { \
  9150. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9151. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9152. } while (0)
  9153. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9154. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9155. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9156. do { \
  9157. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9158. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9159. } while (0)
  9160. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9161. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9162. /*
  9163. * @brief target -> host message definition for FW offloaded pkts
  9164. *
  9165. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9166. *
  9167. * @details
  9168. * The following field definitions describe the format of the firmware
  9169. * offload deliver message sent from the target to the host.
  9170. *
  9171. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9172. *
  9173. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9174. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9175. * | reserved_1 | msg type |
  9176. * |--------------------------------------------------------------------------|
  9177. * | phy_timestamp_l32 |
  9178. * |--------------------------------------------------------------------------|
  9179. * | WORD2 (see below) |
  9180. * |--------------------------------------------------------------------------|
  9181. * | seqno | framectrl |
  9182. * |--------------------------------------------------------------------------|
  9183. * | reserved_3 | vdev_id | tid_num|
  9184. * |--------------------------------------------------------------------------|
  9185. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9186. * |--------------------------------------------------------------------------|
  9187. *
  9188. * where:
  9189. * STAT = status
  9190. * F = format (802.3 vs. 802.11)
  9191. *
  9192. * definition for word 2
  9193. *
  9194. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9195. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9196. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9197. * |--------------------------------------------------------------------------|
  9198. *
  9199. * where:
  9200. * PR = preamble
  9201. * BF = beamformed
  9202. */
  9203. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9204. {
  9205. A_UINT32 /* word 0 */
  9206. msg_type:8, /* [ 7: 0] */
  9207. reserved_1:24; /* [31: 8] */
  9208. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9209. A_UINT32 /* word 2 */
  9210. /* preamble:
  9211. * 0-OFDM,
  9212. * 1-CCk,
  9213. * 2-HT,
  9214. * 3-VHT
  9215. */
  9216. preamble: 2, /* [1:0] */
  9217. /* mcs:
  9218. * In case of HT preamble interpret
  9219. * MCS along with NSS.
  9220. * Valid values for HT are 0 to 7.
  9221. * HT mcs 0 with NSS 2 is mcs 8.
  9222. * Valid values for VHT are 0 to 9.
  9223. */
  9224. mcs: 4, /* [5:2] */
  9225. /* rate:
  9226. * This is applicable only for
  9227. * CCK and OFDM preamble type
  9228. * rate 0: OFDM 48 Mbps,
  9229. * 1: OFDM 24 Mbps,
  9230. * 2: OFDM 12 Mbps
  9231. * 3: OFDM 6 Mbps
  9232. * 4: OFDM 54 Mbps
  9233. * 5: OFDM 36 Mbps
  9234. * 6: OFDM 18 Mbps
  9235. * 7: OFDM 9 Mbps
  9236. * rate 0: CCK 11 Mbps Long
  9237. * 1: CCK 5.5 Mbps Long
  9238. * 2: CCK 2 Mbps Long
  9239. * 3: CCK 1 Mbps Long
  9240. * 4: CCK 11 Mbps Short
  9241. * 5: CCK 5.5 Mbps Short
  9242. * 6: CCK 2 Mbps Short
  9243. */
  9244. rate : 3, /* [ 8: 6] */
  9245. rssi : 8, /* [16: 9] units=dBm */
  9246. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9247. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9248. stbc : 1, /* [22] */
  9249. sgi : 1, /* [23] */
  9250. ldpc : 1, /* [24] */
  9251. beamformed: 1, /* [25] */
  9252. reserved_2: 6; /* [31:26] */
  9253. A_UINT32 /* word 3 */
  9254. framectrl:16, /* [15: 0] */
  9255. seqno:16; /* [31:16] */
  9256. A_UINT32 /* word 4 */
  9257. tid_num:5, /* [ 4: 0] actual TID number */
  9258. vdev_id:8, /* [12: 5] */
  9259. reserved_3:19; /* [31:13] */
  9260. A_UINT32 /* word 5 */
  9261. /* status:
  9262. * 0: tx_ok
  9263. * 1: retry
  9264. * 2: drop
  9265. * 3: filtered
  9266. * 4: abort
  9267. * 5: tid delete
  9268. * 6: sw abort
  9269. * 7: dropped by peer migration
  9270. */
  9271. status:3, /* [2:0] */
  9272. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9273. tx_mpdu_bytes:16, /* [19:4] */
  9274. /* Indicates retry count of offloaded/local generated Data tx frames */
  9275. tx_retry_cnt:6, /* [25:20] */
  9276. reserved_4:6; /* [31:26] */
  9277. } POSTPACK;
  9278. /* FW offload deliver ind message header fields */
  9279. /* DWORD one */
  9280. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9281. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9282. /* DWORD two */
  9283. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9284. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9285. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9286. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9287. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9288. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9289. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9290. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9291. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9292. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9293. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9294. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9295. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9296. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9297. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9298. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9299. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9300. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9301. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9302. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9303. /* DWORD three*/
  9304. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9305. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9306. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9307. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9308. /* DWORD four */
  9309. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9310. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9311. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9312. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9313. /* DWORD five */
  9314. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9315. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9316. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9317. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9318. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9319. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9320. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9321. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9322. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9323. do { \
  9324. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9325. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9326. } while (0)
  9327. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9328. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9329. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9330. do { \
  9331. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9332. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9333. } while (0)
  9334. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9335. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9336. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9337. do { \
  9338. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9339. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9340. } while (0)
  9341. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9342. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9343. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9344. do { \
  9345. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9346. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9347. } while (0)
  9348. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9349. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9350. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9351. do { \
  9352. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9353. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9354. } while (0)
  9355. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9356. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9357. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9358. do { \
  9359. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9360. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9361. } while (0)
  9362. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9363. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9364. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9365. do { \
  9366. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9367. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9368. } while (0)
  9369. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9370. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9371. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9372. do { \
  9373. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9374. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9375. } while (0)
  9376. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9377. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9378. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9379. do { \
  9380. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9381. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9382. } while (0)
  9383. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9384. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9385. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9386. do { \
  9387. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9388. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9389. } while (0)
  9390. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9391. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9392. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9393. do { \
  9394. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9395. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9396. } while (0)
  9397. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9398. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9399. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9400. do { \
  9401. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9402. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9403. } while (0)
  9404. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9405. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9406. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9407. do { \
  9408. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9409. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9410. } while (0)
  9411. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9412. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9413. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9414. do { \
  9415. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9416. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9417. } while (0)
  9418. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9419. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9420. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9421. do { \
  9422. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9423. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9424. } while (0)
  9425. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9426. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9427. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9428. do { \
  9429. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9430. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9431. } while (0)
  9432. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9433. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9434. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9435. do { \
  9436. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9437. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9438. } while (0)
  9439. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9440. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9441. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9444. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9445. } while (0)
  9446. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9447. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9448. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9451. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9452. } while (0)
  9453. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9454. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9455. /*
  9456. * @brief target -> host rx reorder flush message definition
  9457. *
  9458. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9459. *
  9460. * @details
  9461. * The following field definitions describe the format of the rx flush
  9462. * message sent from the target to the host.
  9463. * The message consists of a 4-octet header, followed by one or more
  9464. * 4-octet payload information elements.
  9465. *
  9466. * |31 24|23 8|7 0|
  9467. * |--------------------------------------------------------------|
  9468. * | TID | peer ID | msg type |
  9469. * |--------------------------------------------------------------|
  9470. * | seq num end | seq num start | MPDU status | reserved |
  9471. * |--------------------------------------------------------------|
  9472. * First DWORD:
  9473. * - MSG_TYPE
  9474. * Bits 7:0
  9475. * Purpose: identifies this as an rx flush message
  9476. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9477. * - PEER_ID
  9478. * Bits 23:8 (only bits 18:8 actually used)
  9479. * Purpose: identify which peer's rx data is being flushed
  9480. * Value: (rx) peer ID
  9481. * - TID
  9482. * Bits 31:24 (only bits 27:24 actually used)
  9483. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9484. * Value: traffic identifier
  9485. * Second DWORD:
  9486. * - MPDU_STATUS
  9487. * Bits 15:8
  9488. * Purpose:
  9489. * Indicate whether the flushed MPDUs should be discarded or processed.
  9490. * Value:
  9491. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9492. * stages of rx processing
  9493. * other: discard the MPDUs
  9494. * It is anticipated that flush messages will always have
  9495. * MPDU status == 1, but the status flag is included for
  9496. * flexibility.
  9497. * - SEQ_NUM_START
  9498. * Bits 23:16
  9499. * Purpose:
  9500. * Indicate the start of a series of consecutive MPDUs being flushed.
  9501. * Not all MPDUs within this range are necessarily valid - the host
  9502. * must check each sequence number within this range to see if the
  9503. * corresponding MPDU is actually present.
  9504. * Value:
  9505. * The sequence number for the first MPDU in the sequence.
  9506. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9507. * - SEQ_NUM_END
  9508. * Bits 30:24
  9509. * Purpose:
  9510. * Indicate the end of a series of consecutive MPDUs being flushed.
  9511. * Value:
  9512. * The sequence number one larger than the sequence number of the
  9513. * last MPDU being flushed.
  9514. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9515. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9516. * are to be released for further rx processing.
  9517. * Not all MPDUs within this range are necessarily valid - the host
  9518. * must check each sequence number within this range to see if the
  9519. * corresponding MPDU is actually present.
  9520. */
  9521. /* first DWORD */
  9522. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9523. #define HTT_RX_FLUSH_PEER_ID_S 8
  9524. #define HTT_RX_FLUSH_TID_M 0xff000000
  9525. #define HTT_RX_FLUSH_TID_S 24
  9526. /* second DWORD */
  9527. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9528. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9529. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9530. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9531. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9532. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9533. #define HTT_RX_FLUSH_BYTES 8
  9534. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9535. do { \
  9536. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9537. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9538. } while (0)
  9539. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9540. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9541. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9542. do { \
  9543. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9544. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9545. } while (0)
  9546. #define HTT_RX_FLUSH_TID_GET(word) \
  9547. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9548. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9549. do { \
  9550. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9551. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9552. } while (0)
  9553. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9554. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9555. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9556. do { \
  9557. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9558. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9559. } while (0)
  9560. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9561. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9562. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9563. do { \
  9564. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9565. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9566. } while (0)
  9567. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9568. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9569. /*
  9570. * @brief target -> host rx pn check indication message
  9571. *
  9572. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9573. *
  9574. * @details
  9575. * The following field definitions describe the format of the Rx PN check
  9576. * indication message sent from the target to the host.
  9577. * The message consists of a 4-octet header, followed by the start and
  9578. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9579. * IE is one octet containing the sequence number that failed the PN
  9580. * check.
  9581. *
  9582. * |31 24|23 8|7 0|
  9583. * |--------------------------------------------------------------|
  9584. * | TID | peer ID | msg type |
  9585. * |--------------------------------------------------------------|
  9586. * | Reserved | PN IE count | seq num end | seq num start|
  9587. * |--------------------------------------------------------------|
  9588. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9589. * |--------------------------------------------------------------|
  9590. * First DWORD:
  9591. * - MSG_TYPE
  9592. * Bits 7:0
  9593. * Purpose: Identifies this as an rx pn check indication message
  9594. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9595. * - PEER_ID
  9596. * Bits 23:8 (only bits 18:8 actually used)
  9597. * Purpose: identify which peer
  9598. * Value: (rx) peer ID
  9599. * - TID
  9600. * Bits 31:24 (only bits 27:24 actually used)
  9601. * Purpose: identify traffic identifier
  9602. * Value: traffic identifier
  9603. * Second DWORD:
  9604. * - SEQ_NUM_START
  9605. * Bits 7:0
  9606. * Purpose:
  9607. * Indicates the starting sequence number of the MPDU in this
  9608. * series of MPDUs that went though PN check.
  9609. * Value:
  9610. * The sequence number for the first MPDU in the sequence.
  9611. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9612. * - SEQ_NUM_END
  9613. * Bits 15:8
  9614. * Purpose:
  9615. * Indicates the ending sequence number of the MPDU in this
  9616. * series of MPDUs that went though PN check.
  9617. * Value:
  9618. * The sequence number one larger then the sequence number of the last
  9619. * MPDU being flushed.
  9620. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9621. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9622. * for invalid PN numbers and are ready to be released for further processing.
  9623. * Not all MPDUs within this range are necessarily valid - the host
  9624. * must check each sequence number within this range to see if the
  9625. * corresponding MPDU is actually present.
  9626. * - PN_IE_COUNT
  9627. * Bits 23:16
  9628. * Purpose:
  9629. * Used to determine the variable number of PN information elements in this
  9630. * message
  9631. *
  9632. * PN information elements:
  9633. * - PN_IE_x-
  9634. * Purpose:
  9635. * Each PN information element contains the sequence number of the MPDU that
  9636. * has failed the target PN check.
  9637. * Value:
  9638. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9639. * that failed the PN check.
  9640. */
  9641. /* first DWORD */
  9642. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9643. #define HTT_RX_PN_IND_PEER_ID_S 8
  9644. #define HTT_RX_PN_IND_TID_M 0xff000000
  9645. #define HTT_RX_PN_IND_TID_S 24
  9646. /* second DWORD */
  9647. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9648. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9649. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9650. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9651. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9652. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9653. #define HTT_RX_PN_IND_BYTES 8
  9654. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9655. do { \
  9656. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9657. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9658. } while (0)
  9659. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9660. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9661. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9662. do { \
  9663. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9664. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9665. } while (0)
  9666. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9667. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9668. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9669. do { \
  9670. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9671. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9672. } while (0)
  9673. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9674. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9675. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9676. do { \
  9677. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9678. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9679. } while (0)
  9680. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9681. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9682. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9683. do { \
  9684. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9685. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9686. } while (0)
  9687. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9688. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9689. /*
  9690. * @brief target -> host rx offload deliver message for LL system
  9691. *
  9692. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9693. *
  9694. * @details
  9695. * In a low latency system this message is sent whenever the offload
  9696. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9697. * The DMA of the actual packets into host memory is done before sending out
  9698. * this message. This message indicates only how many MSDUs to reap. The
  9699. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9700. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9701. * DMA'd by the MAC directly into host memory these packets do not contain
  9702. * the MAC descriptors in the header portion of the packet. Instead they contain
  9703. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9704. * message, the packets are delivered directly to the NW stack without going
  9705. * through the regular reorder buffering and PN checking path since it has
  9706. * already been done in target.
  9707. *
  9708. * |31 24|23 16|15 8|7 0|
  9709. * |-----------------------------------------------------------------------|
  9710. * | Total MSDU count | reserved | msg type |
  9711. * |-----------------------------------------------------------------------|
  9712. *
  9713. * @brief target -> host rx offload deliver message for HL system
  9714. *
  9715. * @details
  9716. * In a high latency system this message is sent whenever the offload manager
  9717. * flushes out the packets it has coalesced in its coalescing buffer. The
  9718. * actual packets are also carried along with this message. When the host
  9719. * receives this message, it is expected to deliver these packets to the NW
  9720. * stack directly instead of routing them through the reorder buffering and
  9721. * PN checking path since it has already been done in target.
  9722. *
  9723. * |31 24|23 16|15 8|7 0|
  9724. * |-----------------------------------------------------------------------|
  9725. * | Total MSDU count | reserved | msg type |
  9726. * |-----------------------------------------------------------------------|
  9727. * | peer ID | MSDU length |
  9728. * |-----------------------------------------------------------------------|
  9729. * | MSDU payload | FW Desc | tid | vdev ID |
  9730. * |-----------------------------------------------------------------------|
  9731. * | MSDU payload contd. |
  9732. * |-----------------------------------------------------------------------|
  9733. * | peer ID | MSDU length |
  9734. * |-----------------------------------------------------------------------|
  9735. * | MSDU payload | FW Desc | tid | vdev ID |
  9736. * |-----------------------------------------------------------------------|
  9737. * | MSDU payload contd. |
  9738. * |-----------------------------------------------------------------------|
  9739. *
  9740. */
  9741. /* first DWORD */
  9742. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9743. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9744. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9745. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9746. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9747. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9748. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9749. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9750. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9751. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9752. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9753. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9754. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9755. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9756. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9757. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9758. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9759. do { \
  9760. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9761. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9762. } while (0)
  9763. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9764. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9765. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9766. do { \
  9767. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9768. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9769. } while (0)
  9770. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9771. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9772. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9773. do { \
  9774. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9775. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9776. } while (0)
  9777. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9778. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9779. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9780. do { \
  9781. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9782. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9783. } while (0)
  9784. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9785. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9786. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9787. do { \
  9788. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9789. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9790. } while (0)
  9791. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9792. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9793. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9794. do { \
  9795. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9796. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9797. } while (0)
  9798. /**
  9799. * @brief target -> host rx peer map/unmap message definition
  9800. *
  9801. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9802. *
  9803. * @details
  9804. * The following diagram shows the format of the rx peer map message sent
  9805. * from the target to the host. This layout assumes the target operates
  9806. * as little-endian.
  9807. *
  9808. * This message always contains a SW peer ID. The main purpose of the
  9809. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9810. * with, so that the host can use that peer ID to determine which peer
  9811. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9812. * other purposes, such as identifying during tx completions which peer
  9813. * the tx frames in question were transmitted to.
  9814. *
  9815. * In certain generations of chips, the peer map message also contains
  9816. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9817. * to identify which peer the frame needs to be forwarded to (i.e. the
  9818. * peer assocated with the Destination MAC Address within the packet),
  9819. * and particularly which vdev needs to transmit the frame (for cases
  9820. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9821. * meaning as AST_INDEX_0.
  9822. * This DA-based peer ID that is provided for certain rx frames
  9823. * (the rx frames that need to be re-transmitted as tx frames)
  9824. * is the ID that the HW uses for referring to the peer in question,
  9825. * rather than the peer ID that the SW+FW use to refer to the peer.
  9826. *
  9827. *
  9828. * |31 24|23 16|15 8|7 0|
  9829. * |-----------------------------------------------------------------------|
  9830. * | SW peer ID | VDEV ID | msg type |
  9831. * |-----------------------------------------------------------------------|
  9832. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9833. * |-----------------------------------------------------------------------|
  9834. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9835. * |-----------------------------------------------------------------------|
  9836. *
  9837. *
  9838. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9839. *
  9840. * The following diagram shows the format of the rx peer unmap message sent
  9841. * from the target to the host.
  9842. *
  9843. * |31 24|23 16|15 8|7 0|
  9844. * |-----------------------------------------------------------------------|
  9845. * | SW peer ID | VDEV ID | msg type |
  9846. * |-----------------------------------------------------------------------|
  9847. *
  9848. * The following field definitions describe the format of the rx peer map
  9849. * and peer unmap messages sent from the target to the host.
  9850. * - MSG_TYPE
  9851. * Bits 7:0
  9852. * Purpose: identifies this as an rx peer map or peer unmap message
  9853. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9854. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9855. * - VDEV_ID
  9856. * Bits 15:8
  9857. * Purpose: Indicates which virtual device the peer is associated
  9858. * with.
  9859. * Value: vdev ID (used in the host to look up the vdev object)
  9860. * - PEER_ID (a.k.a. SW_PEER_ID)
  9861. * Bits 31:16
  9862. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9863. * freeing (unmap)
  9864. * Value: (rx) peer ID
  9865. * - MAC_ADDR_L32 (peer map only)
  9866. * Bits 31:0
  9867. * Purpose: Identifies which peer node the peer ID is for.
  9868. * Value: lower 4 bytes of peer node's MAC address
  9869. * - MAC_ADDR_U16 (peer map only)
  9870. * Bits 15:0
  9871. * Purpose: Identifies which peer node the peer ID is for.
  9872. * Value: upper 2 bytes of peer node's MAC address
  9873. * - HW_PEER_ID
  9874. * Bits 31:16
  9875. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9876. * address, so for rx frames marked for rx --> tx forwarding, the
  9877. * host can determine from the HW peer ID provided as meta-data with
  9878. * the rx frame which peer the frame is supposed to be forwarded to.
  9879. * Value: ID used by the MAC HW to identify the peer
  9880. */
  9881. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9882. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9883. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9884. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9885. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9886. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9887. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9888. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9889. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9890. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9891. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9892. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9893. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9894. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9895. do { \
  9896. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9897. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9898. } while (0)
  9899. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9900. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9901. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9902. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9903. do { \
  9904. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9905. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9906. } while (0)
  9907. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9908. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9909. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9910. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9911. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9912. do { \
  9913. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9914. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9915. } while (0)
  9916. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9917. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9918. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9919. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9920. #define HTT_RX_PEER_MAP_BYTES 12
  9921. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9922. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9923. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9924. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9925. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9926. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9927. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9928. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9929. #define HTT_RX_PEER_UNMAP_BYTES 4
  9930. /**
  9931. * @brief target -> host rx peer map V2 message definition
  9932. *
  9933. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9934. *
  9935. * @details
  9936. * The following diagram shows the format of the rx peer map v2 message sent
  9937. * from the target to the host. This layout assumes the target operates
  9938. * as little-endian.
  9939. *
  9940. * This message always contains a SW peer ID. The main purpose of the
  9941. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9942. * with, so that the host can use that peer ID to determine which peer
  9943. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9944. * other purposes, such as identifying during tx completions which peer
  9945. * the tx frames in question were transmitted to.
  9946. *
  9947. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9948. * is used during rx --> tx frame forwarding to identify which peer the
  9949. * frame needs to be forwarded to (i.e. the peer assocated with the
  9950. * Destination MAC Address within the packet), and particularly which vdev
  9951. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9952. * This DA-based peer ID that is provided for certain rx frames
  9953. * (the rx frames that need to be re-transmitted as tx frames)
  9954. * is the ID that the HW uses for referring to the peer in question,
  9955. * rather than the peer ID that the SW+FW use to refer to the peer.
  9956. *
  9957. * The HW peer id here is the same meaning as AST_INDEX_0.
  9958. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9959. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9960. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9961. * AST is valid.
  9962. *
  9963. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9964. * |-------------------------------------------------------------------------|
  9965. * | SW peer ID | VDEV ID | msg type |
  9966. * |-------------------------------------------------------------------------|
  9967. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9968. * |-------------------------------------------------------------------------|
  9969. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9970. * |-------------------------------------------------------------------------|
  9971. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9972. * |-------------------------------------------------------------------------|
  9973. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9974. * |-------------------------------------------------------------------------|
  9975. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9976. * |-------------------------------------------------------------------------|
  9977. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9978. * |-------------------------------------------------------------------------|
  9979. * | Reserved_2 |
  9980. * |-------------------------------------------------------------------------|
  9981. * Where:
  9982. * NH = Next Hop
  9983. * ASTVM = AST valid mask
  9984. * OA = on-chip AST valid bit
  9985. * ASTFM = AST flow mask
  9986. *
  9987. * The following field definitions describe the format of the rx peer map v2
  9988. * messages sent from the target to the host.
  9989. * - MSG_TYPE
  9990. * Bits 7:0
  9991. * Purpose: identifies this as an rx peer map v2 message
  9992. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9993. * - VDEV_ID
  9994. * Bits 15:8
  9995. * Purpose: Indicates which virtual device the peer is associated with.
  9996. * Value: vdev ID (used in the host to look up the vdev object)
  9997. * - SW_PEER_ID
  9998. * Bits 31:16
  9999. * Purpose: The peer ID (index) that WAL is allocating
  10000. * Value: (rx) peer ID
  10001. * - MAC_ADDR_L32
  10002. * Bits 31:0
  10003. * Purpose: Identifies which peer node the peer ID is for.
  10004. * Value: lower 4 bytes of peer node's MAC address
  10005. * - MAC_ADDR_U16
  10006. * Bits 15:0
  10007. * Purpose: Identifies which peer node the peer ID is for.
  10008. * Value: upper 2 bytes of peer node's MAC address
  10009. * - HW_PEER_ID / AST_INDEX_0
  10010. * Bits 31:16
  10011. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10012. * address, so for rx frames marked for rx --> tx forwarding, the
  10013. * host can determine from the HW peer ID provided as meta-data with
  10014. * the rx frame which peer the frame is supposed to be forwarded to.
  10015. * Value: ID used by the MAC HW to identify the peer
  10016. * - AST_HASH_VALUE
  10017. * Bits 15:0
  10018. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10019. * override feature.
  10020. * - NEXT_HOP
  10021. * Bit 16
  10022. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10023. * (Wireless Distribution System).
  10024. * - AST_VALID_MASK
  10025. * Bits 19:17
  10026. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10027. * - ONCHIP_AST_VALID_FLAG
  10028. * Bit 20
  10029. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10030. * is valid.
  10031. * - AST_INDEX_1
  10032. * Bits 15:0
  10033. * Purpose: indicate the second AST index for this peer
  10034. * - AST_0_FLOW_MASK
  10035. * Bits 19:16
  10036. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10037. * - AST_1_FLOW_MASK
  10038. * Bits 23:20
  10039. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10040. * - AST_2_FLOW_MASK
  10041. * Bits 27:24
  10042. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10043. * - AST_3_FLOW_MASK
  10044. * Bits 31:28
  10045. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10046. * - AST_INDEX_2
  10047. * Bits 15:0
  10048. * Purpose: indicate the third AST index for this peer
  10049. * - TID_VALID_HI_PRI
  10050. * Bits 23:16
  10051. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10052. * - TID_VALID_LOW_PRI
  10053. * Bits 31:24
  10054. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10055. * - AST_INDEX_3
  10056. * Bits 15:0
  10057. * Purpose: indicate the fourth AST index for this peer
  10058. * - ONCHIP_AST_IDX / RESERVED
  10059. * Bits 31:16
  10060. * Purpose: This field is valid only when split AST feature is enabled.
  10061. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10062. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10063. * address, this ast_idx is used for LMAC modules for RXPCU.
  10064. * Value: ID used by the LMAC HW to identify the peer
  10065. */
  10066. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10067. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10068. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10069. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10070. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10071. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10072. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10073. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10074. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10075. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10076. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10077. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10078. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10079. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10080. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10081. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10082. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10083. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10084. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10085. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10086. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10087. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10088. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10089. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10090. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10091. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10092. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10093. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10094. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10095. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10096. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10097. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10098. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10099. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10100. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10101. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10102. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10103. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10104. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10105. do { \
  10106. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10107. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10108. } while (0)
  10109. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10110. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10111. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10112. do { \
  10113. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10114. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10115. } while (0)
  10116. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10117. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10118. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10119. do { \
  10120. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10121. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10122. } while (0)
  10123. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10124. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10125. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10126. do { \
  10127. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10128. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10129. } while (0)
  10130. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10131. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10132. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10133. do { \
  10134. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10135. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10136. } while (0)
  10137. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10138. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10139. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10140. do { \
  10141. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10142. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10143. } while (0)
  10144. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10145. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10146. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10147. do { \
  10148. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10149. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10150. } while (0)
  10151. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10152. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10153. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10154. do { \
  10155. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10156. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10157. } while (0)
  10158. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10159. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10160. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10161. do { \
  10162. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10163. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10164. } while (0)
  10165. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10166. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10167. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10168. do { \
  10169. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10170. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10171. } while (0)
  10172. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10173. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10174. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10175. do { \
  10176. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10177. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10178. } while (0)
  10179. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10180. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10181. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10182. do { \
  10183. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10184. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10185. } while (0)
  10186. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10187. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10188. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10189. do { \
  10190. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10191. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10192. } while (0)
  10193. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10194. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10195. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10196. do { \
  10197. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10198. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10199. } while (0)
  10200. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10201. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10202. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10203. do { \
  10204. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10205. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10206. } while (0)
  10207. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10208. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10209. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10210. do { \
  10211. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10212. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10213. } while (0)
  10214. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10215. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10216. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10217. do { \
  10218. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10219. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10220. } while (0)
  10221. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10222. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10223. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10224. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10225. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10226. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10227. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10228. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10229. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10230. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10231. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10232. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10233. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10234. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10235. /**
  10236. * @brief target -> host rx peer map V3 message definition
  10237. *
  10238. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10239. *
  10240. * @details
  10241. * The following diagram shows the format of the rx peer map v3 message sent
  10242. * from the target to the host.
  10243. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10244. * This layout assumes the target operates as little-endian.
  10245. *
  10246. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10247. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10248. * | SW peer ID | VDEV ID | msg type |
  10249. * |-----------------+--------------------+-----------------+-----------------|
  10250. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10251. * |-----------------+--------------------+-----------------+-----------------|
  10252. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10253. * |-----------------+--------+-----------+-----------------+-----------------|
  10254. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10255. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10256. * | (8bits) | | (4bits) | |
  10257. * |-----------------+--------+--+--+--+--------------------------------------|
  10258. * | RESERVED |E |O | | |
  10259. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10260. * | |V |V | | |
  10261. * |-----------------+--------------------+-----------------------------------|
  10262. * | HTT_MSDU_IDX_ | RESERVED | |
  10263. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10264. * | (8bits) | | |
  10265. * |-----------------+--------------------+-----------------------------------|
  10266. * | Reserved_2 |
  10267. * |--------------------------------------------------------------------------|
  10268. * | Reserved_3 |
  10269. * |--------------------------------------------------------------------------|
  10270. *
  10271. * Where:
  10272. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10273. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10274. * NH = Next Hop
  10275. * The following field definitions describe the format of the rx peer map v3
  10276. * messages sent from the target to the host.
  10277. * - MSG_TYPE
  10278. * Bits 7:0
  10279. * Purpose: identifies this as a peer map v3 message
  10280. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10281. * - VDEV_ID
  10282. * Bits 15:8
  10283. * Purpose: Indicates which virtual device the peer is associated with.
  10284. * - SW_PEER_ID
  10285. * Bits 31:16
  10286. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10287. * - MAC_ADDR_L32
  10288. * Bits 31:0
  10289. * Purpose: Identifies which peer node the peer ID is for.
  10290. * Value: lower 4 bytes of peer node's MAC address
  10291. * - MAC_ADDR_U16
  10292. * Bits 15:0
  10293. * Purpose: Identifies which peer node the peer ID is for.
  10294. * Value: upper 2 bytes of peer node's MAC address
  10295. * - MULTICAST_SW_PEER_ID
  10296. * Bits 31:16
  10297. * Purpose: The multicast peer ID (index)
  10298. * Value: set to HTT_INVALID_PEER if not valid
  10299. * - HW_PEER_ID / AST_INDEX
  10300. * Bits 15:0
  10301. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10302. * address, so for rx frames marked for rx --> tx forwarding, the
  10303. * host can determine from the HW peer ID provided as meta-data with
  10304. * the rx frame which peer the frame is supposed to be forwarded to.
  10305. * - CACHE_SET_NUM
  10306. * Bits 19:16
  10307. * Purpose: Cache Set Number for AST_INDEX
  10308. * Cache set number that should be used to cache the index based
  10309. * search results, for address and flow search.
  10310. * This value should be equal to LSB 4 bits of the hash value
  10311. * of match data, in case of search index points to an entry which
  10312. * may be used in content based search also. The value can be
  10313. * anything when the entry pointed by search index will not be
  10314. * used for content based search.
  10315. * - HTT_MSDU_IDX_VALID_MASK
  10316. * Bits 31:24
  10317. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10318. * - ONCHIP_AST_IDX / RESERVED
  10319. * Bits 15:0
  10320. * Purpose: This field is valid only when split AST feature is enabled.
  10321. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10322. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10323. * address, this ast_idx is used for LMAC modules for RXPCU.
  10324. * - NEXT_HOP
  10325. * Bits 16
  10326. * Purpose: Flag indicates next_hop AST entry used for WDS
  10327. * (Wireless Distribution System).
  10328. * - ONCHIP_AST_VALID
  10329. * Bits 17
  10330. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10331. * - EXT_AST_VALID
  10332. * Bits 18
  10333. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10334. * - EXT_AST_INDEX
  10335. * Bits 15:0
  10336. * Purpose: This field describes Extended AST index
  10337. * Valid if EXT_AST_VALID flag set
  10338. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10339. * Bits 31:24
  10340. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10341. */
  10342. /* dword 0 */
  10343. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10344. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10345. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10346. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10347. /* dword 1 */
  10348. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10349. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10350. /* dword 2 */
  10351. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10352. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10353. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10354. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10355. /* dword 3 */
  10356. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10357. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10358. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10359. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10360. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10361. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10362. /* dword 4 */
  10363. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10364. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10365. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10366. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10367. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10368. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10369. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10370. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10371. /* dword 5 */
  10372. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10373. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10374. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10375. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10376. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10377. do { \
  10378. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10379. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10380. } while (0)
  10381. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10382. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10383. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10384. do { \
  10385. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10386. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10387. } while (0)
  10388. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10389. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10390. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10391. do { \
  10392. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10393. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10394. } while (0)
  10395. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10396. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10397. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10398. do { \
  10399. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10400. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10401. } while (0)
  10402. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10403. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10404. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10405. do { \
  10406. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10407. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10408. } while (0)
  10409. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10410. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10411. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10412. do { \
  10413. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10414. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10415. } while (0)
  10416. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10417. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10418. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10419. do { \
  10420. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10421. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10422. } while (0)
  10423. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10424. (((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)
  10425. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10426. do { \
  10427. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10428. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10429. } while (0)
  10430. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10431. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10432. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10433. do { \
  10434. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10435. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10436. } while (0)
  10437. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10438. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10439. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10440. do { \
  10441. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10442. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10443. } while (0)
  10444. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10445. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10446. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10447. do { \
  10448. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10449. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10450. } while (0)
  10451. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10452. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10453. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10454. do { \
  10455. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10456. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10457. } while (0)
  10458. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10459. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10460. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10461. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10462. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10463. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10464. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10465. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10466. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10467. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10468. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10469. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10470. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10471. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10472. /**
  10473. * @brief target -> host rx peer unmap V2 message definition
  10474. *
  10475. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10476. *
  10477. * The following diagram shows the format of the rx peer unmap message sent
  10478. * from the target to the host.
  10479. *
  10480. * |31 24|23 16|15 8|7 0|
  10481. * |-----------------------------------------------------------------------|
  10482. * | SW peer ID | VDEV ID | msg type |
  10483. * |-----------------------------------------------------------------------|
  10484. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10485. * |-----------------------------------------------------------------------|
  10486. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10487. * |-----------------------------------------------------------------------|
  10488. * | Peer Delete Duration |
  10489. * |-----------------------------------------------------------------------|
  10490. * | Reserved_0 | WDS Free Count |
  10491. * |-----------------------------------------------------------------------|
  10492. * | Reserved_1 |
  10493. * |-----------------------------------------------------------------------|
  10494. * | Reserved_2 |
  10495. * |-----------------------------------------------------------------------|
  10496. *
  10497. *
  10498. * The following field definitions describe the format of the rx peer unmap
  10499. * messages sent from the target to the host.
  10500. * - MSG_TYPE
  10501. * Bits 7:0
  10502. * Purpose: identifies this as an rx peer unmap v2 message
  10503. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10504. * - VDEV_ID
  10505. * Bits 15:8
  10506. * Purpose: Indicates which virtual device the peer is associated
  10507. * with.
  10508. * Value: vdev ID (used in the host to look up the vdev object)
  10509. * - SW_PEER_ID
  10510. * Bits 31:16
  10511. * Purpose: The peer ID (index) that WAL is freeing
  10512. * Value: (rx) peer ID
  10513. * - MAC_ADDR_L32
  10514. * Bits 31:0
  10515. * Purpose: Identifies which peer node the peer ID is for.
  10516. * Value: lower 4 bytes of peer node's MAC address
  10517. * - MAC_ADDR_U16
  10518. * Bits 15:0
  10519. * Purpose: Identifies which peer node the peer ID is for.
  10520. * Value: upper 2 bytes of peer node's MAC address
  10521. * - NEXT_HOP
  10522. * Bits 16
  10523. * Purpose: Bit indicates next_hop AST entry used for WDS
  10524. * (Wireless Distribution System).
  10525. * - PEER_DELETE_DURATION
  10526. * Bits 31:0
  10527. * Purpose: Time taken to delete peer, in msec,
  10528. * Used for monitoring / debugging PEER delete response delay
  10529. * - PEER_WDS_FREE_COUNT
  10530. * Bits 15:0
  10531. * Purpose: Count of WDS entries deleted associated to peer deleted
  10532. */
  10533. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10534. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10535. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10536. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10537. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10538. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10539. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10540. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10541. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10542. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10543. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10544. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10545. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10546. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10547. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10548. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10549. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10550. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10551. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10552. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10553. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10554. do { \
  10555. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10556. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10557. } while (0)
  10558. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10559. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10560. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10561. do { \
  10562. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10563. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10564. } while (0)
  10565. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10566. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10567. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10568. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10569. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10570. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10571. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10572. /**
  10573. * @brief target -> host rx peer mlo map message definition
  10574. *
  10575. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10576. *
  10577. * @details
  10578. * The following diagram shows the format of the rx mlo peer map message sent
  10579. * from the target to the host. This layout assumes the target operates
  10580. * as little-endian.
  10581. *
  10582. * MCC:
  10583. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10584. *
  10585. * WIN:
  10586. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10587. * It will be sent on the Assoc Link.
  10588. *
  10589. * This message always contains a MLO peer ID. The main purpose of the
  10590. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10591. * with, so that the host can use that MLO peer ID to determine which peer
  10592. * transmitted the rx frame.
  10593. *
  10594. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10595. * |-------------------------------------------------------------------------|
  10596. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10597. * |-------------------------------------------------------------------------|
  10598. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10599. * |-------------------------------------------------------------------------|
  10600. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10601. * |-------------------------------------------------------------------------|
  10602. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10603. * |-------------------------------------------------------------------------|
  10604. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10605. * |-------------------------------------------------------------------------|
  10606. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10607. * |-------------------------------------------------------------------------|
  10608. * |RSVD |
  10609. * |-------------------------------------------------------------------------|
  10610. * |RSVD |
  10611. * |-------------------------------------------------------------------------|
  10612. * | htt_tlv_hdr_t |
  10613. * |-------------------------------------------------------------------------|
  10614. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10615. * |-------------------------------------------------------------------------|
  10616. * | htt_tlv_hdr_t |
  10617. * |-------------------------------------------------------------------------|
  10618. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10619. * |-------------------------------------------------------------------------|
  10620. * | htt_tlv_hdr_t |
  10621. * |-------------------------------------------------------------------------|
  10622. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10623. * |-------------------------------------------------------------------------|
  10624. *
  10625. * Where:
  10626. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10627. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10628. * V (valid) - 1 Bit Bit17
  10629. * CHIPID - 3 Bits
  10630. * TIDMASK - 8 Bits
  10631. * CACHE_SET_NUM - 8 Bits
  10632. *
  10633. * The following field definitions describe the format of the rx MLO peer map
  10634. * messages sent from the target to the host.
  10635. * - MSG_TYPE
  10636. * Bits 7:0
  10637. * Purpose: identifies this as an rx mlo peer map message
  10638. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10639. *
  10640. * - MLO_PEER_ID
  10641. * Bits 23:8
  10642. * Purpose: The MLO peer ID (index).
  10643. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10644. * Value: MLO peer ID
  10645. *
  10646. * - NUMLINK
  10647. * Bits: 26:24 (3Bits)
  10648. * Purpose: Indicate the max number of logical links supported per client.
  10649. * Value: number of logical links
  10650. *
  10651. * - PRC
  10652. * Bits: 29:27 (3Bits)
  10653. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10654. * if there is migration of the primary chip.
  10655. * Value: Primary REO CHIPID
  10656. *
  10657. * - MAC_ADDR_L32
  10658. * Bits 31:0
  10659. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10660. * Value: lower 4 bytes of peer node's MAC address
  10661. *
  10662. * - MAC_ADDR_U16
  10663. * Bits 15:0
  10664. * Purpose: Identifies which peer node the peer ID is for.
  10665. * Value: upper 2 bytes of peer node's MAC address
  10666. *
  10667. * - PRIMARY_TCL_AST_IDX
  10668. * Bits 15:0
  10669. * Purpose: Primary TCL AST index for this peer.
  10670. *
  10671. * - V
  10672. * 1 Bit Position 16
  10673. * Purpose: If the ast idx is valid.
  10674. *
  10675. * - CHIPID
  10676. * Bits 19:17
  10677. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10678. *
  10679. * - TIDMASK
  10680. * Bits 27:20
  10681. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10682. *
  10683. * - CACHE_SET_NUM
  10684. * Bits 31:28
  10685. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10686. * Cache set number that should be used to cache the index based
  10687. * search results, for address and flow search.
  10688. * This value should be equal to LSB four bits of the hash value
  10689. * of match data, in case of search index points to an entry which
  10690. * may be used in content based search also. The value can be
  10691. * anything when the entry pointed by search index will not be
  10692. * used for content based search.
  10693. *
  10694. * - htt_tlv_hdr_t
  10695. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10696. *
  10697. * Bits 11:0
  10698. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10699. *
  10700. * Bits 23:12
  10701. * Purpose: Length, Length of the value that follows the header
  10702. *
  10703. * Bits 31:28
  10704. * Purpose: Reserved.
  10705. *
  10706. *
  10707. * - SW_PEER_ID
  10708. * Bits 15:0
  10709. * Purpose: The peer ID (index) that WAL is allocating
  10710. * Value: (rx) peer ID
  10711. *
  10712. * - VDEV_ID
  10713. * Bits 23:16
  10714. * Purpose: Indicates which virtual device the peer is associated with.
  10715. * Value: vdev ID (used in the host to look up the vdev object)
  10716. *
  10717. * - CHIPID
  10718. * Bits 26:24
  10719. * Purpose: Indicates which Chip id the peer is associated with.
  10720. * Value: chip ID (Provided by Host as part of QMI exchange)
  10721. */
  10722. typedef enum {
  10723. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10724. } MLO_PEER_MAP_TLV_TAG_ID;
  10725. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10726. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10727. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10728. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10729. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10730. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10731. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10732. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10733. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10734. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10735. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10736. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10737. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10738. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10739. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10740. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10741. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10742. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10743. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10744. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10745. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10746. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10747. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10748. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10749. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10750. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10751. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10752. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10753. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10754. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10755. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10756. do { \
  10757. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10758. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10759. } while (0)
  10760. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10761. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10762. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10763. do { \
  10764. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10765. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10766. } while (0)
  10767. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10768. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10769. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10770. do { \
  10771. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10772. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10773. } while (0)
  10774. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10775. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10776. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10777. do { \
  10778. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10779. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10780. } while (0)
  10781. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10782. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10783. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10784. do { \
  10785. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10786. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10787. } while (0)
  10788. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10789. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10790. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10791. do { \
  10792. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10793. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10794. } while (0)
  10795. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10796. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10797. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10798. do { \
  10799. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10800. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10801. } while (0)
  10802. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10803. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10804. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10805. do { \
  10806. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10807. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10808. } while (0)
  10809. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10810. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10811. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10812. do { \
  10813. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10814. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10815. } while (0)
  10816. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10817. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10818. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10819. do { \
  10820. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10821. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10822. } while (0)
  10823. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10824. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10825. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10826. do { \
  10827. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10828. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10829. } while (0)
  10830. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10831. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10832. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10833. do { \
  10834. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10835. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10836. } while (0)
  10837. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10838. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10839. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10840. do { \
  10841. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10842. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10843. } while (0)
  10844. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10845. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10846. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10847. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10848. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10849. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10850. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10851. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10852. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10853. *
  10854. * The following diagram shows the format of the rx mlo peer unmap message sent
  10855. * from the target to the host.
  10856. *
  10857. * |31 24|23 16|15 8|7 0|
  10858. * |-----------------------------------------------------------------------|
  10859. * | RSVD_24_31 | MLO peer ID | msg type |
  10860. * |-----------------------------------------------------------------------|
  10861. */
  10862. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10863. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10864. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10865. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10866. /**
  10867. * @brief target -> host message specifying security parameters
  10868. *
  10869. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10870. *
  10871. * @details
  10872. * The following diagram shows the format of the security specification
  10873. * message sent from the target to the host.
  10874. * This security specification message tells the host whether a PN check is
  10875. * necessary on rx data frames, and if so, how large the PN counter is.
  10876. * This message also tells the host about the security processing to apply
  10877. * to defragmented rx frames - specifically, whether a Message Integrity
  10878. * Check is required, and the Michael key to use.
  10879. *
  10880. * |31 24|23 16|15|14 8|7 0|
  10881. * |-----------------------------------------------------------------------|
  10882. * | peer ID | U| security type | msg type |
  10883. * |-----------------------------------------------------------------------|
  10884. * | Michael Key K0 |
  10885. * |-----------------------------------------------------------------------|
  10886. * | Michael Key K1 |
  10887. * |-----------------------------------------------------------------------|
  10888. * | WAPI RSC Low0 |
  10889. * |-----------------------------------------------------------------------|
  10890. * | WAPI RSC Low1 |
  10891. * |-----------------------------------------------------------------------|
  10892. * | WAPI RSC Hi0 |
  10893. * |-----------------------------------------------------------------------|
  10894. * | WAPI RSC Hi1 |
  10895. * |-----------------------------------------------------------------------|
  10896. *
  10897. * The following field definitions describe the format of the security
  10898. * indication message sent from the target to the host.
  10899. * - MSG_TYPE
  10900. * Bits 7:0
  10901. * Purpose: identifies this as a security specification message
  10902. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10903. * - SEC_TYPE
  10904. * Bits 14:8
  10905. * Purpose: specifies which type of security applies to the peer
  10906. * Value: htt_sec_type enum value
  10907. * - UNICAST
  10908. * Bit 15
  10909. * Purpose: whether this security is applied to unicast or multicast data
  10910. * Value: 1 -> unicast, 0 -> multicast
  10911. * - PEER_ID
  10912. * Bits 31:16
  10913. * Purpose: The ID number for the peer the security specification is for
  10914. * Value: peer ID
  10915. * - MICHAEL_KEY_K0
  10916. * Bits 31:0
  10917. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10918. * Value: Michael Key K0 (if security type is TKIP)
  10919. * - MICHAEL_KEY_K1
  10920. * Bits 31:0
  10921. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10922. * Value: Michael Key K1 (if security type is TKIP)
  10923. * - WAPI_RSC_LOW0
  10924. * Bits 31:0
  10925. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10926. * Value: WAPI RSC Low0 (if security type is WAPI)
  10927. * - WAPI_RSC_LOW1
  10928. * Bits 31:0
  10929. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10930. * Value: WAPI RSC Low1 (if security type is WAPI)
  10931. * - WAPI_RSC_HI0
  10932. * Bits 31:0
  10933. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10934. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10935. * - WAPI_RSC_HI1
  10936. * Bits 31:0
  10937. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10938. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10939. */
  10940. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10941. #define HTT_SEC_IND_SEC_TYPE_S 8
  10942. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10943. #define HTT_SEC_IND_UNICAST_S 15
  10944. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10945. #define HTT_SEC_IND_PEER_ID_S 16
  10946. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10947. do { \
  10948. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10949. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10950. } while (0)
  10951. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10952. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10953. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10954. do { \
  10955. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10956. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10957. } while (0)
  10958. #define HTT_SEC_IND_UNICAST_GET(word) \
  10959. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10960. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10961. do { \
  10962. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10963. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10964. } while (0)
  10965. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10966. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10967. #define HTT_SEC_IND_BYTES 28
  10968. /**
  10969. * @brief target -> host rx ADDBA / DELBA message definitions
  10970. *
  10971. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10972. *
  10973. * @details
  10974. * The following diagram shows the format of the rx ADDBA message sent
  10975. * from the target to the host:
  10976. *
  10977. * |31 20|19 16|15 8|7 0|
  10978. * |---------------------------------------------------------------------|
  10979. * | peer ID | TID | window size | msg type |
  10980. * |---------------------------------------------------------------------|
  10981. *
  10982. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10983. *
  10984. * The following diagram shows the format of the rx DELBA message sent
  10985. * from the target to the host:
  10986. *
  10987. * |31 20|19 16|15 10|9 8|7 0|
  10988. * |---------------------------------------------------------------------|
  10989. * | peer ID | TID | window size | IR| msg type |
  10990. * |---------------------------------------------------------------------|
  10991. *
  10992. * The following field definitions describe the format of the rx ADDBA
  10993. * and DELBA messages sent from the target to the host.
  10994. * - MSG_TYPE
  10995. * Bits 7:0
  10996. * Purpose: identifies this as an rx ADDBA or DELBA message
  10997. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10998. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10999. * - IR (initiator / recipient)
  11000. * Bits 9:8 (DELBA only)
  11001. * Purpose: specify whether the DELBA handshake was initiated by the
  11002. * local STA/AP, or by the peer STA/AP
  11003. * Value:
  11004. * 0 - unspecified
  11005. * 1 - initiator (a.k.a. originator)
  11006. * 2 - recipient (a.k.a. responder)
  11007. * 3 - unused / reserved
  11008. * - WIN_SIZE
  11009. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11010. * Purpose: Specifies the length of the block ack window (max = 64).
  11011. * Value:
  11012. * block ack window length specified by the received ADDBA/DELBA
  11013. * management message.
  11014. * - TID
  11015. * Bits 19:16
  11016. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11017. * Value:
  11018. * TID specified by the received ADDBA or DELBA management message.
  11019. * - PEER_ID
  11020. * Bits 31:20
  11021. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11022. * Value:
  11023. * ID (hash value) used by the host for fast, direct lookup of
  11024. * host SW peer info, including rx reorder states.
  11025. */
  11026. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11027. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11028. #define HTT_RX_ADDBA_TID_M 0xf0000
  11029. #define HTT_RX_ADDBA_TID_S 16
  11030. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11031. #define HTT_RX_ADDBA_PEER_ID_S 20
  11032. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11033. do { \
  11034. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11035. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11036. } while (0)
  11037. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11038. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11039. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11040. do { \
  11041. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11042. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11043. } while (0)
  11044. #define HTT_RX_ADDBA_TID_GET(word) \
  11045. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11046. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11047. do { \
  11048. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11049. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11050. } while (0)
  11051. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11052. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11053. #define HTT_RX_ADDBA_BYTES 4
  11054. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11055. #define HTT_RX_DELBA_INITIATOR_S 8
  11056. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11057. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11058. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11059. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11060. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11061. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11062. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11063. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11064. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11065. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11066. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11067. do { \
  11068. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11069. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11070. } while (0)
  11071. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11072. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11073. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11074. do { \
  11075. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11076. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11077. } while (0)
  11078. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11079. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11080. #define HTT_RX_DELBA_BYTES 4
  11081. /**
  11082. * @brief tx queue group information element definition
  11083. *
  11084. * @details
  11085. * The following diagram shows the format of the tx queue group
  11086. * information element, which can be included in target --> host
  11087. * messages to specify the number of tx "credits" (tx descriptors
  11088. * for LL, or tx buffers for HL) available to a particular group
  11089. * of host-side tx queues, and which host-side tx queues belong to
  11090. * the group.
  11091. *
  11092. * |31|30 24|23 16|15|14|13 0|
  11093. * |------------------------------------------------------------------------|
  11094. * | X| reserved | tx queue grp ID | A| S| credit count |
  11095. * |------------------------------------------------------------------------|
  11096. * | vdev ID mask | AC mask |
  11097. * |------------------------------------------------------------------------|
  11098. *
  11099. * The following definitions describe the fields within the tx queue group
  11100. * information element:
  11101. * - credit_count
  11102. * Bits 13:1
  11103. * Purpose: specify how many tx credits are available to the tx queue group
  11104. * Value: An absolute or relative, positive or negative credit value
  11105. * The 'A' bit specifies whether the value is absolute or relative.
  11106. * The 'S' bit specifies whether the value is positive or negative.
  11107. * A negative value can only be relative, not absolute.
  11108. * An absolute value replaces any prior credit value the host has for
  11109. * the tx queue group in question.
  11110. * A relative value is added to the prior credit value the host has for
  11111. * the tx queue group in question.
  11112. * - sign
  11113. * Bit 14
  11114. * Purpose: specify whether the credit count is positive or negative
  11115. * Value: 0 -> positive, 1 -> negative
  11116. * - absolute
  11117. * Bit 15
  11118. * Purpose: specify whether the credit count is absolute or relative
  11119. * Value: 0 -> relative, 1 -> absolute
  11120. * - txq_group_id
  11121. * Bits 23:16
  11122. * Purpose: indicate which tx queue group's credit and/or membership are
  11123. * being specified
  11124. * Value: 0 to max_tx_queue_groups-1
  11125. * - reserved
  11126. * Bits 30:16
  11127. * Value: 0x0
  11128. * - eXtension
  11129. * Bit 31
  11130. * Purpose: specify whether another tx queue group info element follows
  11131. * Value: 0 -> no more tx queue group information elements
  11132. * 1 -> another tx queue group information element immediately follows
  11133. * - ac_mask
  11134. * Bits 15:0
  11135. * Purpose: specify which Access Categories belong to the tx queue group
  11136. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11137. * the tx queue group.
  11138. * The AC bit-mask values are obtained by left-shifting by the
  11139. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11140. * - vdev_id_mask
  11141. * Bits 31:16
  11142. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11143. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11144. * belong to the tx queue group.
  11145. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11146. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11147. */
  11148. PREPACK struct htt_txq_group {
  11149. A_UINT32
  11150. credit_count: 14,
  11151. sign: 1,
  11152. absolute: 1,
  11153. tx_queue_group_id: 8,
  11154. reserved0: 7,
  11155. extension: 1;
  11156. A_UINT32
  11157. ac_mask: 16,
  11158. vdev_id_mask: 16;
  11159. } POSTPACK;
  11160. /* first word */
  11161. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11162. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11163. #define HTT_TXQ_GROUP_SIGN_S 14
  11164. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11165. #define HTT_TXQ_GROUP_ABS_S 15
  11166. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11167. #define HTT_TXQ_GROUP_ID_S 16
  11168. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11169. #define HTT_TXQ_GROUP_EXT_S 31
  11170. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11171. /* second word */
  11172. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11173. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11174. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11175. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11176. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11179. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11180. } while (0)
  11181. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11182. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11183. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11184. do { \
  11185. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11186. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11187. } while (0)
  11188. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11189. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11190. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11191. do { \
  11192. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11193. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11194. } while (0)
  11195. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11196. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11197. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11198. do { \
  11199. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11200. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11201. } while (0)
  11202. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11203. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11204. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11205. do { \
  11206. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11207. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11208. } while (0)
  11209. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11210. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11211. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11212. do { \
  11213. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11214. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11215. } while (0)
  11216. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11217. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11218. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11219. do { \
  11220. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11221. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11222. } while (0)
  11223. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11224. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11225. /**
  11226. * @brief target -> host TX completion indication message definition
  11227. *
  11228. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11229. *
  11230. * @details
  11231. * The following diagram shows the format of the TX completion indication sent
  11232. * from the target to the host
  11233. *
  11234. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11235. * |-------------------------------------------------------------------|
  11236. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11237. * |-------------------------------------------------------------------|
  11238. * payload:| MSDU1 ID | MSDU0 ID |
  11239. * |-------------------------------------------------------------------|
  11240. * : MSDU3 ID | MSDU2 ID :
  11241. * |-------------------------------------------------------------------|
  11242. * | struct htt_tx_compl_ind_append_retries |
  11243. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11244. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11245. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11246. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11247. * |-------------------------------------------------------------------|
  11248. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11249. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11250. * | MSDU0 tx_tsf64_low |
  11251. * |-------------------------------------------------------------------|
  11252. * | MSDU0 tx_tsf64_high |
  11253. * |-------------------------------------------------------------------|
  11254. * | MSDU1 tx_tsf64_low |
  11255. * |-------------------------------------------------------------------|
  11256. * | MSDU1 tx_tsf64_high |
  11257. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11258. * | phy_timestamp |
  11259. * |-------------------------------------------------------------------|
  11260. * | rate specs (see below) |
  11261. * |-------------------------------------------------------------------|
  11262. * | seqctrl | framectrl |
  11263. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11264. * Where:
  11265. * A0 = append (a.k.a. append0)
  11266. * A1 = append1
  11267. * TP = MSDU tx power presence
  11268. * A2 = append2
  11269. * A3 = append3
  11270. * A4 = append4
  11271. *
  11272. * The following field definitions describe the format of the TX completion
  11273. * indication sent from the target to the host
  11274. * Header fields:
  11275. * - msg_type
  11276. * Bits 7:0
  11277. * Purpose: identifies this as HTT TX completion indication
  11278. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11279. * - status
  11280. * Bits 10:8
  11281. * Purpose: the TX completion status of payload fragmentations descriptors
  11282. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11283. * - tid
  11284. * Bits 14:11
  11285. * Purpose: the tid associated with those fragmentation descriptors. It is
  11286. * valid or not, depending on the tid_invalid bit.
  11287. * Value: 0 to 15
  11288. * - tid_invalid
  11289. * Bits 15:15
  11290. * Purpose: this bit indicates whether the tid field is valid or not
  11291. * Value: 0 indicates valid; 1 indicates invalid
  11292. * - num
  11293. * Bits 23:16
  11294. * Purpose: the number of payload in this indication
  11295. * Value: 1 to 255
  11296. * - append (a.k.a. append0)
  11297. * Bits 24:24
  11298. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11299. * the number of tx retries for one MSDU at the end of this message
  11300. * Value: 0 indicates no appending; 1 indicates appending
  11301. * - append1
  11302. * Bits 25:25
  11303. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11304. * contains the timestamp info for each TX msdu id in payload.
  11305. * The order of the timestamps matches the order of the MSDU IDs.
  11306. * Note that a big-endian host needs to account for the reordering
  11307. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11308. * conversion) when determining which tx timestamp corresponds to
  11309. * which MSDU ID.
  11310. * Value: 0 indicates no appending; 1 indicates appending
  11311. * - msdu_tx_power_presence
  11312. * Bits 26:26
  11313. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11314. * for each MSDU referenced by the TX_COMPL_IND message.
  11315. * The tx power is reported in 0.5 dBm units.
  11316. * The order of the per-MSDU tx power reports matches the order
  11317. * of the MSDU IDs.
  11318. * Note that a big-endian host needs to account for the reordering
  11319. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11320. * conversion) when determining which Tx Power corresponds to
  11321. * which MSDU ID.
  11322. * Value: 0 indicates MSDU tx power reports are not appended,
  11323. * 1 indicates MSDU tx power reports are appended
  11324. * - append2
  11325. * Bits 27:27
  11326. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11327. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11328. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11329. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11330. * for each MSDU, for convenience.
  11331. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11332. * this append2 bit is set).
  11333. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11334. * dB above the noise floor.
  11335. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11336. * 1 indicates MSDU ACK RSSI values are appended.
  11337. * - append3
  11338. * Bits 28:28
  11339. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11340. * contains the tx tsf info based on wlan global TSF for
  11341. * each TX msdu id in payload.
  11342. * The order of the tx tsf matches the order of the MSDU IDs.
  11343. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11344. * values to indicate the the lower 32 bits and higher 32 bits of
  11345. * the tx tsf.
  11346. * The tx_tsf64 here represents the time MSDU was acked and the
  11347. * tx_tsf64 has microseconds units.
  11348. * Value: 0 indicates no appending; 1 indicates appending
  11349. * - append4
  11350. * Bits 29:29
  11351. * Purpose: Indicate whether data frame control fields and fields required
  11352. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11353. * message. The order of the this message matches the order of
  11354. * the MSDU IDs.
  11355. * Value: 0 indicates frame control fields and fields required for
  11356. * radio tap header values are not appended,
  11357. * 1 indicates frame control fields and fields required for
  11358. * radio tap header values are appended.
  11359. * Payload fields:
  11360. * - hmsdu_id
  11361. * Bits 15:0
  11362. * Purpose: this ID is used to track the Tx buffer in host
  11363. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11364. */
  11365. PREPACK struct htt_tx_data_hdr_information {
  11366. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11367. A_UINT32 /* word 1 */
  11368. /* preamble:
  11369. * 0-OFDM,
  11370. * 1-CCk,
  11371. * 2-HT,
  11372. * 3-VHT
  11373. */
  11374. preamble: 2, /* [1:0] */
  11375. /* mcs:
  11376. * In case of HT preamble interpret
  11377. * MCS along with NSS.
  11378. * Valid values for HT are 0 to 7.
  11379. * HT mcs 0 with NSS 2 is mcs 8.
  11380. * Valid values for VHT are 0 to 9.
  11381. */
  11382. mcs: 4, /* [5:2] */
  11383. /* rate:
  11384. * This is applicable only for
  11385. * CCK and OFDM preamble type
  11386. * rate 0: OFDM 48 Mbps,
  11387. * 1: OFDM 24 Mbps,
  11388. * 2: OFDM 12 Mbps
  11389. * 3: OFDM 6 Mbps
  11390. * 4: OFDM 54 Mbps
  11391. * 5: OFDM 36 Mbps
  11392. * 6: OFDM 18 Mbps
  11393. * 7: OFDM 9 Mbps
  11394. * rate 0: CCK 11 Mbps Long
  11395. * 1: CCK 5.5 Mbps Long
  11396. * 2: CCK 2 Mbps Long
  11397. * 3: CCK 1 Mbps Long
  11398. * 4: CCK 11 Mbps Short
  11399. * 5: CCK 5.5 Mbps Short
  11400. * 6: CCK 2 Mbps Short
  11401. */
  11402. rate : 3, /* [ 8: 6] */
  11403. rssi : 8, /* [16: 9] units=dBm */
  11404. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11405. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11406. stbc : 1, /* [22] */
  11407. sgi : 1, /* [23] */
  11408. ldpc : 1, /* [24] */
  11409. beamformed: 1, /* [25] */
  11410. /* tx_retry_cnt:
  11411. * Indicates retry count of data tx frames provided by the host.
  11412. */
  11413. tx_retry_cnt: 6; /* [31:26] */
  11414. A_UINT32 /* word 2 */
  11415. framectrl:16, /* [15: 0] */
  11416. seqno:16; /* [31:16] */
  11417. } POSTPACK;
  11418. #define HTT_TX_COMPL_IND_STATUS_S 8
  11419. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11420. #define HTT_TX_COMPL_IND_TID_S 11
  11421. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11422. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11423. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11424. #define HTT_TX_COMPL_IND_NUM_S 16
  11425. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11426. #define HTT_TX_COMPL_IND_APPEND_S 24
  11427. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11428. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11429. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11430. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11431. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11432. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11433. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11434. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11435. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11436. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11437. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11438. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11439. do { \
  11440. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11441. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11442. } while (0)
  11443. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11444. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11445. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11446. do { \
  11447. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11448. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11449. } while (0)
  11450. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11451. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11452. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11453. do { \
  11454. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11455. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11456. } while (0)
  11457. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11458. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11459. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11460. do { \
  11461. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11462. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11463. } while (0)
  11464. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11465. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11466. HTT_TX_COMPL_IND_TID_INV_S)
  11467. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11468. do { \
  11469. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11470. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11471. } while (0)
  11472. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11473. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11474. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11475. do { \
  11476. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11477. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11478. } while (0)
  11479. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11480. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11481. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11482. do { \
  11483. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11484. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11485. } while (0)
  11486. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11487. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11488. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11489. do { \
  11490. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11491. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11492. } while (0)
  11493. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11494. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11495. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11496. do { \
  11497. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11498. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11499. } while (0)
  11500. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11501. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11502. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11503. do { \
  11504. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11505. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11506. } while (0)
  11507. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11508. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11509. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11510. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11511. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11512. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11513. #define HTT_TX_COMPL_IND_STAT_OK 0
  11514. /* DISCARD:
  11515. * current meaning:
  11516. * MSDUs were queued for transmission but filtered by HW or SW
  11517. * without any over the air attempts
  11518. * legacy meaning (HL Rome):
  11519. * MSDUs were discarded by the target FW without any over the air
  11520. * attempts due to lack of space
  11521. */
  11522. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11523. /* NO_ACK:
  11524. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11525. */
  11526. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11527. /* POSTPONE:
  11528. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11529. * be downloaded again later (in the appropriate order), when they are
  11530. * deliverable.
  11531. */
  11532. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11533. /*
  11534. * The PEER_DEL tx completion status is used for HL cases
  11535. * where the peer the frame is for has been deleted.
  11536. * The host has already discarded its copy of the frame, but
  11537. * it still needs the tx completion to restore its credit.
  11538. */
  11539. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11540. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11541. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11542. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11543. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11544. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11545. PREPACK struct htt_tx_compl_ind_base {
  11546. A_UINT32 hdr;
  11547. A_UINT16 payload[1/*or more*/];
  11548. } POSTPACK;
  11549. PREPACK struct htt_tx_compl_ind_append_retries {
  11550. A_UINT16 msdu_id;
  11551. A_UINT8 tx_retries;
  11552. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11553. 0: this is the last append_retries struct */
  11554. } POSTPACK;
  11555. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11556. A_UINT32 timestamp[1/*or more*/];
  11557. } POSTPACK;
  11558. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11559. A_UINT32 tx_tsf64_low;
  11560. A_UINT32 tx_tsf64_high;
  11561. } POSTPACK;
  11562. /* htt_tx_data_hdr_information payload extension fields: */
  11563. /* DWORD zero */
  11564. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11565. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11566. /* DWORD one */
  11567. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11568. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11569. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11570. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11571. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11572. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11573. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11574. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11575. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11576. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11577. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11578. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11579. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11580. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11581. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11582. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11583. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11584. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11585. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11586. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11587. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11588. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11589. /* DWORD two */
  11590. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11591. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11592. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11593. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11594. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11595. do { \
  11596. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11597. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11598. } while (0)
  11599. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11600. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11601. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11602. do { \
  11603. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11604. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11605. } while (0)
  11606. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11607. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11608. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11609. do { \
  11610. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11611. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11612. } while (0)
  11613. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11614. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11615. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11616. do { \
  11617. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11618. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11619. } while (0)
  11620. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11621. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11622. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11623. do { \
  11624. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11625. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11626. } while (0)
  11627. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11628. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11629. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11630. do { \
  11631. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11632. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11633. } while (0)
  11634. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11635. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11636. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11637. do { \
  11638. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11639. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11640. } while (0)
  11641. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11642. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11643. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11644. do { \
  11645. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11646. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11647. } while (0)
  11648. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11649. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11650. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11651. do { \
  11652. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11653. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11654. } while (0)
  11655. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11656. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11657. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11658. do { \
  11659. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11660. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11661. } while (0)
  11662. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11663. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11664. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11665. do { \
  11666. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11667. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11668. } while (0)
  11669. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11670. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11671. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11672. do { \
  11673. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11674. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11675. } while (0)
  11676. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11677. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11678. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11679. do { \
  11680. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11681. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11682. } while (0)
  11683. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11684. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11685. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11686. do { \
  11687. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11688. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11689. } while (0)
  11690. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11691. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11692. /**
  11693. * @brief target -> host rate-control update indication message
  11694. *
  11695. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11696. *
  11697. * @details
  11698. * The following diagram shows the format of the RC Update message
  11699. * sent from the target to the host, while processing the tx-completion
  11700. * of a transmitted PPDU.
  11701. *
  11702. * |31 24|23 16|15 8|7 0|
  11703. * |-------------------------------------------------------------|
  11704. * | peer ID | vdev ID | msg_type |
  11705. * |-------------------------------------------------------------|
  11706. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11707. * |-------------------------------------------------------------|
  11708. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11709. * |-------------------------------------------------------------|
  11710. * | : |
  11711. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11712. * | : |
  11713. * |-------------------------------------------------------------|
  11714. * | : |
  11715. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11716. * | : |
  11717. * |-------------------------------------------------------------|
  11718. * : :
  11719. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11720. *
  11721. */
  11722. typedef struct {
  11723. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11724. A_UINT32 rate_code_flags;
  11725. A_UINT32 flags; /* Encodes information such as excessive
  11726. retransmission, aggregate, some info
  11727. from .11 frame control,
  11728. STBC, LDPC, (SGI and Tx Chain Mask
  11729. are encoded in ptx_rc->flags field),
  11730. AMPDU truncation (BT/time based etc.),
  11731. RTS/CTS attempt */
  11732. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11733. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11734. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11735. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11736. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11737. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11738. } HTT_RC_TX_DONE_PARAMS;
  11739. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11740. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11741. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11742. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11743. #define HTT_RC_UPDATE_VDEVID_S 8
  11744. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11745. #define HTT_RC_UPDATE_PEERID_S 16
  11746. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11747. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11748. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11749. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11750. do { \
  11751. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11752. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11753. } while (0)
  11754. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11755. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11756. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11757. do { \
  11758. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11759. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11760. } while (0)
  11761. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11762. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11763. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11764. do { \
  11765. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11766. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11767. } while (0)
  11768. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11769. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11770. /**
  11771. * @brief target -> host rx fragment indication message definition
  11772. *
  11773. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11774. *
  11775. * @details
  11776. * The following field definitions describe the format of the rx fragment
  11777. * indication message sent from the target to the host.
  11778. * The rx fragment indication message shares the format of the
  11779. * rx indication message, but not all fields from the rx indication message
  11780. * are relevant to the rx fragment indication message.
  11781. *
  11782. *
  11783. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11784. * |-----------+-------------------+---------------------+-------------|
  11785. * | peer ID | |FV| ext TID | msg type |
  11786. * |-------------------------------------------------------------------|
  11787. * | | flush | flush |
  11788. * | | end | start |
  11789. * | | seq num | seq num |
  11790. * |-------------------------------------------------------------------|
  11791. * | reserved | FW rx desc bytes |
  11792. * |-------------------------------------------------------------------|
  11793. * | | FW MSDU Rx |
  11794. * | | desc B0 |
  11795. * |-------------------------------------------------------------------|
  11796. * Header fields:
  11797. * - MSG_TYPE
  11798. * Bits 7:0
  11799. * Purpose: identifies this as an rx fragment indication message
  11800. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11801. * - EXT_TID
  11802. * Bits 12:8
  11803. * Purpose: identify the traffic ID of the rx data, including
  11804. * special "extended" TID values for multicast, broadcast, and
  11805. * non-QoS data frames
  11806. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11807. * - FLUSH_VALID (FV)
  11808. * Bit 13
  11809. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11810. * is valid
  11811. * Value:
  11812. * 1 -> flush IE is valid and needs to be processed
  11813. * 0 -> flush IE is not valid and should be ignored
  11814. * - PEER_ID
  11815. * Bits 31:16
  11816. * Purpose: Identify, by ID, which peer sent the rx data
  11817. * Value: ID of the peer who sent the rx data
  11818. * - FLUSH_SEQ_NUM_START
  11819. * Bits 5:0
  11820. * Purpose: Indicate the start of a series of MPDUs to flush
  11821. * Not all MPDUs within this series are necessarily valid - the host
  11822. * must check each sequence number within this range to see if the
  11823. * corresponding MPDU is actually present.
  11824. * This field is only valid if the FV bit is set.
  11825. * Value:
  11826. * The sequence number for the first MPDUs to check to flush.
  11827. * The sequence number is masked by 0x3f.
  11828. * - FLUSH_SEQ_NUM_END
  11829. * Bits 11:6
  11830. * Purpose: Indicate the end of a series of MPDUs to flush
  11831. * Value:
  11832. * The sequence number one larger than the sequence number of the
  11833. * last MPDU to check to flush.
  11834. * The sequence number is masked by 0x3f.
  11835. * Not all MPDUs within this series are necessarily valid - the host
  11836. * must check each sequence number within this range to see if the
  11837. * corresponding MPDU is actually present.
  11838. * This field is only valid if the FV bit is set.
  11839. * Rx descriptor fields:
  11840. * - FW_RX_DESC_BYTES
  11841. * Bits 15:0
  11842. * Purpose: Indicate how many bytes in the Rx indication are used for
  11843. * FW Rx descriptors
  11844. * Value: 1
  11845. */
  11846. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11847. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11848. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11849. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11850. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11851. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11852. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11853. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11854. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11855. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11856. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11857. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11858. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11859. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11860. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11861. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11862. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11863. #define HTT_RX_FRAG_IND_BYTES \
  11864. (4 /* msg hdr */ + \
  11865. 4 /* flush spec */ + \
  11866. 4 /* (unused) FW rx desc bytes spec */ + \
  11867. 4 /* FW rx desc */)
  11868. /**
  11869. * @brief target -> host test message definition
  11870. *
  11871. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11872. *
  11873. * @details
  11874. * The following field definitions describe the format of the test
  11875. * message sent from the target to the host.
  11876. * The message consists of a 4-octet header, followed by a variable
  11877. * number of 32-bit integer values, followed by a variable number
  11878. * of 8-bit character values.
  11879. *
  11880. * |31 16|15 8|7 0|
  11881. * |-----------------------------------------------------------|
  11882. * | num chars | num ints | msg type |
  11883. * |-----------------------------------------------------------|
  11884. * | int 0 |
  11885. * |-----------------------------------------------------------|
  11886. * | int 1 |
  11887. * |-----------------------------------------------------------|
  11888. * | ... |
  11889. * |-----------------------------------------------------------|
  11890. * | char 3 | char 2 | char 1 | char 0 |
  11891. * |-----------------------------------------------------------|
  11892. * | | | ... | char 4 |
  11893. * |-----------------------------------------------------------|
  11894. * - MSG_TYPE
  11895. * Bits 7:0
  11896. * Purpose: identifies this as a test message
  11897. * Value: HTT_MSG_TYPE_TEST
  11898. * - NUM_INTS
  11899. * Bits 15:8
  11900. * Purpose: indicate how many 32-bit integers follow the message header
  11901. * - NUM_CHARS
  11902. * Bits 31:16
  11903. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11904. */
  11905. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11906. #define HTT_RX_TEST_NUM_INTS_S 8
  11907. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11908. #define HTT_RX_TEST_NUM_CHARS_S 16
  11909. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11910. do { \
  11911. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11912. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11913. } while (0)
  11914. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11915. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11916. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11917. do { \
  11918. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11919. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11920. } while (0)
  11921. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11922. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11923. /**
  11924. * @brief target -> host packet log message
  11925. *
  11926. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11927. *
  11928. * @details
  11929. * The following field definitions describe the format of the packet log
  11930. * message sent from the target to the host.
  11931. * The message consists of a 4-octet header,followed by a variable number
  11932. * of 32-bit character values.
  11933. *
  11934. * |31 16|15 12|11 10|9 8|7 0|
  11935. * |------------------------------------------------------------------|
  11936. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11937. * |------------------------------------------------------------------|
  11938. * | payload |
  11939. * |------------------------------------------------------------------|
  11940. * - MSG_TYPE
  11941. * Bits 7:0
  11942. * Purpose: identifies this as a pktlog message
  11943. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11944. * - mac_id
  11945. * Bits 9:8
  11946. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11947. * Value: 0-3
  11948. * - pdev_id
  11949. * Bits 11:10
  11950. * Purpose: pdev_id
  11951. * Value: 0-3
  11952. * 0 (for rings at SOC level),
  11953. * 1/2/3 PDEV -> 0/1/2
  11954. * - payload_size
  11955. * Bits 31:16
  11956. * Purpose: explicitly specify the payload size
  11957. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11958. */
  11959. PREPACK struct htt_pktlog_msg {
  11960. A_UINT32 header;
  11961. A_UINT32 payload[1/* or more */];
  11962. } POSTPACK;
  11963. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11964. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11965. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11966. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11967. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11968. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11969. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11970. do { \
  11971. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11972. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11973. } while (0)
  11974. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11975. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11976. HTT_T2H_PKTLOG_MAC_ID_S)
  11977. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11978. do { \
  11979. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11980. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11981. } while (0)
  11982. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11983. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11984. HTT_T2H_PKTLOG_PDEV_ID_S)
  11985. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11986. do { \
  11987. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11988. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11989. } while (0)
  11990. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11991. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11992. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11993. /*
  11994. * Rx reorder statistics
  11995. * NB: all the fields must be defined in 4 octets size.
  11996. */
  11997. struct rx_reorder_stats {
  11998. /* Non QoS MPDUs received */
  11999. A_UINT32 deliver_non_qos;
  12000. /* MPDUs received in-order */
  12001. A_UINT32 deliver_in_order;
  12002. /* Flush due to reorder timer expired */
  12003. A_UINT32 deliver_flush_timeout;
  12004. /* Flush due to move out of window */
  12005. A_UINT32 deliver_flush_oow;
  12006. /* Flush due to DELBA */
  12007. A_UINT32 deliver_flush_delba;
  12008. /* MPDUs dropped due to FCS error */
  12009. A_UINT32 fcs_error;
  12010. /* MPDUs dropped due to monitor mode non-data packet */
  12011. A_UINT32 mgmt_ctrl;
  12012. /* Unicast-data MPDUs dropped due to invalid peer */
  12013. A_UINT32 invalid_peer;
  12014. /* MPDUs dropped due to duplication (non aggregation) */
  12015. A_UINT32 dup_non_aggr;
  12016. /* MPDUs dropped due to processed before */
  12017. A_UINT32 dup_past;
  12018. /* MPDUs dropped due to duplicate in reorder queue */
  12019. A_UINT32 dup_in_reorder;
  12020. /* Reorder timeout happened */
  12021. A_UINT32 reorder_timeout;
  12022. /* invalid bar ssn */
  12023. A_UINT32 invalid_bar_ssn;
  12024. /* reorder reset due to bar ssn */
  12025. A_UINT32 ssn_reset;
  12026. /* Flush due to delete peer */
  12027. A_UINT32 deliver_flush_delpeer;
  12028. /* Flush due to offload*/
  12029. A_UINT32 deliver_flush_offload;
  12030. /* Flush due to out of buffer*/
  12031. A_UINT32 deliver_flush_oob;
  12032. /* MPDUs dropped due to PN check fail */
  12033. A_UINT32 pn_fail;
  12034. /* MPDUs dropped due to unable to allocate memory */
  12035. A_UINT32 store_fail;
  12036. /* Number of times the tid pool alloc succeeded */
  12037. A_UINT32 tid_pool_alloc_succ;
  12038. /* Number of times the MPDU pool alloc succeeded */
  12039. A_UINT32 mpdu_pool_alloc_succ;
  12040. /* Number of times the MSDU pool alloc succeeded */
  12041. A_UINT32 msdu_pool_alloc_succ;
  12042. /* Number of times the tid pool alloc failed */
  12043. A_UINT32 tid_pool_alloc_fail;
  12044. /* Number of times the MPDU pool alloc failed */
  12045. A_UINT32 mpdu_pool_alloc_fail;
  12046. /* Number of times the MSDU pool alloc failed */
  12047. A_UINT32 msdu_pool_alloc_fail;
  12048. /* Number of times the tid pool freed */
  12049. A_UINT32 tid_pool_free;
  12050. /* Number of times the MPDU pool freed */
  12051. A_UINT32 mpdu_pool_free;
  12052. /* Number of times the MSDU pool freed */
  12053. A_UINT32 msdu_pool_free;
  12054. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12055. A_UINT32 msdu_queued;
  12056. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12057. A_UINT32 msdu_recycled;
  12058. /* Number of MPDUs with invalid peer but A2 found in AST */
  12059. A_UINT32 invalid_peer_a2_in_ast;
  12060. /* Number of MPDUs with invalid peer but A3 found in AST */
  12061. A_UINT32 invalid_peer_a3_in_ast;
  12062. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12063. A_UINT32 invalid_peer_bmc_mpdus;
  12064. /* Number of MSDUs with err attention word */
  12065. A_UINT32 rxdesc_err_att;
  12066. /* Number of MSDUs with flag of peer_idx_invalid */
  12067. A_UINT32 rxdesc_err_peer_idx_inv;
  12068. /* Number of MSDUs with flag of peer_idx_timeout */
  12069. A_UINT32 rxdesc_err_peer_idx_to;
  12070. /* Number of MSDUs with flag of overflow */
  12071. A_UINT32 rxdesc_err_ov;
  12072. /* Number of MSDUs with flag of msdu_length_err */
  12073. A_UINT32 rxdesc_err_msdu_len;
  12074. /* Number of MSDUs with flag of mpdu_length_err */
  12075. A_UINT32 rxdesc_err_mpdu_len;
  12076. /* Number of MSDUs with flag of tkip_mic_err */
  12077. A_UINT32 rxdesc_err_tkip_mic;
  12078. /* Number of MSDUs with flag of decrypt_err */
  12079. A_UINT32 rxdesc_err_decrypt;
  12080. /* Number of MSDUs with flag of fcs_err */
  12081. A_UINT32 rxdesc_err_fcs;
  12082. /* Number of Unicast (bc_mc bit is not set in attention word)
  12083. * frames with invalid peer handler
  12084. */
  12085. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12086. /* Number of unicast frame directly (direct bit is set in attention word)
  12087. * to DUT with invalid peer handler
  12088. */
  12089. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12090. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12091. * frames with invalid peer handler
  12092. */
  12093. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12094. /* Number of MSDUs dropped due to no first MSDU flag */
  12095. A_UINT32 rxdesc_no_1st_msdu;
  12096. /* Number of MSDUs droped due to ring overflow */
  12097. A_UINT32 msdu_drop_ring_ov;
  12098. /* Number of MSDUs dropped due to FC mismatch */
  12099. A_UINT32 msdu_drop_fc_mismatch;
  12100. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12101. A_UINT32 msdu_drop_mgmt_remote_ring;
  12102. /* Number of MSDUs dropped due to errors not reported in attention word */
  12103. A_UINT32 msdu_drop_misc;
  12104. /* Number of MSDUs go to offload before reorder */
  12105. A_UINT32 offload_msdu_wal;
  12106. /* Number of data frame dropped by offload after reorder */
  12107. A_UINT32 offload_msdu_reorder;
  12108. /* Number of MPDUs with sequence number in the past and within the BA window */
  12109. A_UINT32 dup_past_within_window;
  12110. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12111. A_UINT32 dup_past_outside_window;
  12112. /* Number of MSDUs with decrypt/MIC error */
  12113. A_UINT32 rxdesc_err_decrypt_mic;
  12114. /* Number of data MSDUs received on both local and remote rings */
  12115. A_UINT32 data_msdus_on_both_rings;
  12116. /* MPDUs never filled */
  12117. A_UINT32 holes_not_filled;
  12118. };
  12119. /*
  12120. * Rx Remote buffer statistics
  12121. * NB: all the fields must be defined in 4 octets size.
  12122. */
  12123. struct rx_remote_buffer_mgmt_stats {
  12124. /* Total number of MSDUs reaped for Rx processing */
  12125. A_UINT32 remote_reaped;
  12126. /* MSDUs recycled within firmware */
  12127. A_UINT32 remote_recycled;
  12128. /* MSDUs stored by Data Rx */
  12129. A_UINT32 data_rx_msdus_stored;
  12130. /* Number of HTT indications from WAL Rx MSDU */
  12131. A_UINT32 wal_rx_ind;
  12132. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12133. A_UINT32 wal_rx_ind_unconsumed;
  12134. /* Number of HTT indications from Data Rx MSDU */
  12135. A_UINT32 data_rx_ind;
  12136. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12137. A_UINT32 data_rx_ind_unconsumed;
  12138. /* Number of HTT indications from ATHBUF */
  12139. A_UINT32 athbuf_rx_ind;
  12140. /* Number of remote buffers requested for refill */
  12141. A_UINT32 refill_buf_req;
  12142. /* Number of remote buffers filled by the host */
  12143. A_UINT32 refill_buf_rsp;
  12144. /* Number of times MAC hw_index = f/w write_index */
  12145. A_INT32 mac_no_bufs;
  12146. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12147. A_INT32 fw_indices_equal;
  12148. /* Number of times f/w finds no buffers to post */
  12149. A_INT32 host_no_bufs;
  12150. };
  12151. /*
  12152. * TXBF MU/SU packets and NDPA statistics
  12153. * NB: all the fields must be defined in 4 octets size.
  12154. */
  12155. struct rx_txbf_musu_ndpa_pkts_stats {
  12156. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12157. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12158. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12159. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12160. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12161. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12162. };
  12163. /*
  12164. * htt_dbg_stats_status -
  12165. * present - The requested stats have been delivered in full.
  12166. * This indicates that either the stats information was contained
  12167. * in its entirety within this message, or else this message
  12168. * completes the delivery of the requested stats info that was
  12169. * partially delivered through earlier STATS_CONF messages.
  12170. * partial - The requested stats have been delivered in part.
  12171. * One or more subsequent STATS_CONF messages with the same
  12172. * cookie value will be sent to deliver the remainder of the
  12173. * information.
  12174. * error - The requested stats could not be delivered, for example due
  12175. * to a shortage of memory to construct a message holding the
  12176. * requested stats.
  12177. * invalid - The requested stat type is either not recognized, or the
  12178. * target is configured to not gather the stats type in question.
  12179. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12180. * series_done - This special value indicates that no further stats info
  12181. * elements are present within a series of stats info elems
  12182. * (within a stats upload confirmation message).
  12183. */
  12184. enum htt_dbg_stats_status {
  12185. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12186. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12187. HTT_DBG_STATS_STATUS_ERROR = 2,
  12188. HTT_DBG_STATS_STATUS_INVALID = 3,
  12189. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12190. };
  12191. /**
  12192. * @brief target -> host statistics upload
  12193. *
  12194. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12195. *
  12196. * @details
  12197. * The following field definitions describe the format of the HTT target
  12198. * to host stats upload confirmation message.
  12199. * The message contains a cookie echoed from the HTT host->target stats
  12200. * upload request, which identifies which request the confirmation is
  12201. * for, and a series of tag-length-value stats information elements.
  12202. * The tag-length header for each stats info element also includes a
  12203. * status field, to indicate whether the request for the stat type in
  12204. * question was fully met, partially met, unable to be met, or invalid
  12205. * (if the stat type in question is disabled in the target).
  12206. * A special value of all 1's in this status field is used to indicate
  12207. * the end of the series of stats info elements.
  12208. *
  12209. *
  12210. * |31 16|15 8|7 5|4 0|
  12211. * |------------------------------------------------------------|
  12212. * | reserved | msg type |
  12213. * |------------------------------------------------------------|
  12214. * | cookie LSBs |
  12215. * |------------------------------------------------------------|
  12216. * | cookie MSBs |
  12217. * |------------------------------------------------------------|
  12218. * | stats entry length | reserved | S |stat type|
  12219. * |------------------------------------------------------------|
  12220. * | |
  12221. * | type-specific stats info |
  12222. * | |
  12223. * |------------------------------------------------------------|
  12224. * | stats entry length | reserved | S |stat type|
  12225. * |------------------------------------------------------------|
  12226. * | |
  12227. * | type-specific stats info |
  12228. * | |
  12229. * |------------------------------------------------------------|
  12230. * | n/a | reserved | 111 | n/a |
  12231. * |------------------------------------------------------------|
  12232. * Header fields:
  12233. * - MSG_TYPE
  12234. * Bits 7:0
  12235. * Purpose: identifies this is a statistics upload confirmation message
  12236. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12237. * - COOKIE_LSBS
  12238. * Bits 31:0
  12239. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12240. * message with its preceding host->target stats request message.
  12241. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12242. * - COOKIE_MSBS
  12243. * Bits 31:0
  12244. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12245. * message with its preceding host->target stats request message.
  12246. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12247. *
  12248. * Stats Information Element tag-length header fields:
  12249. * - STAT_TYPE
  12250. * Bits 4:0
  12251. * Purpose: identifies the type of statistics info held in the
  12252. * following information element
  12253. * Value: htt_dbg_stats_type
  12254. * - STATUS
  12255. * Bits 7:5
  12256. * Purpose: indicate whether the requested stats are present
  12257. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12258. * the completion of the stats entry series
  12259. * - LENGTH
  12260. * Bits 31:16
  12261. * Purpose: indicate the stats information size
  12262. * Value: This field specifies the number of bytes of stats information
  12263. * that follows the element tag-length header.
  12264. * It is expected but not required that this length is a multiple of
  12265. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12266. * subsequent stats entry header will begin on a 4-byte aligned
  12267. * boundary.
  12268. */
  12269. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12270. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12271. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12272. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12273. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12274. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12275. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12276. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12277. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12278. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12279. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12280. do { \
  12281. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12282. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12283. } while (0)
  12284. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12285. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12286. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12287. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12288. do { \
  12289. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12290. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12291. } while (0)
  12292. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12293. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12294. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12295. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12296. do { \
  12297. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12298. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12299. } while (0)
  12300. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12301. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12302. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12303. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12304. #define HTT_MAX_AGGR 64
  12305. #define HTT_HL_MAX_AGGR 18
  12306. /**
  12307. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12308. *
  12309. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12310. *
  12311. * @details
  12312. * The following field definitions describe the format of the HTT host
  12313. * to target frag_desc/msdu_ext bank configuration message.
  12314. * The message contains the based address and the min and max id of the
  12315. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12316. * MSDU_EXT/FRAG_DESC.
  12317. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12318. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12319. * the hardware does the mapping/translation.
  12320. *
  12321. * Total banks that can be configured is configured to 16.
  12322. *
  12323. * This should be called before any TX has be initiated by the HTT
  12324. *
  12325. * |31 16|15 8|7 5|4 0|
  12326. * |------------------------------------------------------------|
  12327. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12328. * |------------------------------------------------------------|
  12329. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12330. #if HTT_PADDR64
  12331. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12332. #endif
  12333. * |------------------------------------------------------------|
  12334. * | ... |
  12335. * |------------------------------------------------------------|
  12336. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12337. #if HTT_PADDR64
  12338. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12339. #endif
  12340. * |------------------------------------------------------------|
  12341. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12342. * |------------------------------------------------------------|
  12343. * | ... |
  12344. * |------------------------------------------------------------|
  12345. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12346. * |------------------------------------------------------------|
  12347. * Header fields:
  12348. * - MSG_TYPE
  12349. * Bits 7:0
  12350. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12351. * for systems with 64-bit format for bus addresses:
  12352. * - BANKx_BASE_ADDRESS_LO
  12353. * Bits 31:0
  12354. * Purpose: Provide a mechanism to specify the base address of the
  12355. * MSDU_EXT bank physical/bus address.
  12356. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12357. * - BANKx_BASE_ADDRESS_HI
  12358. * Bits 31:0
  12359. * Purpose: Provide a mechanism to specify the base address of the
  12360. * MSDU_EXT bank physical/bus address.
  12361. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12362. * for systems with 32-bit format for bus addresses:
  12363. * - BANKx_BASE_ADDRESS
  12364. * Bits 31:0
  12365. * Purpose: Provide a mechanism to specify the base address of the
  12366. * MSDU_EXT bank physical/bus address.
  12367. * Value: MSDU_EXT bank physical / bus address
  12368. * - BANKx_MIN_ID
  12369. * Bits 15:0
  12370. * Purpose: Provide a mechanism to specify the min index that needs to
  12371. * mapped.
  12372. * - BANKx_MAX_ID
  12373. * Bits 31:16
  12374. * Purpose: Provide a mechanism to specify the max index that needs to
  12375. * mapped.
  12376. *
  12377. */
  12378. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12379. * safe value.
  12380. * @note MAX supported banks is 16.
  12381. */
  12382. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12383. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12384. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12385. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12386. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12387. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12388. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12389. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12390. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12391. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12392. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12393. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12394. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12395. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12396. do { \
  12397. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12398. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12399. } while (0)
  12400. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12401. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12402. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12403. do { \
  12404. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12405. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12406. } while (0)
  12407. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12408. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12409. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12410. do { \
  12411. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12412. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12413. } while (0)
  12414. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12415. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12416. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12417. do { \
  12418. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12419. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12420. } while (0)
  12421. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12422. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12423. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12424. do { \
  12425. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12426. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12427. } while (0)
  12428. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12429. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12430. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12431. do { \
  12432. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12433. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12434. } while (0)
  12435. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12436. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12437. /*
  12438. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12439. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12440. * addresses are stored in a XXX-bit field.
  12441. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12442. * htt_tx_frag_desc64_bank_cfg_t structs.
  12443. */
  12444. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12445. _paddr_bits_, \
  12446. _paddr__bank_base_address_) \
  12447. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12448. /** word 0 \
  12449. * msg_type: 8, \
  12450. * pdev_id: 2, \
  12451. * swap: 1, \
  12452. * reserved0: 5, \
  12453. * num_banks: 8, \
  12454. * desc_size: 8; \
  12455. */ \
  12456. A_UINT32 word0; \
  12457. /* \
  12458. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12459. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12460. * the second A_UINT32). \
  12461. */ \
  12462. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12463. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12464. } POSTPACK
  12465. /* define htt_tx_frag_desc32_bank_cfg_t */
  12466. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12467. /* define htt_tx_frag_desc64_bank_cfg_t */
  12468. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12469. /*
  12470. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12471. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12472. */
  12473. #if HTT_PADDR64
  12474. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12475. #else
  12476. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12477. #endif
  12478. /**
  12479. * @brief target -> host HTT TX Credit total count update message definition
  12480. *
  12481. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12482. *
  12483. *|31 16|15|14 9| 8 |7 0 |
  12484. *|---------------------+--+----------+-------+----------|
  12485. *|cur htt credit delta | Q| reserved | sign | msg type |
  12486. *|------------------------------------------------------|
  12487. *
  12488. * Header fields:
  12489. * - MSG_TYPE
  12490. * Bits 7:0
  12491. * Purpose: identifies this as a htt tx credit delta update message
  12492. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12493. * - SIGN
  12494. * Bits 8
  12495. * identifies whether credit delta is positive or negative
  12496. * Value:
  12497. * - 0x0: credit delta is positive, rebalance in some buffers
  12498. * - 0x1: credit delta is negative, rebalance out some buffers
  12499. * - reserved
  12500. * Bits 14:9
  12501. * Value: 0x0
  12502. * - TXQ_GRP
  12503. * Bit 15
  12504. * Purpose: indicates whether any tx queue group information elements
  12505. * are appended to the tx credit update message
  12506. * Value: 0 -> no tx queue group information element is present
  12507. * 1 -> a tx queue group information element immediately follows
  12508. * - DELTA_COUNT
  12509. * Bits 31:16
  12510. * Purpose: Specify current htt credit delta absolute count
  12511. */
  12512. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12513. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12514. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12515. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12516. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12517. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12518. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12519. do { \
  12520. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12521. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12522. } while (0)
  12523. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12524. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12525. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12526. do { \
  12527. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12528. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12529. } while (0)
  12530. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12531. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12532. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12533. do { \
  12534. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12535. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12536. } while (0)
  12537. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12538. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12539. #define HTT_TX_CREDIT_MSG_BYTES 4
  12540. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12541. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12542. /**
  12543. * @brief HTT WDI_IPA Operation Response Message
  12544. *
  12545. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12546. *
  12547. * @details
  12548. * HTT WDI_IPA Operation Response message is sent by target
  12549. * to host confirming suspend or resume operation.
  12550. * |31 24|23 16|15 8|7 0|
  12551. * |----------------+----------------+----------------+----------------|
  12552. * | op_code | Rsvd | msg_type |
  12553. * |-------------------------------------------------------------------|
  12554. * | Rsvd | Response len |
  12555. * |-------------------------------------------------------------------|
  12556. * | |
  12557. * | Response-type specific info |
  12558. * | |
  12559. * | |
  12560. * |-------------------------------------------------------------------|
  12561. * Header fields:
  12562. * - MSG_TYPE
  12563. * Bits 7:0
  12564. * Purpose: Identifies this as WDI_IPA Operation Response message
  12565. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12566. * - OP_CODE
  12567. * Bits 31:16
  12568. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12569. * value: = enum htt_wdi_ipa_op_code
  12570. * - RSP_LEN
  12571. * Bits 16:0
  12572. * Purpose: length for the response-type specific info
  12573. * value: = length in bytes for response-type specific info
  12574. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12575. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12576. */
  12577. PREPACK struct htt_wdi_ipa_op_response_t
  12578. {
  12579. /* DWORD 0: flags and meta-data */
  12580. A_UINT32
  12581. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12582. reserved1: 8,
  12583. op_code: 16;
  12584. A_UINT32
  12585. rsp_len: 16,
  12586. reserved2: 16;
  12587. } POSTPACK;
  12588. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12589. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12590. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12591. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12592. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12593. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12594. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12595. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12596. do { \
  12597. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12598. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12599. } while (0)
  12600. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12601. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12602. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12603. do { \
  12604. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12605. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12606. } while (0)
  12607. enum htt_phy_mode {
  12608. htt_phy_mode_11a = 0,
  12609. htt_phy_mode_11g = 1,
  12610. htt_phy_mode_11b = 2,
  12611. htt_phy_mode_11g_only = 3,
  12612. htt_phy_mode_11na_ht20 = 4,
  12613. htt_phy_mode_11ng_ht20 = 5,
  12614. htt_phy_mode_11na_ht40 = 6,
  12615. htt_phy_mode_11ng_ht40 = 7,
  12616. htt_phy_mode_11ac_vht20 = 8,
  12617. htt_phy_mode_11ac_vht40 = 9,
  12618. htt_phy_mode_11ac_vht80 = 10,
  12619. htt_phy_mode_11ac_vht20_2g = 11,
  12620. htt_phy_mode_11ac_vht40_2g = 12,
  12621. htt_phy_mode_11ac_vht80_2g = 13,
  12622. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12623. htt_phy_mode_11ac_vht160 = 15,
  12624. htt_phy_mode_max,
  12625. };
  12626. /**
  12627. * @brief target -> host HTT channel change indication
  12628. *
  12629. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12630. *
  12631. * @details
  12632. * Specify when a channel change occurs.
  12633. * This allows the host to precisely determine which rx frames arrived
  12634. * on the old channel and which rx frames arrived on the new channel.
  12635. *
  12636. *|31 |7 0 |
  12637. *|-------------------------------------------+----------|
  12638. *| reserved | msg type |
  12639. *|------------------------------------------------------|
  12640. *| primary_chan_center_freq_mhz |
  12641. *|------------------------------------------------------|
  12642. *| contiguous_chan1_center_freq_mhz |
  12643. *|------------------------------------------------------|
  12644. *| contiguous_chan2_center_freq_mhz |
  12645. *|------------------------------------------------------|
  12646. *| phy_mode |
  12647. *|------------------------------------------------------|
  12648. *
  12649. * Header fields:
  12650. * - MSG_TYPE
  12651. * Bits 7:0
  12652. * Purpose: identifies this as a htt channel change indication message
  12653. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12654. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12655. * Bits 31:0
  12656. * Purpose: identify the (center of the) new 20 MHz primary channel
  12657. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12658. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12659. * Bits 31:0
  12660. * Purpose: identify the (center of the) contiguous frequency range
  12661. * comprising the new channel.
  12662. * For example, if the new channel is a 80 MHz channel extending
  12663. * 60 MHz beyond the primary channel, this field would be 30 larger
  12664. * than the primary channel center frequency field.
  12665. * Value: center frequency of the contiguous frequency range comprising
  12666. * the full channel in MHz units
  12667. * (80+80 channels also use the CONTIG_CHAN2 field)
  12668. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12669. * Bits 31:0
  12670. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12671. * within a VHT 80+80 channel.
  12672. * This field is only relevant for VHT 80+80 channels.
  12673. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12674. * channel (arbitrary value for cases besides VHT 80+80)
  12675. * - PHY_MODE
  12676. * Bits 31:0
  12677. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12678. * and band
  12679. * Value: htt_phy_mode enum value
  12680. */
  12681. PREPACK struct htt_chan_change_t
  12682. {
  12683. /* DWORD 0: flags and meta-data */
  12684. A_UINT32
  12685. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12686. reserved1: 24;
  12687. A_UINT32 primary_chan_center_freq_mhz;
  12688. A_UINT32 contig_chan1_center_freq_mhz;
  12689. A_UINT32 contig_chan2_center_freq_mhz;
  12690. A_UINT32 phy_mode;
  12691. } POSTPACK;
  12692. /*
  12693. * Due to historical / backwards-compatibility reasons, maintain the
  12694. * below htt_chan_change_msg struct definition, which needs to be
  12695. * consistent with the above htt_chan_change_t struct definition
  12696. * (aside from the htt_chan_change_t definition including the msg_type
  12697. * dword within the message, and the htt_chan_change_msg only containing
  12698. * the payload of the message that follows the msg_type dword).
  12699. */
  12700. PREPACK struct htt_chan_change_msg {
  12701. A_UINT32 chan_mhz; /* frequency in mhz */
  12702. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12703. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12704. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12705. } POSTPACK;
  12706. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12707. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12708. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12709. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12710. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12711. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12712. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12713. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12714. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12715. do { \
  12716. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12717. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12718. } while (0)
  12719. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12720. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12721. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12722. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12723. do { \
  12724. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12725. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12726. } while (0)
  12727. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12728. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12729. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12730. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12731. do { \
  12732. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12733. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12734. } while (0)
  12735. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12736. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12737. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12738. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12739. do { \
  12740. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12741. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12742. } while (0)
  12743. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12744. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12745. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12746. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12747. /**
  12748. * @brief rx offload packet error message
  12749. *
  12750. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12751. *
  12752. * @details
  12753. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12754. * of target payload like mic err.
  12755. *
  12756. * |31 24|23 16|15 8|7 0|
  12757. * |----------------+----------------+----------------+----------------|
  12758. * | tid | vdev_id | msg_sub_type | msg_type |
  12759. * |-------------------------------------------------------------------|
  12760. * : (sub-type dependent content) :
  12761. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12762. * Header fields:
  12763. * - msg_type
  12764. * Bits 7:0
  12765. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12766. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12767. * - msg_sub_type
  12768. * Bits 15:8
  12769. * Purpose: Identifies which type of rx error is reported by this message
  12770. * value: htt_rx_ofld_pkt_err_type
  12771. * - vdev_id
  12772. * Bits 23:16
  12773. * Purpose: Identifies which vdev received the erroneous rx frame
  12774. * value:
  12775. * - tid
  12776. * Bits 31:24
  12777. * Purpose: Identifies the traffic type of the rx frame
  12778. * value:
  12779. *
  12780. * - The payload fields used if the sub-type == MIC error are shown below.
  12781. * Note - MIC err is per MSDU, while PN is per MPDU.
  12782. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12783. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12784. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12785. * instead of sending separate HTT messages for each wrong MSDU within
  12786. * the MPDU.
  12787. *
  12788. * |31 24|23 16|15 8|7 0|
  12789. * |----------------+----------------+----------------+----------------|
  12790. * | Rsvd | key_id | peer_id |
  12791. * |-------------------------------------------------------------------|
  12792. * | receiver MAC addr 31:0 |
  12793. * |-------------------------------------------------------------------|
  12794. * | Rsvd | receiver MAC addr 47:32 |
  12795. * |-------------------------------------------------------------------|
  12796. * | transmitter MAC addr 31:0 |
  12797. * |-------------------------------------------------------------------|
  12798. * | Rsvd | transmitter MAC addr 47:32 |
  12799. * |-------------------------------------------------------------------|
  12800. * | PN 31:0 |
  12801. * |-------------------------------------------------------------------|
  12802. * | Rsvd | PN 47:32 |
  12803. * |-------------------------------------------------------------------|
  12804. * - peer_id
  12805. * Bits 15:0
  12806. * Purpose: identifies which peer is frame is from
  12807. * value:
  12808. * - key_id
  12809. * Bits 23:16
  12810. * Purpose: identifies key_id of rx frame
  12811. * value:
  12812. * - RA_31_0 (receiver MAC addr 31:0)
  12813. * Bits 31:0
  12814. * Purpose: identifies by MAC address which vdev received the frame
  12815. * value: MAC address lower 4 bytes
  12816. * - RA_47_32 (receiver MAC addr 47:32)
  12817. * Bits 15:0
  12818. * Purpose: identifies by MAC address which vdev received the frame
  12819. * value: MAC address upper 2 bytes
  12820. * - TA_31_0 (transmitter MAC addr 31:0)
  12821. * Bits 31:0
  12822. * Purpose: identifies by MAC address which peer transmitted the frame
  12823. * value: MAC address lower 4 bytes
  12824. * - TA_47_32 (transmitter MAC addr 47:32)
  12825. * Bits 15:0
  12826. * Purpose: identifies by MAC address which peer transmitted the frame
  12827. * value: MAC address upper 2 bytes
  12828. * - PN_31_0
  12829. * Bits 31:0
  12830. * Purpose: Identifies pn of rx frame
  12831. * value: PN lower 4 bytes
  12832. * - PN_47_32
  12833. * Bits 15:0
  12834. * Purpose: Identifies pn of rx frame
  12835. * value:
  12836. * TKIP or CCMP: PN upper 2 bytes
  12837. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12838. */
  12839. enum htt_rx_ofld_pkt_err_type {
  12840. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12841. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12842. };
  12843. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12844. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12845. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12846. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12847. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12848. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12849. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12850. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12851. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12852. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12853. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12854. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12855. do { \
  12856. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12857. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12858. } while (0)
  12859. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12860. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12861. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12862. do { \
  12863. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12864. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12865. } while (0)
  12866. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12867. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12868. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12869. do { \
  12870. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12871. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12872. } while (0)
  12873. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12874. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12875. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12876. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12877. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12878. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12879. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12880. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12881. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12882. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12883. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12884. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12885. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12886. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12887. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12888. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12889. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12890. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12891. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12892. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12893. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12894. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12895. do { \
  12896. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12897. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12898. } while (0)
  12899. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12900. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12901. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12902. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12903. do { \
  12904. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12905. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12906. } while (0)
  12907. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12908. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12909. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12910. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12911. do { \
  12912. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12913. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12914. } while (0)
  12915. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12916. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12917. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12918. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12919. do { \
  12920. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12921. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12922. } while (0)
  12923. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12924. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12925. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12926. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12927. do { \
  12928. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12929. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12930. } while (0)
  12931. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12932. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12933. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12934. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12935. do { \
  12936. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12937. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12938. } while (0)
  12939. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12940. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12941. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12942. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12943. do { \
  12944. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12945. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12946. } while (0)
  12947. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12948. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12949. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12950. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12951. do { \
  12952. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12953. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12954. } while (0)
  12955. /**
  12956. * @brief target -> host peer rate report message
  12957. *
  12958. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12959. *
  12960. * @details
  12961. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12962. * justified rate of all the peers.
  12963. *
  12964. * |31 24|23 16|15 8|7 0|
  12965. * |----------------+----------------+----------------+----------------|
  12966. * | peer_count | | msg_type |
  12967. * |-------------------------------------------------------------------|
  12968. * : Payload (variant number of peer rate report) :
  12969. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12970. * Header fields:
  12971. * - msg_type
  12972. * Bits 7:0
  12973. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12974. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12975. * - reserved
  12976. * Bits 15:8
  12977. * Purpose:
  12978. * value:
  12979. * - peer_count
  12980. * Bits 31:16
  12981. * Purpose: Specify how many peer rate report elements are present in the payload.
  12982. * value:
  12983. *
  12984. * Payload:
  12985. * There are variant number of peer rate report follow the first 32 bits.
  12986. * The peer rate report is defined as follows.
  12987. *
  12988. * |31 20|19 16|15 0|
  12989. * |-----------------------+---------+---------------------------------|-
  12990. * | reserved | phy | peer_id | \
  12991. * |-------------------------------------------------------------------| -> report #0
  12992. * | rate | /
  12993. * |-----------------------+---------+---------------------------------|-
  12994. * | reserved | phy | peer_id | \
  12995. * |-------------------------------------------------------------------| -> report #1
  12996. * | rate | /
  12997. * |-----------------------+---------+---------------------------------|-
  12998. * | reserved | phy | peer_id | \
  12999. * |-------------------------------------------------------------------| -> report #2
  13000. * | rate | /
  13001. * |-------------------------------------------------------------------|-
  13002. * : :
  13003. * : :
  13004. * : :
  13005. * :-------------------------------------------------------------------:
  13006. *
  13007. * - peer_id
  13008. * Bits 15:0
  13009. * Purpose: identify the peer
  13010. * value:
  13011. * - phy
  13012. * Bits 19:16
  13013. * Purpose: identify which phy is in use
  13014. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13015. * Please see enum htt_peer_report_phy_type for detail.
  13016. * - reserved
  13017. * Bits 31:20
  13018. * Purpose:
  13019. * value:
  13020. * - rate
  13021. * Bits 31:0
  13022. * Purpose: represent the justified rate of the peer specified by peer_id
  13023. * value:
  13024. */
  13025. enum htt_peer_rate_report_phy_type {
  13026. HTT_PEER_RATE_REPORT_11B = 0,
  13027. HTT_PEER_RATE_REPORT_11A_G,
  13028. HTT_PEER_RATE_REPORT_11N,
  13029. HTT_PEER_RATE_REPORT_11AC,
  13030. };
  13031. #define HTT_PEER_RATE_REPORT_SIZE 8
  13032. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13033. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13034. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13035. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13036. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13037. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13038. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13039. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13040. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13041. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13042. do { \
  13043. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13044. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13045. } while (0)
  13046. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13047. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13048. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13049. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13050. do { \
  13051. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13052. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13053. } while (0)
  13054. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13055. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13056. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13057. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13058. do { \
  13059. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13060. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13061. } while (0)
  13062. /**
  13063. * @brief target -> host flow pool map message
  13064. *
  13065. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13066. *
  13067. * @details
  13068. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13069. * a flow of descriptors.
  13070. *
  13071. * This message is in TLV format and indicates the parameters to be setup a
  13072. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13073. * receive descriptors from a specified pool.
  13074. *
  13075. * The message would appear as follows:
  13076. *
  13077. * |31 24|23 16|15 8|7 0|
  13078. * |----------------+----------------+----------------+----------------|
  13079. * header | reserved | num_flows | msg_type |
  13080. * |-------------------------------------------------------------------|
  13081. * | |
  13082. * : payload :
  13083. * | |
  13084. * |-------------------------------------------------------------------|
  13085. *
  13086. * The header field is one DWORD long and is interpreted as follows:
  13087. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13088. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13089. * this message
  13090. * b'16-31 - reserved: These bits are reserved for future use
  13091. *
  13092. * Payload:
  13093. * The payload would contain multiple objects of the following structure. Each
  13094. * object represents a flow.
  13095. *
  13096. * |31 24|23 16|15 8|7 0|
  13097. * |----------------+----------------+----------------+----------------|
  13098. * header | reserved | num_flows | msg_type |
  13099. * |-------------------------------------------------------------------|
  13100. * payload0| flow_type |
  13101. * |-------------------------------------------------------------------|
  13102. * | flow_id |
  13103. * |-------------------------------------------------------------------|
  13104. * | reserved0 | flow_pool_id |
  13105. * |-------------------------------------------------------------------|
  13106. * | reserved1 | flow_pool_size |
  13107. * |-------------------------------------------------------------------|
  13108. * | reserved2 |
  13109. * |-------------------------------------------------------------------|
  13110. * payload1| flow_type |
  13111. * |-------------------------------------------------------------------|
  13112. * | flow_id |
  13113. * |-------------------------------------------------------------------|
  13114. * | reserved0 | flow_pool_id |
  13115. * |-------------------------------------------------------------------|
  13116. * | reserved1 | flow_pool_size |
  13117. * |-------------------------------------------------------------------|
  13118. * | reserved2 |
  13119. * |-------------------------------------------------------------------|
  13120. * | . |
  13121. * | . |
  13122. * | . |
  13123. * |-------------------------------------------------------------------|
  13124. *
  13125. * Each payload is 5 DWORDS long and is interpreted as follows:
  13126. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13127. * this flow is associated. It can be VDEV, peer,
  13128. * or tid (AC). Based on enum htt_flow_type.
  13129. *
  13130. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13131. * object. For flow_type vdev it is set to the
  13132. * vdevid, for peer it is peerid and for tid, it is
  13133. * tid_num.
  13134. *
  13135. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13136. * in the host for this flow
  13137. * b'16:31 - reserved0: This field in reserved for the future. In case
  13138. * we have a hierarchical implementation (HCM) of
  13139. * pools, it can be used to indicate the ID of the
  13140. * parent-pool.
  13141. *
  13142. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13143. * Descriptors for this flow will be
  13144. * allocated from this pool in the host.
  13145. * b'16:31 - reserved1: This field in reserved for the future. In case
  13146. * we have a hierarchical implementation of pools,
  13147. * it can be used to indicate the max number of
  13148. * descriptors in the pool. The b'0:15 can be used
  13149. * to indicate min number of descriptors in the
  13150. * HCM scheme.
  13151. *
  13152. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13153. * we have a hierarchical implementation of pools,
  13154. * b'0:15 can be used to indicate the
  13155. * priority-based borrowing (PBB) threshold of
  13156. * the flow's pool. The b'16:31 are still left
  13157. * reserved.
  13158. */
  13159. enum htt_flow_type {
  13160. FLOW_TYPE_VDEV = 0,
  13161. /* Insert new flow types above this line */
  13162. };
  13163. PREPACK struct htt_flow_pool_map_payload_t {
  13164. A_UINT32 flow_type;
  13165. A_UINT32 flow_id;
  13166. A_UINT32 flow_pool_id:16,
  13167. reserved0:16;
  13168. A_UINT32 flow_pool_size:16,
  13169. reserved1:16;
  13170. A_UINT32 reserved2;
  13171. } POSTPACK;
  13172. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13173. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13174. (sizeof(struct htt_flow_pool_map_payload_t))
  13175. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13176. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13177. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13178. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13179. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13180. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13181. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13182. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13183. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13184. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13185. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13186. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13187. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13188. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13189. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13190. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13191. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13192. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13193. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13194. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13195. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13196. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13197. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13198. do { \
  13199. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13200. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13201. } while (0)
  13202. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13203. do { \
  13204. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13205. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13206. } while (0)
  13207. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13208. do { \
  13209. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13210. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13211. } while (0)
  13212. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13213. do { \
  13214. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13215. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13216. } while (0)
  13217. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13218. do { \
  13219. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13220. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13221. } while (0)
  13222. /**
  13223. * @brief target -> host flow pool unmap message
  13224. *
  13225. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13226. *
  13227. * @details
  13228. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13229. * down a flow of descriptors.
  13230. * This message indicates that for the flow (whose ID is provided) is wanting
  13231. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13232. * pool of descriptors from where descriptors are being allocated for this
  13233. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13234. * be unmapped by the host.
  13235. *
  13236. * The message would appear as follows:
  13237. *
  13238. * |31 24|23 16|15 8|7 0|
  13239. * |----------------+----------------+----------------+----------------|
  13240. * | reserved0 | msg_type |
  13241. * |-------------------------------------------------------------------|
  13242. * | flow_type |
  13243. * |-------------------------------------------------------------------|
  13244. * | flow_id |
  13245. * |-------------------------------------------------------------------|
  13246. * | reserved1 | flow_pool_id |
  13247. * |-------------------------------------------------------------------|
  13248. *
  13249. * The message is interpreted as follows:
  13250. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13251. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13252. * b'8:31 - reserved0: Reserved for future use
  13253. *
  13254. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13255. * this flow is associated. It can be VDEV, peer,
  13256. * or tid (AC). Based on enum htt_flow_type.
  13257. *
  13258. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13259. * object. For flow_type vdev it is set to the
  13260. * vdevid, for peer it is peerid and for tid, it is
  13261. * tid_num.
  13262. *
  13263. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13264. * used in the host for this flow
  13265. * b'16:31 - reserved0: This field in reserved for the future.
  13266. *
  13267. */
  13268. PREPACK struct htt_flow_pool_unmap_t {
  13269. A_UINT32 msg_type:8,
  13270. reserved0:24;
  13271. A_UINT32 flow_type;
  13272. A_UINT32 flow_id;
  13273. A_UINT32 flow_pool_id:16,
  13274. reserved1:16;
  13275. } POSTPACK;
  13276. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13277. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13278. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13279. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13280. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13281. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13282. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13283. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13284. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13285. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13286. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13287. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13288. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13289. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13290. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13291. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13292. do { \
  13293. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13294. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13295. } while (0)
  13296. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13297. do { \
  13298. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13299. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13300. } while (0)
  13301. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13302. do { \
  13303. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13304. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13305. } while (0)
  13306. /**
  13307. * @brief target -> host SRING setup done message
  13308. *
  13309. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13310. *
  13311. * @details
  13312. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13313. * SRNG ring setup is done
  13314. *
  13315. * This message indicates whether the last setup operation is successful.
  13316. * It will be sent to host when host set respose_required bit in
  13317. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13318. * The message would appear as follows:
  13319. *
  13320. * |31 24|23 16|15 8|7 0|
  13321. * |--------------- +----------------+----------------+----------------|
  13322. * | setup_status | ring_id | pdev_id | msg_type |
  13323. * |-------------------------------------------------------------------|
  13324. *
  13325. * The message is interpreted as follows:
  13326. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13327. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13328. * b'8:15 - pdev_id:
  13329. * 0 (for rings at SOC/UMAC level),
  13330. * 1/2/3 mac id (for rings at LMAC level)
  13331. * b'16:23 - ring_id: Identify the ring which is set up
  13332. * More details can be got from enum htt_srng_ring_id
  13333. * b'24:31 - setup_status: Indicate status of setup operation
  13334. * Refer to htt_ring_setup_status
  13335. */
  13336. PREPACK struct htt_sring_setup_done_t {
  13337. A_UINT32 msg_type: 8,
  13338. pdev_id: 8,
  13339. ring_id: 8,
  13340. setup_status: 8;
  13341. } POSTPACK;
  13342. enum htt_ring_setup_status {
  13343. htt_ring_setup_status_ok = 0,
  13344. htt_ring_setup_status_error,
  13345. };
  13346. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13347. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13348. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13349. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13350. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13351. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13352. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13353. do { \
  13354. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13355. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13356. } while (0)
  13357. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13358. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13359. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13360. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13361. HTT_SRING_SETUP_DONE_RING_ID_S)
  13362. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13363. do { \
  13364. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13365. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13366. } while (0)
  13367. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13368. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13369. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13370. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13371. HTT_SRING_SETUP_DONE_STATUS_S)
  13372. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13373. do { \
  13374. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13375. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13376. } while (0)
  13377. /**
  13378. * @brief target -> flow map flow info
  13379. *
  13380. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13381. *
  13382. * @details
  13383. * HTT TX map flow entry with tqm flow pointer
  13384. * Sent from firmware to host to add tqm flow pointer in corresponding
  13385. * flow search entry. Flow metadata is replayed back to host as part of this
  13386. * struct to enable host to find the specific flow search entry
  13387. *
  13388. * The message would appear as follows:
  13389. *
  13390. * |31 28|27 18|17 14|13 8|7 0|
  13391. * |-------+------------------------------------------+----------------|
  13392. * | rsvd0 | fse_hsh_idx | msg_type |
  13393. * |-------------------------------------------------------------------|
  13394. * | rsvd1 | tid | peer_id |
  13395. * |-------------------------------------------------------------------|
  13396. * | tqm_flow_pntr_lo |
  13397. * |-------------------------------------------------------------------|
  13398. * | tqm_flow_pntr_hi |
  13399. * |-------------------------------------------------------------------|
  13400. * | fse_meta_data |
  13401. * |-------------------------------------------------------------------|
  13402. *
  13403. * The message is interpreted as follows:
  13404. *
  13405. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13406. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13407. *
  13408. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13409. * for this flow entry
  13410. *
  13411. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13412. *
  13413. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13414. *
  13415. * dword1 - b'14:17 - tid
  13416. *
  13417. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13418. *
  13419. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13420. *
  13421. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13422. *
  13423. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13424. * given by host
  13425. */
  13426. PREPACK struct htt_tx_map_flow_info {
  13427. A_UINT32
  13428. msg_type: 8,
  13429. fse_hsh_idx: 20,
  13430. rsvd0: 4;
  13431. A_UINT32
  13432. peer_id: 14,
  13433. tid: 4,
  13434. rsvd1: 14;
  13435. A_UINT32 tqm_flow_pntr_lo;
  13436. A_UINT32 tqm_flow_pntr_hi;
  13437. struct htt_tx_flow_metadata fse_meta_data;
  13438. } POSTPACK;
  13439. /* DWORD 0 */
  13440. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13441. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13442. /* DWORD 1 */
  13443. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13444. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13445. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13446. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13447. /* DWORD 0 */
  13448. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13449. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13450. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13451. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13452. do { \
  13453. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13454. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13455. } while (0)
  13456. /* DWORD 1 */
  13457. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13458. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13459. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13460. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13461. do { \
  13462. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13463. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13464. } while (0)
  13465. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13466. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13467. HTT_TX_MAP_FLOW_INFO_TID_S)
  13468. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13469. do { \
  13470. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13471. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13472. } while (0)
  13473. /*
  13474. * htt_dbg_ext_stats_status -
  13475. * present - The requested stats have been delivered in full.
  13476. * This indicates that either the stats information was contained
  13477. * in its entirety within this message, or else this message
  13478. * completes the delivery of the requested stats info that was
  13479. * partially delivered through earlier STATS_CONF messages.
  13480. * partial - The requested stats have been delivered in part.
  13481. * One or more subsequent STATS_CONF messages with the same
  13482. * cookie value will be sent to deliver the remainder of the
  13483. * information.
  13484. * error - The requested stats could not be delivered, for example due
  13485. * to a shortage of memory to construct a message holding the
  13486. * requested stats.
  13487. * invalid - The requested stat type is either not recognized, or the
  13488. * target is configured to not gather the stats type in question.
  13489. */
  13490. enum htt_dbg_ext_stats_status {
  13491. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13492. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13493. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13494. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13495. };
  13496. /**
  13497. * @brief target -> host ppdu stats upload
  13498. *
  13499. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13500. *
  13501. * @details
  13502. * The following field definitions describe the format of the HTT target
  13503. * to host ppdu stats indication message.
  13504. *
  13505. *
  13506. * |31 16|15 12|11 10|9 8|7 0 |
  13507. * |----------------------------------------------------------------------|
  13508. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13509. * |----------------------------------------------------------------------|
  13510. * | ppdu_id |
  13511. * |----------------------------------------------------------------------|
  13512. * | Timestamp in us |
  13513. * |----------------------------------------------------------------------|
  13514. * | reserved |
  13515. * |----------------------------------------------------------------------|
  13516. * | type-specific stats info |
  13517. * | (see htt_ppdu_stats.h) |
  13518. * |----------------------------------------------------------------------|
  13519. * Header fields:
  13520. * - MSG_TYPE
  13521. * Bits 7:0
  13522. * Purpose: Identifies this is a PPDU STATS indication
  13523. * message.
  13524. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13525. * - mac_id
  13526. * Bits 9:8
  13527. * Purpose: mac_id of this ppdu_id
  13528. * Value: 0-3
  13529. * - pdev_id
  13530. * Bits 11:10
  13531. * Purpose: pdev_id of this ppdu_id
  13532. * Value: 0-3
  13533. * 0 (for rings at SOC level),
  13534. * 1/2/3 PDEV -> 0/1/2
  13535. * - payload_size
  13536. * Bits 31:16
  13537. * Purpose: total tlv size
  13538. * Value: payload_size in bytes
  13539. */
  13540. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13541. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13542. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13543. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13544. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13545. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13546. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13547. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13548. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13549. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13550. do { \
  13551. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13552. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13553. } while (0)
  13554. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13555. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13556. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13557. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13558. do { \
  13559. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13560. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13561. } while (0)
  13562. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13563. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13564. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13565. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13566. do { \
  13567. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13568. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13569. } while (0)
  13570. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13571. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13572. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13573. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13574. do { \
  13575. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13576. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13577. } while (0)
  13578. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13579. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13580. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13581. /* htt_t2h_ppdu_stats_ind_hdr_t
  13582. * This struct contains the fields within the header of the
  13583. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13584. * stats info.
  13585. * This struct assumes little-endian layout, and thus is only
  13586. * suitable for use within processors known to be little-endian
  13587. * (such as the target).
  13588. * In contrast, the above macros provide endian-portable methods
  13589. * to get and set the bitfields within this PPDU_STATS_IND header.
  13590. */
  13591. typedef struct {
  13592. A_UINT32 msg_type: 8, /* bits 7:0 */
  13593. mac_id: 2, /* bits 9:8 */
  13594. pdev_id: 2, /* bits 11:10 */
  13595. reserved1: 4, /* bits 15:12 */
  13596. payload_size: 16; /* bits 31:16 */
  13597. A_UINT32 ppdu_id;
  13598. A_UINT32 timestamp_us;
  13599. A_UINT32 reserved2;
  13600. } htt_t2h_ppdu_stats_ind_hdr_t;
  13601. /**
  13602. * @brief target -> host extended statistics upload
  13603. *
  13604. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13605. *
  13606. * @details
  13607. * The following field definitions describe the format of the HTT target
  13608. * to host stats upload confirmation message.
  13609. * The message contains a cookie echoed from the HTT host->target stats
  13610. * upload request, which identifies which request the confirmation is
  13611. * for, and a single stats can span over multiple HTT stats indication
  13612. * due to the HTT message size limitation so every HTT ext stats indication
  13613. * will have tag-length-value stats information elements.
  13614. * The tag-length header for each HTT stats IND message also includes a
  13615. * status field, to indicate whether the request for the stat type in
  13616. * question was fully met, partially met, unable to be met, or invalid
  13617. * (if the stat type in question is disabled in the target).
  13618. * A Done bit 1's indicate the end of the of stats info elements.
  13619. *
  13620. *
  13621. * |31 16|15 12|11|10 8|7 5|4 0|
  13622. * |--------------------------------------------------------------|
  13623. * | reserved | msg type |
  13624. * |--------------------------------------------------------------|
  13625. * | cookie LSBs |
  13626. * |--------------------------------------------------------------|
  13627. * | cookie MSBs |
  13628. * |--------------------------------------------------------------|
  13629. * | stats entry length | rsvd | D| S | stat type |
  13630. * |--------------------------------------------------------------|
  13631. * | type-specific stats info |
  13632. * | (see htt_stats.h) |
  13633. * |--------------------------------------------------------------|
  13634. * Header fields:
  13635. * - MSG_TYPE
  13636. * Bits 7:0
  13637. * Purpose: Identifies this is a extended statistics upload confirmation
  13638. * message.
  13639. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13640. * - COOKIE_LSBS
  13641. * Bits 31:0
  13642. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13643. * message with its preceding host->target stats request message.
  13644. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13645. * - COOKIE_MSBS
  13646. * Bits 31:0
  13647. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13648. * message with its preceding host->target stats request message.
  13649. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13650. *
  13651. * Stats Information Element tag-length header fields:
  13652. * - STAT_TYPE
  13653. * Bits 7:0
  13654. * Purpose: identifies the type of statistics info held in the
  13655. * following information element
  13656. * Value: htt_dbg_ext_stats_type
  13657. * - STATUS
  13658. * Bits 10:8
  13659. * Purpose: indicate whether the requested stats are present
  13660. * Value: htt_dbg_ext_stats_status
  13661. * - DONE
  13662. * Bits 11
  13663. * Purpose:
  13664. * Indicates the completion of the stats entry, this will be the last
  13665. * stats conf HTT segment for the requested stats type.
  13666. * Value:
  13667. * 0 -> the stats retrieval is ongoing
  13668. * 1 -> the stats retrieval is complete
  13669. * - LENGTH
  13670. * Bits 31:16
  13671. * Purpose: indicate the stats information size
  13672. * Value: This field specifies the number of bytes of stats information
  13673. * that follows the element tag-length header.
  13674. * It is expected but not required that this length is a multiple of
  13675. * 4 bytes.
  13676. */
  13677. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13678. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13679. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13680. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13681. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13682. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13683. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13684. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13685. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13686. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13687. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13688. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13689. do { \
  13690. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13691. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13692. } while (0)
  13693. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13694. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13695. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13696. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13697. do { \
  13698. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13699. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13700. } while (0)
  13701. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13702. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13703. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13704. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13705. do { \
  13706. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13707. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13708. } while (0)
  13709. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13710. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13711. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13712. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13713. do { \
  13714. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13715. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13716. } while (0)
  13717. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13718. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13719. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13720. typedef enum {
  13721. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13722. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13723. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13724. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13725. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13726. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13727. /* Reserved from 128 - 255 for target internal use.*/
  13728. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13729. } HTT_PEER_TYPE;
  13730. /** macro to convert MAC address from char array to HTT word format */
  13731. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13732. (phtt_mac_addr)->mac_addr31to0 = \
  13733. (((c_macaddr)[0] << 0) | \
  13734. ((c_macaddr)[1] << 8) | \
  13735. ((c_macaddr)[2] << 16) | \
  13736. ((c_macaddr)[3] << 24)); \
  13737. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13738. } while (0)
  13739. /**
  13740. * @brief target -> host monitor mac header indication message
  13741. *
  13742. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13743. *
  13744. * @details
  13745. * The following diagram shows the format of the monitor mac header message
  13746. * sent from the target to the host.
  13747. * This message is primarily sent when promiscuous rx mode is enabled.
  13748. * One message is sent per rx PPDU.
  13749. *
  13750. * |31 24|23 16|15 8|7 0|
  13751. * |-------------------------------------------------------------|
  13752. * | peer_id | reserved0 | msg_type |
  13753. * |-------------------------------------------------------------|
  13754. * | reserved1 | num_mpdu |
  13755. * |-------------------------------------------------------------|
  13756. * | struct hw_rx_desc |
  13757. * | (see wal_rx_desc.h) |
  13758. * |-------------------------------------------------------------|
  13759. * | struct ieee80211_frame_addr4 |
  13760. * | (see ieee80211_defs.h) |
  13761. * |-------------------------------------------------------------|
  13762. * | struct ieee80211_frame_addr4 |
  13763. * | (see ieee80211_defs.h) |
  13764. * |-------------------------------------------------------------|
  13765. * | ...... |
  13766. * |-------------------------------------------------------------|
  13767. *
  13768. * Header fields:
  13769. * - msg_type
  13770. * Bits 7:0
  13771. * Purpose: Identifies this is a monitor mac header indication message.
  13772. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13773. * - peer_id
  13774. * Bits 31:16
  13775. * Purpose: Software peer id given by host during association,
  13776. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13777. * for rx PPDUs received from unassociated peers.
  13778. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13779. * - num_mpdu
  13780. * Bits 15:0
  13781. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13782. * delivered within the message.
  13783. * Value: 1 to 32
  13784. * num_mpdu is limited to a maximum value of 32, due to buffer
  13785. * size limits. For PPDUs with more than 32 MPDUs, only the
  13786. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13787. * the PPDU will be provided.
  13788. */
  13789. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13790. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13791. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13792. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13793. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13794. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13795. do { \
  13796. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13797. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13798. } while (0)
  13799. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13800. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13801. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13802. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13803. do { \
  13804. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13805. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13806. } while (0)
  13807. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13808. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13809. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13810. /**
  13811. * @brief target -> host flow pool resize Message
  13812. *
  13813. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13814. *
  13815. * @details
  13816. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13817. * the flow pool associated with the specified ID is resized
  13818. *
  13819. * The message would appear as follows:
  13820. *
  13821. * |31 16|15 8|7 0|
  13822. * |---------------------------------+----------------+----------------|
  13823. * | reserved0 | Msg type |
  13824. * |-------------------------------------------------------------------|
  13825. * | flow pool new size | flow pool ID |
  13826. * |-------------------------------------------------------------------|
  13827. *
  13828. * The message is interpreted as follows:
  13829. * b'0:7 - msg_type: This will be set to 0x21
  13830. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13831. *
  13832. * b'0:15 - flow pool ID: Existing flow pool ID
  13833. *
  13834. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13835. *
  13836. */
  13837. PREPACK struct htt_flow_pool_resize_t {
  13838. A_UINT32 msg_type:8,
  13839. reserved0:24;
  13840. A_UINT32 flow_pool_id:16,
  13841. flow_pool_new_size:16;
  13842. } POSTPACK;
  13843. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13844. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13845. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13846. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13847. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13848. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13849. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13850. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13851. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13852. do { \
  13853. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13854. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13855. } while (0)
  13856. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13857. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13858. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13859. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13860. do { \
  13861. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13862. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13863. } while (0)
  13864. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13865. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13866. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13867. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13868. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13869. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13870. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13871. /*
  13872. * The read and write indices point to the data within the host buffer.
  13873. * Because the first 4 bytes of the host buffer is used for the read index and
  13874. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13875. * The read index and write index are the byte offsets from the base of the
  13876. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13877. * Refer the ASCII text picture below.
  13878. */
  13879. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13880. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13881. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13882. /*
  13883. ***************************************************************************
  13884. *
  13885. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13886. *
  13887. ***************************************************************************
  13888. *
  13889. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13890. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13891. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13892. * written into the Host memory region mentioned below.
  13893. *
  13894. * Read index is updated by the Host. At any point of time, the read index will
  13895. * indicate the index that will next be read by the Host. The read index is
  13896. * in units of bytes offset from the base of the meta-data buffer.
  13897. *
  13898. * Write index is updated by the FW. At any point of time, the write index will
  13899. * indicate from where the FW can start writing any new data. The write index is
  13900. * in units of bytes offset from the base of the meta-data buffer.
  13901. *
  13902. * If the Host is not fast enough in reading the CFR data, any new capture data
  13903. * would be dropped if there is no space left to write the new captures.
  13904. *
  13905. * The last 4 bytes of the memory region will have the magic pattern
  13906. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13907. * not overrun the host buffer.
  13908. *
  13909. * ,--------------------. read and write indices store the
  13910. * | | byte offset from the base of the
  13911. * | ,--------+--------. meta-data buffer to the next
  13912. * | | | | location within the data buffer
  13913. * | | v v that will be read / written
  13914. * ************************************************************************
  13915. * * Read * Write * * Magic *
  13916. * * index * index * CFR data1 ...... CFR data N * pattern *
  13917. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13918. * ************************************************************************
  13919. * |<---------- data buffer ---------->|
  13920. *
  13921. * |<----------------- meta-data buffer allocated in Host ----------------|
  13922. *
  13923. * Note:
  13924. * - Considering the 4 bytes needed to store the Read index (R) and the
  13925. * Write index (W), the initial value is as follows:
  13926. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13927. * - Buffer empty condition:
  13928. * R = W
  13929. *
  13930. * Regarding CFR data format:
  13931. * --------------------------
  13932. *
  13933. * Each CFR tone is stored in HW as 16-bits with the following format:
  13934. * {bits[15:12], bits[11:6], bits[5:0]} =
  13935. * {unsigned exponent (4 bits),
  13936. * signed mantissa_real (6 bits),
  13937. * signed mantissa_imag (6 bits)}
  13938. *
  13939. * CFR_real = mantissa_real * 2^(exponent-5)
  13940. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13941. *
  13942. *
  13943. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13944. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13945. *
  13946. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13947. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13948. * .
  13949. * .
  13950. * .
  13951. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13952. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13953. */
  13954. /* Bandwidth of peer CFR captures */
  13955. typedef enum {
  13956. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13957. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13958. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13959. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13960. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13961. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13962. } HTT_PEER_CFR_CAPTURE_BW;
  13963. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13964. * was captured
  13965. */
  13966. typedef enum {
  13967. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13968. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13969. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13970. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13971. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13972. } HTT_PEER_CFR_CAPTURE_MODE;
  13973. typedef enum {
  13974. /* This message type is currently used for the below purpose:
  13975. *
  13976. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13977. * wmi_peer_cfr_capture_cmd.
  13978. * If payload_present bit is set to 0 then the associated memory region
  13979. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13980. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13981. * message; the CFR dump will be present at the end of the message,
  13982. * after the chan_phy_mode.
  13983. */
  13984. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13985. /* Always keep this last */
  13986. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13987. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13988. /**
  13989. * @brief target -> host CFR dump completion indication message definition
  13990. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13991. *
  13992. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13993. *
  13994. * @details
  13995. * The following diagram shows the format of the Channel Frequency Response
  13996. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13997. * the channel capture of a peer is copied by Firmware into the Host memory
  13998. *
  13999. * **************************************************************************
  14000. *
  14001. * Message format when the CFR capture message type is
  14002. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14003. *
  14004. * **************************************************************************
  14005. *
  14006. * |31 16|15 |8|7 0|
  14007. * |----------------------------------------------------------------|
  14008. * header: | reserved |P| msg_type |
  14009. * word 0 | | | |
  14010. * |----------------------------------------------------------------|
  14011. * payload: | cfr_capture_msg_type |
  14012. * word 1 | |
  14013. * |----------------------------------------------------------------|
  14014. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14015. * word 2 | | | | | | | | |
  14016. * |----------------------------------------------------------------|
  14017. * | mac_addr31to0 |
  14018. * word 3 | |
  14019. * |----------------------------------------------------------------|
  14020. * | unused / reserved | mac_addr47to32 |
  14021. * word 4 | | |
  14022. * |----------------------------------------------------------------|
  14023. * | index |
  14024. * word 5 | |
  14025. * |----------------------------------------------------------------|
  14026. * | length |
  14027. * word 6 | |
  14028. * |----------------------------------------------------------------|
  14029. * | timestamp |
  14030. * word 7 | |
  14031. * |----------------------------------------------------------------|
  14032. * | counter |
  14033. * word 8 | |
  14034. * |----------------------------------------------------------------|
  14035. * | chan_mhz |
  14036. * word 9 | |
  14037. * |----------------------------------------------------------------|
  14038. * | band_center_freq1 |
  14039. * word 10 | |
  14040. * |----------------------------------------------------------------|
  14041. * | band_center_freq2 |
  14042. * word 11 | |
  14043. * |----------------------------------------------------------------|
  14044. * | chan_phy_mode |
  14045. * word 12 | |
  14046. * |----------------------------------------------------------------|
  14047. * where,
  14048. * P - payload present bit (payload_present explained below)
  14049. * req_id - memory request id (mem_req_id explained below)
  14050. * S - status field (status explained below)
  14051. * capbw - capture bandwidth (capture_bw explained below)
  14052. * mode - mode of capture (mode explained below)
  14053. * sts - space time streams (sts_count explained below)
  14054. * chbw - channel bandwidth (channel_bw explained below)
  14055. * captype - capture type (cap_type explained below)
  14056. *
  14057. * The following field definitions describe the format of the CFR dump
  14058. * completion indication sent from the target to the host
  14059. *
  14060. * Header fields:
  14061. *
  14062. * Word 0
  14063. * - msg_type
  14064. * Bits 7:0
  14065. * Purpose: Identifies this as CFR TX completion indication
  14066. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14067. * - payload_present
  14068. * Bit 8
  14069. * Purpose: Identifies how CFR data is sent to host
  14070. * Value: 0 - If CFR Payload is written to host memory
  14071. * 1 - If CFR Payload is sent as part of HTT message
  14072. * (This is the requirement for SDIO/USB where it is
  14073. * not possible to write CFR data to host memory)
  14074. * - reserved
  14075. * Bits 31:9
  14076. * Purpose: Reserved
  14077. * Value: 0
  14078. *
  14079. * Payload fields:
  14080. *
  14081. * Word 1
  14082. * - cfr_capture_msg_type
  14083. * Bits 31:0
  14084. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14085. * to specify the format used for the remainder of the message
  14086. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14087. * (currently only MSG_TYPE_1 is defined)
  14088. *
  14089. * Word 2
  14090. * - mem_req_id
  14091. * Bits 6:0
  14092. * Purpose: Contain the mem request id of the region where the CFR capture
  14093. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14094. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14095. this value is invalid)
  14096. * - status
  14097. * Bit 7
  14098. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14099. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14100. * - capture_bw
  14101. * Bits 10:8
  14102. * Purpose: Carry the bandwidth of the CFR capture
  14103. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14104. * - mode
  14105. * Bits 13:11
  14106. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14107. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14108. * - sts_count
  14109. * Bits 16:14
  14110. * Purpose: Carry the number of space time streams
  14111. * Value: Number of space time streams
  14112. * - channel_bw
  14113. * Bits 19:17
  14114. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14115. * measurement
  14116. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14117. * - cap_type
  14118. * Bits 23:20
  14119. * Purpose: Carry the type of the capture
  14120. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14121. * - vdev_id
  14122. * Bits 31:24
  14123. * Purpose: Carry the virtual device id
  14124. * Value: vdev ID
  14125. *
  14126. * Word 3
  14127. * - mac_addr31to0
  14128. * Bits 31:0
  14129. * Purpose: Contain the bits 31:0 of the peer MAC address
  14130. * Value: Bits 31:0 of the peer MAC address
  14131. *
  14132. * Word 4
  14133. * - mac_addr47to32
  14134. * Bits 15:0
  14135. * Purpose: Contain the bits 47:32 of the peer MAC address
  14136. * Value: Bits 47:32 of the peer MAC address
  14137. *
  14138. * Word 5
  14139. * - index
  14140. * Bits 31:0
  14141. * Purpose: Contain the index at which this CFR dump was written in the Host
  14142. * allocated memory. This index is the number of bytes from the base address.
  14143. * Value: Index position
  14144. *
  14145. * Word 6
  14146. * - length
  14147. * Bits 31:0
  14148. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14149. * Value: Length of the CFR capture of the peer
  14150. *
  14151. * Word 7
  14152. * - timestamp
  14153. * Bits 31:0
  14154. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14155. * clock used for this timestamp is private to the target and not visible to
  14156. * the host i.e., Host can interpret only the relative timestamp deltas from
  14157. * one message to the next, but can't interpret the absolute timestamp from a
  14158. * single message.
  14159. * Value: Timestamp in microseconds
  14160. *
  14161. * Word 8
  14162. * - counter
  14163. * Bits 31:0
  14164. * Purpose: Carry the count of the current CFR capture from FW. This is
  14165. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14166. * in host memory)
  14167. * Value: Count of the current CFR capture
  14168. *
  14169. * Word 9
  14170. * - chan_mhz
  14171. * Bits 31:0
  14172. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14173. * Value: Primary 20 channel frequency
  14174. *
  14175. * Word 10
  14176. * - band_center_freq1
  14177. * Bits 31:0
  14178. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14179. * Value: Center frequency 1 in MHz
  14180. *
  14181. * Word 11
  14182. * - band_center_freq2
  14183. * Bits 31:0
  14184. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14185. * the VDEV
  14186. * 80plus80 mode
  14187. * Value: Center frequency 2 in MHz
  14188. *
  14189. * Word 12
  14190. * - chan_phy_mode
  14191. * Bits 31:0
  14192. * Purpose: Carry the phy mode of the channel, of the VDEV
  14193. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14194. */
  14195. PREPACK struct htt_cfr_dump_ind_type_1 {
  14196. A_UINT32 mem_req_id:7,
  14197. status:1,
  14198. capture_bw:3,
  14199. mode:3,
  14200. sts_count:3,
  14201. channel_bw:3,
  14202. cap_type:4,
  14203. vdev_id:8;
  14204. htt_mac_addr addr;
  14205. A_UINT32 index;
  14206. A_UINT32 length;
  14207. A_UINT32 timestamp;
  14208. A_UINT32 counter;
  14209. struct htt_chan_change_msg chan;
  14210. } POSTPACK;
  14211. PREPACK struct htt_cfr_dump_compl_ind {
  14212. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14213. union {
  14214. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14215. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14216. /* If there is a need to change the memory layout and its associated
  14217. * HTT indication format, a new CFR capture message type can be
  14218. * introduced and added into this union.
  14219. */
  14220. };
  14221. } POSTPACK;
  14222. /*
  14223. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14224. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14225. */
  14226. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14227. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14228. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14229. do { \
  14230. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14231. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14232. } while(0)
  14233. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14234. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14235. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14236. /*
  14237. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14238. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14239. */
  14240. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14241. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14242. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14243. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14244. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14245. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14246. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14247. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14248. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14249. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14250. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14251. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14252. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14253. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14254. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14255. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14256. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14257. do { \
  14258. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14259. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14260. } while (0)
  14261. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14262. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14263. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14264. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14265. do { \
  14266. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14267. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14268. } while (0)
  14269. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14270. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14271. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14272. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14273. do { \
  14274. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14275. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14276. } while (0)
  14277. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14278. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14279. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14280. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14281. do { \
  14282. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14283. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14284. } while (0)
  14285. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14286. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14287. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14288. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14289. do { \
  14290. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14291. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14292. } while (0)
  14293. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14294. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14295. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14296. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14297. do { \
  14298. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14299. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14300. } while (0)
  14301. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14302. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14303. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14304. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14305. do { \
  14306. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14307. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14308. } while (0)
  14309. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14310. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14311. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14312. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14313. do { \
  14314. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14315. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14316. } while (0)
  14317. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14318. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14319. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14320. /**
  14321. * @brief target -> host peer (PPDU) stats message
  14322. *
  14323. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14324. *
  14325. * @details
  14326. * This message is generated by FW when FW is sending stats to host
  14327. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14328. * This message is sent autonomously by the target rather than upon request
  14329. * by the host.
  14330. * The following field definitions describe the format of the HTT target
  14331. * to host peer stats indication message.
  14332. *
  14333. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14334. * or more PPDU stats records.
  14335. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14336. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14337. * then the message would start with the
  14338. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14339. * below.
  14340. *
  14341. * |31 16|15|14|13 11|10 9|8|7 0|
  14342. * |-------------------------------------------------------------|
  14343. * | reserved |MSG_TYPE |
  14344. * |-------------------------------------------------------------|
  14345. * rec 0 | TLV header |
  14346. * rec 0 |-------------------------------------------------------------|
  14347. * rec 0 | ppdu successful bytes |
  14348. * rec 0 |-------------------------------------------------------------|
  14349. * rec 0 | ppdu retry bytes |
  14350. * rec 0 |-------------------------------------------------------------|
  14351. * rec 0 | ppdu failed bytes |
  14352. * rec 0 |-------------------------------------------------------------|
  14353. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14354. * rec 0 |-------------------------------------------------------------|
  14355. * rec 0 | retried MSDUs | successful MSDUs |
  14356. * rec 0 |-------------------------------------------------------------|
  14357. * rec 0 | TX duration | failed MSDUs |
  14358. * rec 0 |-------------------------------------------------------------|
  14359. * ...
  14360. * |-------------------------------------------------------------|
  14361. * rec N | TLV header |
  14362. * rec N |-------------------------------------------------------------|
  14363. * rec N | ppdu successful bytes |
  14364. * rec N |-------------------------------------------------------------|
  14365. * rec N | ppdu retry bytes |
  14366. * rec N |-------------------------------------------------------------|
  14367. * rec N | ppdu failed bytes |
  14368. * rec N |-------------------------------------------------------------|
  14369. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14370. * rec N |-------------------------------------------------------------|
  14371. * rec N | retried MSDUs | successful MSDUs |
  14372. * rec N |-------------------------------------------------------------|
  14373. * rec N | TX duration | failed MSDUs |
  14374. * rec N |-------------------------------------------------------------|
  14375. *
  14376. * where:
  14377. * A = is A-MPDU flag
  14378. * BA = block-ack failure flags
  14379. * BW = bandwidth spec
  14380. * SG = SGI enabled spec
  14381. * S = skipped rate ctrl
  14382. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14383. *
  14384. * Header
  14385. * ------
  14386. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14387. * dword0 - b'8:31 - reserved : Reserved for future use
  14388. *
  14389. * payload include below peer_stats information
  14390. * --------------------------------------------
  14391. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14392. * @tx_success_bytes : total successful bytes in the PPDU.
  14393. * @tx_retry_bytes : total retried bytes in the PPDU.
  14394. * @tx_failed_bytes : total failed bytes in the PPDU.
  14395. * @tx_ratecode : rate code used for the PPDU.
  14396. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14397. * @ba_ack_failed : BA/ACK failed for this PPDU
  14398. * b00 -> BA received
  14399. * b01 -> BA failed once
  14400. * b10 -> BA failed twice, when HW retry is enabled.
  14401. * @bw : BW
  14402. * b00 -> 20 MHz
  14403. * b01 -> 40 MHz
  14404. * b10 -> 80 MHz
  14405. * b11 -> 160 MHz (or 80+80)
  14406. * @sg : SGI enabled
  14407. * @s : skipped ratectrl
  14408. * @peer_id : peer id
  14409. * @tx_success_msdus : successful MSDUs
  14410. * @tx_retry_msdus : retried MSDUs
  14411. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14412. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14413. */
  14414. /**
  14415. * @brief target -> host backpressure event
  14416. *
  14417. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14418. *
  14419. * @details
  14420. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14421. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14422. * This message will only be sent if the backpressure condition has existed
  14423. * continuously for an initial period (100 ms).
  14424. * Repeat messages with updated information will be sent after each
  14425. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14426. * This message indicates the ring id along with current head and tail index
  14427. * locations (i.e. write and read indices).
  14428. * The backpressure time indicates the time in ms for which continous
  14429. * backpressure has been observed in the ring.
  14430. *
  14431. * The message format is as follows:
  14432. *
  14433. * |31 24|23 16|15 8|7 0|
  14434. * |----------------+----------------+----------------+----------------|
  14435. * | ring_id | ring_type | pdev_id | msg_type |
  14436. * |-------------------------------------------------------------------|
  14437. * | tail_idx | head_idx |
  14438. * |-------------------------------------------------------------------|
  14439. * | backpressure_time_ms |
  14440. * |-------------------------------------------------------------------|
  14441. *
  14442. * The message is interpreted as follows:
  14443. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14444. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14445. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14446. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14447. the msg is for LMAC ring.
  14448. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14449. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14450. * htt_backpressure_lmac_ring_id. This represents
  14451. * the ring id for which continous backpressure is seen
  14452. *
  14453. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14454. * the ring indicated by the ring_id
  14455. *
  14456. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14457. * the ring indicated by the ring id
  14458. *
  14459. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14460. * backpressure has been seen in the ring
  14461. * indicated by the ring_id.
  14462. * Units = milliseconds
  14463. */
  14464. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14465. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14466. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14467. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14468. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14469. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14470. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14471. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14472. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14473. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14474. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14475. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14476. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14477. do { \
  14478. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14479. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14480. } while (0)
  14481. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14482. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14483. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14484. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14485. do { \
  14486. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14487. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14488. } while (0)
  14489. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14490. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14491. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14492. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14493. do { \
  14494. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14495. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14496. } while (0)
  14497. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14498. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14499. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14500. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14501. do { \
  14502. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14503. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14504. } while (0)
  14505. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14506. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14507. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14508. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14509. do { \
  14510. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14511. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14512. } while (0)
  14513. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14514. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14515. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14516. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14517. do { \
  14518. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14519. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14520. } while (0)
  14521. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14522. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14523. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14524. enum htt_backpressure_ring_type {
  14525. HTT_SW_RING_TYPE_UMAC,
  14526. HTT_SW_RING_TYPE_LMAC,
  14527. HTT_SW_RING_TYPE_MAX,
  14528. };
  14529. /* Ring id for which the message is sent to host */
  14530. enum htt_backpressure_umac_ringid {
  14531. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14532. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14533. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14534. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14535. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14536. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14537. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14538. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14539. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14540. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14541. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14542. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14543. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14544. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14545. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14546. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14547. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14548. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14549. HTT_SW_UMAC_RING_IDX_MAX,
  14550. };
  14551. enum htt_backpressure_lmac_ringid {
  14552. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14553. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14554. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14555. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14556. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14557. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14558. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14559. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14560. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14561. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14562. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14563. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14564. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14565. HTT_SW_LMAC_RING_IDX_MAX,
  14566. };
  14567. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14568. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14569. pdev_id: 8,
  14570. ring_type: 8, /* htt_backpressure_ring_type */
  14571. /*
  14572. * ring_id holds an enum value from either
  14573. * htt_backpressure_umac_ringid or
  14574. * htt_backpressure_lmac_ringid, based on
  14575. * the ring_type setting.
  14576. */
  14577. ring_id: 8;
  14578. A_UINT16 head_idx;
  14579. A_UINT16 tail_idx;
  14580. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14581. } POSTPACK;
  14582. /*
  14583. * Defines two 32 bit words that can be used by the target to indicate a per
  14584. * user RU allocation and rate information.
  14585. *
  14586. * This information is currently provided in the "sw_response_reference_ptr"
  14587. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14588. * "rx_ppdu_end_user_stats" TLV.
  14589. *
  14590. * VALID:
  14591. * The consumer of these words must explicitly check the valid bit,
  14592. * and only attempt interpretation of any of the remaining fields if
  14593. * the valid bit is set to 1.
  14594. *
  14595. * VERSION:
  14596. * The consumer of these words must also explicitly check the version bit,
  14597. * and only use the V0 definition if the VERSION field is set to 0.
  14598. *
  14599. * Version 1 is currently undefined, with the exception of the VALID and
  14600. * VERSION fields.
  14601. *
  14602. * Version 0:
  14603. *
  14604. * The fields below are duplicated per BW.
  14605. *
  14606. * The consumer must determine which BW field to use, based on the UL OFDMA
  14607. * PPDU BW indicated by HW.
  14608. *
  14609. * RU_START: RU26 start index for the user.
  14610. * Note that this is always using the RU26 index, regardless
  14611. * of the actual RU assigned to the user
  14612. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14613. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14614. *
  14615. * For example, 20MHz (the value in the top row is RU_START)
  14616. *
  14617. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14618. * RU Size 1 (52): | | | | | |
  14619. * RU Size 2 (106): | | | |
  14620. * RU Size 3 (242): | |
  14621. *
  14622. * RU_SIZE: Indicates the RU size, as defined by enum
  14623. * htt_ul_ofdma_user_info_ru_size.
  14624. *
  14625. * LDPC: LDPC enabled (if 0, BCC is used)
  14626. *
  14627. * DCM: DCM enabled
  14628. *
  14629. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14630. * |---------------------------------+--------------------------------|
  14631. * |Ver|Valid| FW internal |
  14632. * |---------------------------------+--------------------------------|
  14633. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14634. * |---------------------------------+--------------------------------|
  14635. */
  14636. enum htt_ul_ofdma_user_info_ru_size {
  14637. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14638. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14639. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14640. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14641. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14642. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14643. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14644. };
  14645. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14646. struct htt_ul_ofdma_user_info_v0 {
  14647. A_UINT32 word0;
  14648. A_UINT32 word1;
  14649. };
  14650. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14651. A_UINT32 w0_fw_rsvd:30; \
  14652. A_UINT32 w0_valid:1; \
  14653. A_UINT32 w0_version:1;
  14654. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14655. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14656. };
  14657. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14658. A_UINT32 w1_nss:3; \
  14659. A_UINT32 w1_mcs:4; \
  14660. A_UINT32 w1_ldpc:1; \
  14661. A_UINT32 w1_dcm:1; \
  14662. A_UINT32 w1_ru_start:7; \
  14663. A_UINT32 w1_ru_size:3; \
  14664. A_UINT32 w1_trig_type:4; \
  14665. A_UINT32 w1_unused:9;
  14666. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14667. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14668. };
  14669. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14670. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14671. union {
  14672. A_UINT32 word0;
  14673. struct {
  14674. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14675. };
  14676. };
  14677. union {
  14678. A_UINT32 word1;
  14679. struct {
  14680. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14681. };
  14682. };
  14683. } POSTPACK;
  14684. enum HTT_UL_OFDMA_TRIG_TYPE {
  14685. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14686. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14687. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14688. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14689. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14690. };
  14691. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14692. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14693. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14694. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14695. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14696. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14697. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14698. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14699. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14700. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14701. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14702. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14703. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14704. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14705. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14706. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14707. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14708. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14709. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14710. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14711. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14712. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14713. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14714. /*--- word 0 ---*/
  14715. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14716. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14717. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14718. do { \
  14719. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14720. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14721. } while (0)
  14722. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14723. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14724. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14725. do { \
  14726. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14727. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14728. } while (0)
  14729. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14730. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14731. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14732. do { \
  14733. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14734. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14735. } while (0)
  14736. /*--- word 1 ---*/
  14737. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14738. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14739. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14740. do { \
  14741. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14742. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14743. } while (0)
  14744. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14745. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14746. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14747. do { \
  14748. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14749. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14750. } while (0)
  14751. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14752. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14753. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14754. do { \
  14755. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14756. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14757. } while (0)
  14758. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14759. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14760. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14761. do { \
  14762. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14763. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14764. } while (0)
  14765. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14766. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14767. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14768. do { \
  14769. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14770. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14771. } while (0)
  14772. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14773. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14774. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14775. do { \
  14776. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14777. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14778. } while (0)
  14779. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14780. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14781. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14782. do { \
  14783. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14784. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14785. } while (0)
  14786. /**
  14787. * @brief target -> host channel calibration data message
  14788. *
  14789. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14790. *
  14791. * @brief host -> target channel calibration data message
  14792. *
  14793. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14794. *
  14795. * @details
  14796. * The following field definitions describe the format of the channel
  14797. * calibration data message sent from the target to the host when
  14798. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14799. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14800. * The message is defined as htt_chan_caldata_msg followed by a variable
  14801. * number of 32-bit character values.
  14802. *
  14803. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14804. * |------------------------------------------------------------------|
  14805. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14806. * |------------------------------------------------------------------|
  14807. * | payload size | mhz |
  14808. * |------------------------------------------------------------------|
  14809. * | center frequency 2 | center frequency 1 |
  14810. * |------------------------------------------------------------------|
  14811. * | check sum |
  14812. * |------------------------------------------------------------------|
  14813. * | payload |
  14814. * |------------------------------------------------------------------|
  14815. * message info field:
  14816. * - MSG_TYPE
  14817. * Bits 7:0
  14818. * Purpose: identifies this as a channel calibration data message
  14819. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14820. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14821. * - SUB_TYPE
  14822. * Bits 11:8
  14823. * Purpose: T2H: indicates whether target is providing chan cal data
  14824. * to the host to store, or requesting that the host
  14825. * download previously-stored data.
  14826. * H2T: indicates whether the host is providing the requested
  14827. * channel cal data, or if it is rejecting the data
  14828. * request because it does not have the requested data.
  14829. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14830. * - CHKSUM_VALID
  14831. * Bit 12
  14832. * Purpose: indicates if the checksum field is valid
  14833. * value:
  14834. * - FRAG
  14835. * Bit 19:16
  14836. * Purpose: indicates the fragment index for message
  14837. * value: 0 for first fragment, 1 for second fragment, ...
  14838. * - APPEND
  14839. * Bit 20
  14840. * Purpose: indicates if this is the last fragment
  14841. * value: 0 = final fragment, 1 = more fragments will be appended
  14842. *
  14843. * channel and payload size field
  14844. * - MHZ
  14845. * Bits 15:0
  14846. * Purpose: indicates the channel primary frequency
  14847. * Value:
  14848. * - PAYLOAD_SIZE
  14849. * Bits 31:16
  14850. * Purpose: indicates the bytes of calibration data in payload
  14851. * Value:
  14852. *
  14853. * center frequency field
  14854. * - CENTER FREQUENCY 1
  14855. * Bits 15:0
  14856. * Purpose: indicates the channel center frequency
  14857. * Value: channel center frequency, in MHz units
  14858. * - CENTER FREQUENCY 2
  14859. * Bits 31:16
  14860. * Purpose: indicates the secondary channel center frequency,
  14861. * only for 11acvht 80plus80 mode
  14862. * Value: secondary channel center frequeny, in MHz units, if applicable
  14863. *
  14864. * checksum field
  14865. * - CHECK_SUM
  14866. * Bits 31:0
  14867. * Purpose: check the payload data, it is just for this fragment.
  14868. * This is intended for the target to check that the channel
  14869. * calibration data returned by the host is the unmodified data
  14870. * that was previously provided to the host by the target.
  14871. * value: checksum of fragment payload
  14872. */
  14873. PREPACK struct htt_chan_caldata_msg {
  14874. /* DWORD 0: message info */
  14875. A_UINT32
  14876. msg_type: 8,
  14877. sub_type: 4 ,
  14878. chksum_valid: 1, /** 1:valid, 0:invalid */
  14879. reserved1: 3,
  14880. frag_idx: 4, /** fragment index for calibration data */
  14881. appending: 1, /** 0: no fragment appending,
  14882. * 1: extra fragment appending */
  14883. reserved2: 11;
  14884. /* DWORD 1: channel and payload size */
  14885. A_UINT32
  14886. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14887. payload_size: 16; /** unit: bytes */
  14888. /* DWORD 2: center frequency */
  14889. A_UINT32
  14890. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14891. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14892. * valid only for 11acvht 80plus80 mode */
  14893. /* DWORD 3: check sum */
  14894. A_UINT32 chksum;
  14895. /* variable length for calibration data */
  14896. A_UINT32 payload[1/* or more */];
  14897. } POSTPACK;
  14898. /* T2H SUBTYPE */
  14899. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14900. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14901. /* H2T SUBTYPE */
  14902. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14903. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14904. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14905. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14906. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14907. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14908. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14909. do { \
  14910. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14911. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14912. } while (0)
  14913. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14914. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14915. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14916. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14917. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14918. do { \
  14919. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14920. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14921. } while (0)
  14922. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14923. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14924. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14925. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14926. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14927. do { \
  14928. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14929. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14930. } while (0)
  14931. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14932. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14933. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14934. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14935. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14936. do { \
  14937. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14938. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14939. } while (0)
  14940. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14941. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14942. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14943. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14944. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14945. do { \
  14946. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14947. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14948. } while (0)
  14949. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14950. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14951. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14952. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14953. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14954. do { \
  14955. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14956. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14957. } while (0)
  14958. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14959. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14960. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14961. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14962. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14963. do { \
  14964. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14965. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14966. } while (0)
  14967. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14968. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14969. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14970. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14971. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14972. do { \
  14973. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14974. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14975. } while (0)
  14976. /**
  14977. * @brief target -> host FSE CMEM based send
  14978. *
  14979. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14980. *
  14981. * @details
  14982. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14983. * FSE placement in CMEM is enabled.
  14984. *
  14985. * This message sends the non-secure CMEM base address.
  14986. * It will be sent to host in response to message
  14987. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14988. * The message would appear as follows:
  14989. *
  14990. * |31 24|23 16|15 8|7 0|
  14991. * |----------------+----------------+----------------+----------------|
  14992. * | reserved | num_entries | msg_type |
  14993. * |----------------+----------------+----------------+----------------|
  14994. * | base_address_lo |
  14995. * |----------------+----------------+----------------+----------------|
  14996. * | base_address_hi |
  14997. * |-------------------------------------------------------------------|
  14998. *
  14999. * The message is interpreted as follows:
  15000. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15001. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15002. * b'8:15 - number_entries: Indicated the number of entries
  15003. * programmed.
  15004. * b'16:31 - reserved.
  15005. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15006. * CMEM base address
  15007. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15008. * CMEM base address
  15009. */
  15010. PREPACK struct htt_cmem_base_send_t {
  15011. A_UINT32 msg_type: 8,
  15012. num_entries: 8,
  15013. reserved: 16;
  15014. A_UINT32 base_address_lo;
  15015. A_UINT32 base_address_hi;
  15016. } POSTPACK;
  15017. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15018. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15019. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15020. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15021. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15022. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15023. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15024. do { \
  15025. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15026. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15027. } while (0)
  15028. /**
  15029. * @brief - HTT PPDU ID format
  15030. *
  15031. * @details
  15032. * The following field definitions describe the format of the PPDU ID.
  15033. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15034. *
  15035. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15036. * +--------------------------------------------------------------------------
  15037. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15038. * +--------------------------------------------------------------------------
  15039. *
  15040. * sch id :Schedule command id
  15041. * Bits [11 : 0] : monotonically increasing counter to track the
  15042. * PPDU posted to a specific transmit queue.
  15043. *
  15044. * hwq_id: Hardware Queue ID.
  15045. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15046. *
  15047. * mac_id: MAC ID
  15048. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15049. *
  15050. * seq_idx: Sequence index.
  15051. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15052. * a particular TXOP.
  15053. *
  15054. * tqm_cmd: HWSCH/TQM flag.
  15055. * Bit [23] : Always set to 0.
  15056. *
  15057. * seq_cmd_type: Sequence command type.
  15058. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15059. * Refer to enum HTT_STATS_FTYPE for values.
  15060. */
  15061. PREPACK struct htt_ppdu_id {
  15062. A_UINT32
  15063. sch_id: 12,
  15064. hwq_id: 5,
  15065. mac_id: 2,
  15066. seq_idx: 2,
  15067. reserved1: 2,
  15068. tqm_cmd: 1,
  15069. seq_cmd_type: 6,
  15070. reserved2: 2;
  15071. } POSTPACK;
  15072. #define HTT_PPDU_ID_SCH_ID_S 0
  15073. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15074. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15075. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15076. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15077. do { \
  15078. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15079. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15080. } while (0)
  15081. #define HTT_PPDU_ID_HWQ_ID_S 12
  15082. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15083. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15084. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15085. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15086. do { \
  15087. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15088. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15089. } while (0)
  15090. #define HTT_PPDU_ID_MAC_ID_S 17
  15091. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15092. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15093. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15094. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15095. do { \
  15096. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15097. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15098. } while (0)
  15099. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15100. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15101. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15102. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15103. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15104. do { \
  15105. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15106. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15107. } while (0)
  15108. #define HTT_PPDU_ID_TQM_CMD_S 23
  15109. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15110. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15111. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15112. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15113. do { \
  15114. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15115. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15116. } while (0)
  15117. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15118. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15119. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15120. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15121. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15122. do { \
  15123. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15124. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15125. } while (0)
  15126. /**
  15127. * @brief target -> RX PEER METADATA V0 format
  15128. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15129. * message from target, and will confirm to the target which peer metadata
  15130. * version to use in the wmi_init message.
  15131. *
  15132. * The following diagram shows the format of the RX PEER METADATA.
  15133. *
  15134. * |31 24|23 16|15 8|7 0|
  15135. * |-----------------------------------------------------------------------|
  15136. * | Reserved | VDEV ID | PEER ID |
  15137. * |-----------------------------------------------------------------------|
  15138. */
  15139. PREPACK struct htt_rx_peer_metadata_v0 {
  15140. A_UINT32
  15141. peer_id: 16,
  15142. vdev_id: 8,
  15143. reserved1: 8;
  15144. } POSTPACK;
  15145. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15146. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15147. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15148. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15149. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15150. do { \
  15151. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15152. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15153. } while (0)
  15154. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15155. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15156. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15157. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15158. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15159. do { \
  15160. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15161. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15162. } while (0)
  15163. /**
  15164. * @brief target -> RX PEER METADATA V1 format
  15165. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15166. * message from target, and will confirm to the target which peer metadata
  15167. * version to use in the wmi_init message.
  15168. *
  15169. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15170. *
  15171. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15172. * |-----------------------------------------------------------------------|
  15173. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15174. * |-----------------------------------------------------------------------|
  15175. */
  15176. PREPACK struct htt_rx_peer_metadata_v1 {
  15177. A_UINT32
  15178. peer_id: 13,
  15179. ml_peer_valid: 1,
  15180. reserved1: 2,
  15181. vdev_id: 8,
  15182. lmac_id: 2,
  15183. chip_id: 3,
  15184. reserved2: 3;
  15185. } POSTPACK;
  15186. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15187. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15188. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15189. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15190. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15191. do { \
  15192. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15193. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15194. } while (0)
  15195. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15196. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15197. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15198. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15199. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15200. do { \
  15201. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15202. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15203. } while (0)
  15204. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15205. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15206. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15207. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15208. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15209. do { \
  15210. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15211. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15212. } while (0)
  15213. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15214. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15215. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15216. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15217. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15218. do { \
  15219. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15220. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15221. } while (0)
  15222. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15223. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15224. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15225. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15226. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15227. do { \
  15228. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15229. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15230. } while (0)
  15231. /*
  15232. * In some systems, the host SW wants to specify priorities between
  15233. * different MSDU / flow queues within the same peer-TID.
  15234. * The below enums are used for the host to identify to the target
  15235. * which MSDU queue's priority it wants to adjust.
  15236. */
  15237. /*
  15238. * The MSDUQ index describe index of TCL HW, where each index is
  15239. * used for queuing particular types of MSDUs.
  15240. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15241. */
  15242. enum HTT_MSDUQ_INDEX {
  15243. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15244. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15245. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15246. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15247. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15248. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15249. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15250. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15251. HTT_MSDUQ_MAX_INDEX,
  15252. };
  15253. /* MSDU qtype definition */
  15254. enum HTT_MSDU_QTYPE {
  15255. /*
  15256. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15257. * relative priority. Instead, the relative priority of CRIT_0 versus
  15258. * CRIT_1 is controlled by the FW, through the configuration parameters
  15259. * it applies to the queues.
  15260. */
  15261. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15262. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15263. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15264. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15265. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15266. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15267. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15268. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15269. /* New MSDU_QTYPE should be added above this line */
  15270. /*
  15271. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15272. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15273. * any host/target message definitions. The QTYPE_MAX value can
  15274. * only be used internally within the host or within the target.
  15275. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15276. * it must regard the unexpected value as a default qtype value,
  15277. * or ignore it.
  15278. */
  15279. HTT_MSDU_QTYPE_MAX,
  15280. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15281. };
  15282. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15283. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15284. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15285. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15286. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15287. };
  15288. /**
  15289. * @brief target -> host mlo timestamp offset indication
  15290. *
  15291. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15292. *
  15293. * @details
  15294. * The following field definitions describe the format of the HTT target
  15295. * to host mlo timestamp offset indication message.
  15296. *
  15297. *
  15298. * |31 16|15 12|11 10|9 8|7 0 |
  15299. * |----------------------------------------------------------------------|
  15300. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15301. * |----------------------------------------------------------------------|
  15302. * | Sync time stamp lo in us |
  15303. * |----------------------------------------------------------------------|
  15304. * | Sync time stamp hi in us |
  15305. * |----------------------------------------------------------------------|
  15306. * | mlo time stamp offset lo in us |
  15307. * |----------------------------------------------------------------------|
  15308. * | mlo time stamp offset hi in us |
  15309. * |----------------------------------------------------------------------|
  15310. * | mlo time stamp offset clocks in clock ticks |
  15311. * |----------------------------------------------------------------------|
  15312. * |31 26|25 16|15 0 |
  15313. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15314. * | | compensation in clks | |
  15315. * |----------------------------------------------------------------------|
  15316. * |31 22|21 0 |
  15317. * | rsvd 3 | mlo time stamp comp timer period |
  15318. * |----------------------------------------------------------------------|
  15319. * The message is interpreted as follows:
  15320. *
  15321. * dword0 - b'0:7 - msg_type: This will be set to
  15322. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15323. * value: 0x28
  15324. *
  15325. * dword0 - b'9:8 - pdev_id
  15326. *
  15327. * dword0 - b'11:10 - chip_id
  15328. *
  15329. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15330. *
  15331. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15332. *
  15333. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15334. * which last sync interrupt was received
  15335. *
  15336. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15337. * which last sync interrupt was received
  15338. *
  15339. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15340. *
  15341. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15342. *
  15343. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15344. *
  15345. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15346. *
  15347. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15348. * for sub us resolution
  15349. *
  15350. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15351. *
  15352. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15353. * is applied, in us
  15354. *
  15355. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15356. */
  15357. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15358. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15359. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15360. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15361. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15362. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15363. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15364. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15365. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15366. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15367. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15368. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15369. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15370. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15371. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15372. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15373. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15374. do { \
  15375. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15376. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15377. } while (0)
  15378. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15379. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15380. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15381. do { \
  15382. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15383. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15384. } while (0)
  15385. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15386. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15387. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15388. do { \
  15389. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15390. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15391. } while (0)
  15392. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15393. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15394. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15395. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15396. do { \
  15397. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15398. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15399. } while (0)
  15400. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15401. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15402. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15403. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15404. do { \
  15405. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15406. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15407. } while (0)
  15408. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15409. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15410. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15411. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15412. do { \
  15413. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15414. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15415. } while (0)
  15416. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15417. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15418. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15419. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15420. do { \
  15421. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15422. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15423. } while (0)
  15424. typedef struct {
  15425. A_UINT32 msg_type: 8, /* bits 7:0 */
  15426. pdev_id: 2, /* bits 9:8 */
  15427. chip_id: 2, /* bits 11:10 */
  15428. reserved1: 4, /* bits 15:12 */
  15429. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15430. A_UINT32 sync_timestamp_lo_us;
  15431. A_UINT32 sync_timestamp_hi_us;
  15432. A_UINT32 mlo_timestamp_offset_lo_us;
  15433. A_UINT32 mlo_timestamp_offset_hi_us;
  15434. A_UINT32 mlo_timestamp_offset_clks;
  15435. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15436. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15437. reserved2: 6; /* bits 31:26 */
  15438. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15439. reserved3: 10; /* bits 31:22 */
  15440. } htt_t2h_mlo_offset_ind_t;
  15441. /*
  15442. * @brief target -> host VDEV TX RX STATS
  15443. *
  15444. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15445. *
  15446. * @details
  15447. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15448. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15449. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15450. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15451. * periodically by target even in the absence of any further HTT request
  15452. * messages from host.
  15453. *
  15454. * The message is formatted as follows:
  15455. *
  15456. * |31 16|15 8|7 0|
  15457. * |---------------------------------+----------------+----------------|
  15458. * | payload_size | pdev_id | msg_type |
  15459. * |---------------------------------+----------------+----------------|
  15460. * | reserved0 |
  15461. * |-------------------------------------------------------------------|
  15462. * | reserved1 |
  15463. * |-------------------------------------------------------------------|
  15464. * | reserved2 |
  15465. * |-------------------------------------------------------------------|
  15466. * | |
  15467. * | VDEV specific Tx Rx stats info |
  15468. * | |
  15469. * |-------------------------------------------------------------------|
  15470. *
  15471. * The message is interpreted as follows:
  15472. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15473. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15474. * b'8:15 - pdev_id
  15475. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15476. * message header fields (msg_type through reserved2)
  15477. * dword1 - b'0:31 - reserved0.
  15478. * dword2 - b'0:31 - reserved1.
  15479. * dword3 - b'0:31 - reserved2.
  15480. */
  15481. typedef struct {
  15482. A_UINT32 msg_type: 8,
  15483. pdev_id: 8,
  15484. payload_size: 16;
  15485. A_UINT32 reserved0;
  15486. A_UINT32 reserved1;
  15487. A_UINT32 reserved2;
  15488. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15489. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15490. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15491. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15492. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15493. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15494. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15495. do { \
  15496. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15497. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15498. } while (0)
  15499. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15500. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15501. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15502. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15503. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15504. do { \
  15505. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15506. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15507. } while (0)
  15508. /* SOC related stats */
  15509. typedef struct {
  15510. htt_tlv_hdr_t tlv_hdr;
  15511. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15512. * This can be due to either the peer is deleted or deletion is ongoing
  15513. * */
  15514. A_UINT32 inv_peers_msdu_drop_count_lo;
  15515. A_UINT32 inv_peers_msdu_drop_count_hi;
  15516. } htt_t2h_soc_txrx_stats_common_tlv;
  15517. /* VDEV HW Tx/Rx stats */
  15518. typedef struct {
  15519. htt_tlv_hdr_t tlv_hdr;
  15520. A_UINT32 vdev_id;
  15521. /* Rx msdu byte cnt */
  15522. A_UINT32 rx_msdu_byte_cnt_lo;
  15523. A_UINT32 rx_msdu_byte_cnt_hi;
  15524. /* Rx msdu cnt */
  15525. A_UINT32 rx_msdu_cnt_lo;
  15526. A_UINT32 rx_msdu_cnt_hi;
  15527. /* tx msdu byte cnt */
  15528. A_UINT32 tx_msdu_byte_cnt_lo;
  15529. A_UINT32 tx_msdu_byte_cnt_hi;
  15530. /* tx msdu cnt */
  15531. A_UINT32 tx_msdu_cnt_lo;
  15532. A_UINT32 tx_msdu_cnt_hi;
  15533. /* tx excessive retry discarded msdu cnt */
  15534. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15535. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15536. /* TX congestion ctrl msdu drop cnt */
  15537. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15538. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15539. /* discarded tx msdus cnt coz of time to live expiry */
  15540. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15541. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15542. /* tx excessive retry discarded msdu byte cnt */
  15543. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15544. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15545. /* TX congestion ctrl msdu drop byte cnt */
  15546. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15547. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15548. /* discarded tx msdus byte cnt coz of time to live expiry */
  15549. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15550. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15551. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15552. #endif