htt.h 884 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. * 3.112 Add logical_link_id field in rx_peer_metadata_v1.
  233. */
  234. #define HTT_CURRENT_VERSION_MAJOR 3
  235. #define HTT_CURRENT_VERSION_MINOR 112
  236. #define HTT_NUM_TX_FRAG_DESC 1024
  237. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  238. #define HTT_CHECK_SET_VAL(field, val) \
  239. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  240. /* macros to assist in sign-extending fields from HTT messages */
  241. #define HTT_SIGN_BIT_MASK(field) \
  242. ((field ## _M + (1 << field ## _S)) >> 1)
  243. #define HTT_SIGN_BIT(_val, field) \
  244. (_val & HTT_SIGN_BIT_MASK(field))
  245. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  246. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  247. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  248. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  249. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  250. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  251. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  252. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  253. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  254. /*
  255. * TEMPORARY:
  256. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  257. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  258. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  259. * updated.
  260. */
  261. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  262. /*
  263. * TEMPORARY:
  264. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  265. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  266. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  267. * updated.
  268. */
  269. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  270. /**
  271. * htt_dbg_stats_type -
  272. * bit positions for each stats type within a stats type bitmask
  273. * The bitmask contains 24 bits.
  274. */
  275. enum htt_dbg_stats_type {
  276. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  277. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  278. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  279. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  280. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  281. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  282. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  283. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  284. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  285. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  286. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  287. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  288. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  289. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  290. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  291. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  292. /* bits 16-23 currently reserved */
  293. /* keep this last */
  294. HTT_DBG_NUM_STATS
  295. };
  296. /*=== HTT option selection TLVs ===
  297. * Certain HTT messages have alternatives or options.
  298. * For such cases, the host and target need to agree on which option to use.
  299. * Option specification TLVs can be appended to the VERSION_REQ and
  300. * VERSION_CONF messages to select options other than the default.
  301. * These TLVs are entirely optional - if they are not provided, there is a
  302. * well-defined default for each option. If they are provided, they can be
  303. * provided in any order. Each TLV can be present or absent independent of
  304. * the presence / absence of other TLVs.
  305. *
  306. * The HTT option selection TLVs use the following format:
  307. * |31 16|15 8|7 0|
  308. * |---------------------------------+----------------+----------------|
  309. * | value (payload) | length | tag |
  310. * |-------------------------------------------------------------------|
  311. * The value portion need not be only 2 bytes; it can be extended by any
  312. * integer number of 4-byte units. The total length of the TLV, including
  313. * the tag and length fields, must be a multiple of 4 bytes. The length
  314. * field specifies the total TLV size in 4-byte units. Thus, the typical
  315. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  316. * field, would store 0x1 in its length field, to show that the TLV occupies
  317. * a single 4-byte unit.
  318. */
  319. /*--- TLV header format - applies to all HTT option TLVs ---*/
  320. enum HTT_OPTION_TLV_TAGS {
  321. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  322. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  323. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  324. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  325. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  326. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  327. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  328. };
  329. #define HTT_TCL_METADATA_VER_SZ 4
  330. PREPACK struct htt_option_tlv_header_t {
  331. A_UINT8 tag;
  332. A_UINT8 length;
  333. } POSTPACK;
  334. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  335. #define HTT_OPTION_TLV_TAG_S 0
  336. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  337. #define HTT_OPTION_TLV_LENGTH_S 8
  338. /*
  339. * value0 - 16 bit value field stored in word0
  340. * The TLV's value field may be longer than 2 bytes, in which case
  341. * the remainder of the value is stored in word1, word2, etc.
  342. */
  343. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  344. #define HTT_OPTION_TLV_VALUE0_S 16
  345. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  346. do { \
  347. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  348. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  349. } while (0)
  350. #define HTT_OPTION_TLV_TAG_GET(word) \
  351. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  352. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  353. do { \
  354. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  355. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  356. } while (0)
  357. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  358. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  359. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  360. do { \
  361. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  362. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  363. } while (0)
  364. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  365. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  366. /*--- format of specific HTT option TLVs ---*/
  367. /*
  368. * HTT option TLV for specifying LL bus address size
  369. * Some chips require bus addresses used by the target to access buffers
  370. * within the host's memory to be 32 bits; others require bus addresses
  371. * used by the target to access buffers within the host's memory to be
  372. * 64 bits.
  373. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  374. * a suffix to the VERSION_CONF message to specify which bus address format
  375. * the target requires.
  376. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  377. * default to providing bus addresses to the target in 32-bit format.
  378. */
  379. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  380. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  381. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  382. };
  383. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  384. struct htt_option_tlv_header_t hdr;
  385. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  386. } POSTPACK;
  387. /*
  388. * HTT option TLV for specifying whether HL systems should indicate
  389. * over-the-air tx completion for individual frames, or should instead
  390. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  391. * requests an OTA tx completion for a particular tx frame.
  392. * This option does not apply to LL systems, where the TX_COMPL_IND
  393. * is mandatory.
  394. * This option is primarily intended for HL systems in which the tx frame
  395. * downloads over the host --> target bus are as slow as or slower than
  396. * the transmissions over the WLAN PHY. For cases where the bus is faster
  397. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  398. * and consequently will send one TX_COMPL_IND message that covers several
  399. * tx frames. For cases where the WLAN PHY is faster than the bus,
  400. * the target will end up transmitting very short A-MPDUs, and consequently
  401. * sending many TX_COMPL_IND messages, which each cover a very small number
  402. * of tx frames.
  403. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  404. * a suffix to the VERSION_REQ message to request whether the host desires to
  405. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  406. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  407. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  408. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  409. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  410. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  411. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  412. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  413. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  414. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  415. * TLV.
  416. */
  417. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  418. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  419. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  420. };
  421. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  422. struct htt_option_tlv_header_t hdr;
  423. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  424. } POSTPACK;
  425. /*
  426. * HTT option TLV for specifying how many tx queue groups the target
  427. * may establish.
  428. * This TLV specifies the maximum value the target may send in the
  429. * txq_group_id field of any TXQ_GROUP information elements sent by
  430. * the target to the host. This allows the host to pre-allocate an
  431. * appropriate number of tx queue group structs.
  432. *
  433. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  434. * a suffix to the VERSION_REQ message to specify whether the host supports
  435. * tx queue groups at all, and if so if there is any limit on the number of
  436. * tx queue groups that the host supports.
  437. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  438. * a suffix to the VERSION_CONF message. If the host has specified in the
  439. * VER_REQ message a limit on the number of tx queue groups the host can
  440. * support, the target shall limit its specification of the maximum tx groups
  441. * to be no larger than this host-specified limit.
  442. *
  443. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  444. * shall preallocate 4 tx queue group structs, and the target shall not
  445. * specify a txq_group_id larger than 3.
  446. */
  447. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  448. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  449. /*
  450. * values 1 through N specify the max number of tx queue groups
  451. * the sender supports
  452. */
  453. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  454. };
  455. /* TEMPORARY backwards-compatibility alias for a typo fix -
  456. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  457. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  458. * to support the old name (with the typo) until all references to the
  459. * old name are replaced with the new name.
  460. */
  461. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  462. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  463. struct htt_option_tlv_header_t hdr;
  464. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  465. } POSTPACK;
  466. /*
  467. * HTT option TLV for specifying whether the target supports an extended
  468. * version of the HTT tx descriptor. If the target provides this TLV
  469. * and specifies in the TLV that the target supports an extended version
  470. * of the HTT tx descriptor, the target must check the "extension" bit in
  471. * the HTT tx descriptor, and if the extension bit is set, to expect a
  472. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  473. * descriptor. Furthermore, the target must provide room for the HTT
  474. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  475. * This option is intended for systems where the host needs to explicitly
  476. * control the transmission parameters such as tx power for individual
  477. * tx frames.
  478. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  479. * as a suffix to the VERSION_CONF message to explicitly specify whether
  480. * the target supports the HTT tx MSDU extension descriptor.
  481. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  482. * by the host as lack of target support for the HTT tx MSDU extension
  483. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  484. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  485. * the HTT tx MSDU extension descriptor.
  486. * The host is not required to provide the HTT tx MSDU extension descriptor
  487. * just because the target supports it; the target must check the
  488. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  489. * extension descriptor is present.
  490. */
  491. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  492. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  493. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  494. };
  495. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  496. struct htt_option_tlv_header_t hdr;
  497. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  498. } POSTPACK;
  499. /*
  500. * For the tcl data command V2 and higher support added a new
  501. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  502. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  503. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  504. * HTT option TLV for specifying which version of the TCL metadata struct
  505. * should be used:
  506. * V1 -> use htt_tx_tcl_metadata struct
  507. * V2 -> use htt_tx_tcl_metadata_v2 struct
  508. * Old FW will only support V1.
  509. * New FW will support V2. New FW will still support V1, at least during
  510. * a transition period.
  511. * Similarly, old host will only support V1, and new host will support V1 + V2.
  512. *
  513. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  514. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  515. * of TCL metadata the host supports. If the host doesn't provide a
  516. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  517. * is implicitly understood that the host only supports V1.
  518. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  519. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  520. * the host shall use. The target shall only select one of the versions
  521. * supported by the host. If the target doesn't provide a
  522. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  523. * is implicitly understood that the V1 TCL metadata shall be used.
  524. */
  525. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  526. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  527. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  528. };
  529. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  530. struct htt_option_tlv_header_t hdr;
  531. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  532. } POSTPACK;
  533. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  534. HTT_OPTION_TLV_VALUE0_SET(word, value)
  535. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  536. HTT_OPTION_TLV_VALUE0_GET(word)
  537. typedef struct {
  538. union {
  539. /* BIT [11 : 0] :- tag
  540. * BIT [23 : 12] :- length
  541. * BIT [31 : 24] :- reserved
  542. */
  543. A_UINT32 tag__length;
  544. /*
  545. * The following struct is not endian-portable.
  546. * It is suitable for use within the target, which is known to be
  547. * little-endian.
  548. * The host should use the above endian-portable macros to access
  549. * the tag and length bitfields in an endian-neutral manner.
  550. */
  551. struct {
  552. A_UINT32 tag : 12, /* BIT [11 : 0] */
  553. length : 12, /* BIT [23 : 12] */
  554. reserved : 8; /* BIT [31 : 24] */
  555. };
  556. };
  557. } htt_tlv_hdr_t;
  558. /** HTT stats TLV tag values */
  559. typedef enum {
  560. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  561. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  562. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  563. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  564. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  565. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  566. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  567. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  568. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  569. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  570. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  571. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  572. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  573. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  574. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  575. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  576. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  577. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  578. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  579. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  580. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  581. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  582. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  583. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  584. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  585. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  586. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  587. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  588. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  589. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  590. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  591. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  592. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  593. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  594. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  595. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  596. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  597. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  598. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  599. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  600. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  601. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  602. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  603. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  604. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  605. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  606. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  608. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  609. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  610. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  611. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  612. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  613. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  614. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  615. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  616. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  617. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  618. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  619. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  620. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  621. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  622. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  623. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  624. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  625. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  626. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  627. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  628. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  629. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  630. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  631. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  632. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  633. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  634. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  635. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  636. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  637. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  638. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  639. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  640. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  641. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  642. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  643. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  644. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  645. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  646. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  647. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  648. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  649. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  650. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  651. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  652. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  653. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  654. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  655. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  656. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  657. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  658. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  659. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  660. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  661. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  662. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  663. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  664. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  665. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  666. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  667. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  668. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  669. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  670. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  671. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  672. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  673. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  674. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  675. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  676. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  677. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  678. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  679. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  680. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  681. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  682. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  683. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  684. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  685. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  686. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  687. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  688. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  689. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  690. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  692. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  693. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  694. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  695. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  696. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  697. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  698. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  699. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  700. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  701. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  702. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  703. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  704. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  705. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  706. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  707. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  713. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  714. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  715. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  716. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  717. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  718. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  719. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  720. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  721. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  722. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  723. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  724. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  725. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  726. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  727. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  728. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  729. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v - DEPRECATED */
  730. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  731. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  732. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  733. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  734. HTT_STATS_PEER_AX_OFDMA_STATS_TAG = 174, /* htt_peer_ax_ofdma_stats_tlv */
  735. HTT_STATS_TX_PDEV_MU_EDCA_PARAMS_STATS_TAG = 175, /* htt_tx_pdev_mu_edca_params_stats_tlv_v */
  736. HTT_STATS_MAX_TAG,
  737. } htt_stats_tlv_tag_t;
  738. /* retain deprecated enum name as an alias for the current enum name */
  739. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  740. #define HTT_STATS_TLV_TAG_M 0x00000fff
  741. #define HTT_STATS_TLV_TAG_S 0
  742. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  743. #define HTT_STATS_TLV_LENGTH_S 12
  744. #define HTT_STATS_TLV_TAG_GET(_var) \
  745. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  746. HTT_STATS_TLV_TAG_S)
  747. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  748. do { \
  749. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  750. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  751. } while (0)
  752. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  753. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  754. HTT_STATS_TLV_LENGTH_S)
  755. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  756. do { \
  757. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  758. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  759. } while (0)
  760. /*=== host -> target messages ===============================================*/
  761. enum htt_h2t_msg_type {
  762. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  763. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  764. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  765. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  766. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  767. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  768. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  769. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  770. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  771. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  772. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  773. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  774. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  775. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  776. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  777. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  778. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  779. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  780. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  781. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  782. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  783. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  784. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  785. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  786. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  787. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  788. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  789. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  790. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  791. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  792. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  793. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  794. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  795. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  796. /* keep this last */
  797. HTT_H2T_NUM_MSGS
  798. };
  799. /*
  800. * HTT host to target message type -
  801. * stored in bits 7:0 of the first word of the message
  802. */
  803. #define HTT_H2T_MSG_TYPE_M 0xff
  804. #define HTT_H2T_MSG_TYPE_S 0
  805. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  806. do { \
  807. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  808. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  809. } while (0)
  810. #define HTT_H2T_MSG_TYPE_GET(word) \
  811. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  812. /**
  813. * @brief host -> target version number request message definition
  814. *
  815. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  816. *
  817. *
  818. * |31 24|23 16|15 8|7 0|
  819. * |----------------+----------------+----------------+----------------|
  820. * | reserved | msg type |
  821. * |-------------------------------------------------------------------|
  822. * : option request TLV (optional) |
  823. * :...................................................................:
  824. *
  825. * The VER_REQ message may consist of a single 4-byte word, or may be
  826. * extended with TLVs that specify which HTT options the host is requesting
  827. * from the target.
  828. * The following option TLVs may be appended to the VER_REQ message:
  829. * - HL_SUPPRESS_TX_COMPL_IND
  830. * - HL_MAX_TX_QUEUE_GROUPS
  831. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  832. * may be appended to the VER_REQ message (but only one TLV of each type).
  833. *
  834. * Header fields:
  835. * - MSG_TYPE
  836. * Bits 7:0
  837. * Purpose: identifies this as a version number request message
  838. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  839. */
  840. #define HTT_VER_REQ_BYTES 4
  841. /* TBDXXX: figure out a reasonable number */
  842. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  843. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  844. /**
  845. * @brief HTT tx MSDU descriptor
  846. *
  847. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  848. *
  849. * @details
  850. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  851. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  852. * the target firmware needs for the FW's tx processing, particularly
  853. * for creating the HW msdu descriptor.
  854. * The same HTT tx descriptor is used for HL and LL systems, though
  855. * a few fields within the tx descriptor are used only by LL or
  856. * only by HL.
  857. * The HTT tx descriptor is defined in two manners: by a struct with
  858. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  859. * definitions.
  860. * The target should use the struct def, for simplicitly and clarity,
  861. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  862. * neutral. Specifically, the host shall use the get/set macros built
  863. * around the mask + shift defs.
  864. */
  865. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  866. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  867. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  868. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  869. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  870. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  871. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  872. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  873. #define HTT_TX_VDEV_ID_WORD 0
  874. #define HTT_TX_VDEV_ID_MASK 0x3f
  875. #define HTT_TX_VDEV_ID_SHIFT 16
  876. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  877. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  878. #define HTT_TX_MSDU_LEN_DWORD 1
  879. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  880. /*
  881. * HTT_VAR_PADDR macros
  882. * Allow physical / bus addresses to be either a single 32-bit value,
  883. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  884. */
  885. #define HTT_VAR_PADDR32(var_name) \
  886. A_UINT32 var_name
  887. #define HTT_VAR_PADDR64_LE(var_name) \
  888. struct { \
  889. /* little-endian: lo precedes hi */ \
  890. A_UINT32 lo; \
  891. A_UINT32 hi; \
  892. } var_name
  893. /*
  894. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  895. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  896. * addresses are stored in a XXX-bit field.
  897. * This macro is used to define both htt_tx_msdu_desc32_t and
  898. * htt_tx_msdu_desc64_t structs.
  899. */
  900. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  901. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  902. { \
  903. /* DWORD 0: flags and meta-data */ \
  904. A_UINT32 \
  905. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  906. \
  907. /* pkt_subtype - \
  908. * Detailed specification of the tx frame contents, extending the \
  909. * general specification provided by pkt_type. \
  910. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  911. * pkt_type | pkt_subtype \
  912. * ============================================================== \
  913. * 802.3 | bit 0:3 - Reserved \
  914. * | bit 4: 0x0 - Copy-Engine Classification Results \
  915. * | not appended to the HTT message \
  916. * | 0x1 - Copy-Engine Classification Results \
  917. * | appended to the HTT message in the \
  918. * | format: \
  919. * | [HTT tx desc, frame header, \
  920. * | CE classification results] \
  921. * | The CE classification results begin \
  922. * | at the next 4-byte boundary after \
  923. * | the frame header. \
  924. * ------------+------------------------------------------------- \
  925. * Eth2 | bit 0:3 - Reserved \
  926. * | bit 4: 0x0 - Copy-Engine Classification Results \
  927. * | not appended to the HTT message \
  928. * | 0x1 - Copy-Engine Classification Results \
  929. * | appended to the HTT message. \
  930. * | See the above specification of the \
  931. * | CE classification results location. \
  932. * ------------+------------------------------------------------- \
  933. * native WiFi | bit 0:3 - Reserved \
  934. * | bit 4: 0x0 - Copy-Engine Classification Results \
  935. * | not appended to the HTT message \
  936. * | 0x1 - Copy-Engine Classification Results \
  937. * | appended to the HTT message. \
  938. * | See the above specification of the \
  939. * | CE classification results location. \
  940. * ------------+------------------------------------------------- \
  941. * mgmt | 0x0 - 802.11 MAC header absent \
  942. * | 0x1 - 802.11 MAC header present \
  943. * ------------+------------------------------------------------- \
  944. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  945. * | 0x1 - 802.11 MAC header present \
  946. * | bit 1: 0x0 - allow aggregation \
  947. * | 0x1 - don't allow aggregation \
  948. * | bit 2: 0x0 - perform encryption \
  949. * | 0x1 - don't perform encryption \
  950. * | bit 3: 0x0 - perform tx classification / queuing \
  951. * | 0x1 - don't perform tx classification; \
  952. * | insert the frame into the "misc" \
  953. * | tx queue \
  954. * | bit 4: 0x0 - Copy-Engine Classification Results \
  955. * | not appended to the HTT message \
  956. * | 0x1 - Copy-Engine Classification Results \
  957. * | appended to the HTT message. \
  958. * | See the above specification of the \
  959. * | CE classification results location. \
  960. */ \
  961. pkt_subtype: 5, \
  962. \
  963. /* pkt_type - \
  964. * General specification of the tx frame contents. \
  965. * The htt_pkt_type enum should be used to specify and check the \
  966. * value of this field. \
  967. */ \
  968. pkt_type: 3, \
  969. \
  970. /* vdev_id - \
  971. * ID for the vdev that is sending this tx frame. \
  972. * For certain non-standard packet types, e.g. pkt_type == raw \
  973. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  974. * This field is used primarily for determining where to queue \
  975. * broadcast and multicast frames. \
  976. */ \
  977. vdev_id: 6, \
  978. /* ext_tid - \
  979. * The extended traffic ID. \
  980. * If the TID is unknown, the extended TID is set to \
  981. * HTT_TX_EXT_TID_INVALID. \
  982. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  983. * value of the QoS TID. \
  984. * If the tx frame is non-QoS data, then the extended TID is set to \
  985. * HTT_TX_EXT_TID_NON_QOS. \
  986. * If the tx frame is multicast or broadcast, then the extended TID \
  987. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  988. */ \
  989. ext_tid: 5, \
  990. \
  991. /* postponed - \
  992. * This flag indicates whether the tx frame has been downloaded to \
  993. * the target before but discarded by the target, and now is being \
  994. * downloaded again; or if this is a new frame that is being \
  995. * downloaded for the first time. \
  996. * This flag allows the target to determine the correct order for \
  997. * transmitting new vs. old frames. \
  998. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  999. * This flag only applies to HL systems, since in LL systems, \
  1000. * the tx flow control is handled entirely within the target. \
  1001. */ \
  1002. postponed: 1, \
  1003. \
  1004. /* extension - \
  1005. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1006. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1007. * \
  1008. * 0x0 - no extension MSDU descriptor is present \
  1009. * 0x1 - an extension MSDU descriptor immediately follows the \
  1010. * regular MSDU descriptor \
  1011. */ \
  1012. extension: 1, \
  1013. \
  1014. /* cksum_offload - \
  1015. * This flag indicates whether checksum offload is enabled or not \
  1016. * for this frame. Target FW use this flag to turn on HW checksumming \
  1017. * 0x0 - No checksum offload \
  1018. * 0x1 - L3 header checksum only \
  1019. * 0x2 - L4 checksum only \
  1020. * 0x3 - L3 header checksum + L4 checksum \
  1021. */ \
  1022. cksum_offload: 2, \
  1023. \
  1024. /* tx_comp_req - \
  1025. * This flag indicates whether Tx Completion \
  1026. * from fw is required or not. \
  1027. * This flag is only relevant if tx completion is not \
  1028. * universally enabled. \
  1029. * For all LL systems, tx completion is mandatory, \
  1030. * so this flag will be irrelevant. \
  1031. * For HL systems tx completion is optional, but HL systems in which \
  1032. * the bus throughput exceeds the WLAN throughput will \
  1033. * probably want to always use tx completion, and thus \
  1034. * would not check this flag. \
  1035. * This flag is required when tx completions are not used universally, \
  1036. * but are still required for certain tx frames for which \
  1037. * an OTA delivery acknowledgment is needed by the host. \
  1038. * In practice, this would be for HL systems in which the \
  1039. * bus throughput is less than the WLAN throughput. \
  1040. * \
  1041. * 0x0 - Tx Completion Indication from Fw not required \
  1042. * 0x1 - Tx Completion Indication from Fw is required \
  1043. */ \
  1044. tx_compl_req: 1; \
  1045. \
  1046. \
  1047. /* DWORD 1: MSDU length and ID */ \
  1048. A_UINT32 \
  1049. len: 16, /* MSDU length, in bytes */ \
  1050. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1051. * and this id is used to calculate fragmentation \
  1052. * descriptor pointer inside the target based on \
  1053. * the base address, configured inside the target. \
  1054. */ \
  1055. \
  1056. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1057. /* frags_desc_ptr - \
  1058. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1059. * where the tx frame's fragments reside in memory. \
  1060. * This field only applies to LL systems, since in HL systems the \
  1061. * (degenerate single-fragment) fragmentation descriptor is created \
  1062. * within the target. \
  1063. */ \
  1064. _paddr__frags_desc_ptr_; \
  1065. \
  1066. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1067. /* \
  1068. * Peer ID : Target can use this value to know which peer-id packet \
  1069. * destined to. \
  1070. * It's intended to be specified by host in case of NAWDS. \
  1071. */ \
  1072. A_UINT16 peerid; \
  1073. \
  1074. /* \
  1075. * Channel frequency: This identifies the desired channel \
  1076. * frequency (in mhz) for tx frames. This is used by FW to help \
  1077. * determine when it is safe to transmit or drop frames for \
  1078. * off-channel operation. \
  1079. * The default value of zero indicates to FW that the corresponding \
  1080. * VDEV's home channel (if there is one) is the desired channel \
  1081. * frequency. \
  1082. */ \
  1083. A_UINT16 chanfreq; \
  1084. \
  1085. /* Reason reserved is commented is increasing the htt structure size \
  1086. * leads to some weird issues. \
  1087. * A_UINT32 reserved_dword3_bits0_31; \
  1088. */ \
  1089. } POSTPACK
  1090. /* define a htt_tx_msdu_desc32_t type */
  1091. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1092. /* define a htt_tx_msdu_desc64_t type */
  1093. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1094. /*
  1095. * Make htt_tx_msdu_desc_t be an alias for either
  1096. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1097. */
  1098. #if HTT_PADDR64
  1099. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1100. #else
  1101. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1102. #endif
  1103. /* decriptor information for Management frame*/
  1104. /*
  1105. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1106. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1107. */
  1108. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1109. extern A_UINT32 mgmt_hdr_len;
  1110. PREPACK struct htt_mgmt_tx_desc_t {
  1111. A_UINT32 msg_type;
  1112. #if HTT_PADDR64
  1113. A_UINT64 frag_paddr; /* DMAble address of the data */
  1114. #else
  1115. A_UINT32 frag_paddr; /* DMAble address of the data */
  1116. #endif
  1117. A_UINT32 desc_id; /* returned to host during completion
  1118. * to free the meory*/
  1119. A_UINT32 len; /* Fragment length */
  1120. A_UINT32 vdev_id; /* virtual device ID*/
  1121. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1122. } POSTPACK;
  1123. PREPACK struct htt_mgmt_tx_compl_ind {
  1124. A_UINT32 desc_id;
  1125. A_UINT32 status;
  1126. } POSTPACK;
  1127. /*
  1128. * This SDU header size comes from the summation of the following:
  1129. * 1. Max of:
  1130. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1131. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1132. * b. 802.11 header, for raw frames: 36 bytes
  1133. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1134. * QoS header, HT header)
  1135. * c. 802.3 header, for ethernet frames: 14 bytes
  1136. * (destination address, source address, ethertype / length)
  1137. * 2. Max of:
  1138. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1139. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1140. * 3. 802.1Q VLAN header: 4 bytes
  1141. * 4. LLC/SNAP header: 8 bytes
  1142. */
  1143. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1144. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1145. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1146. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1147. A_COMPILE_TIME_ASSERT(
  1148. htt_encap_hdr_size_max_check_nwifi,
  1149. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1150. A_COMPILE_TIME_ASSERT(
  1151. htt_encap_hdr_size_max_check_enet,
  1152. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1153. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1154. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1155. #define HTT_TX_HDR_SIZE_802_1Q 4
  1156. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1157. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1158. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1159. HTT_TX_HDR_SIZE_802_1Q + \
  1160. HTT_TX_HDR_SIZE_LLC_SNAP)
  1161. #define HTT_HL_TX_FRM_HDR_LEN \
  1162. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1163. #define HTT_LL_TX_FRM_HDR_LEN \
  1164. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1165. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1166. /* dword 0 */
  1167. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1168. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1169. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1170. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1171. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1172. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1173. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1174. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1175. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1176. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1177. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1178. #define HTT_TX_DESC_PKT_TYPE_S 13
  1179. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1180. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1181. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1182. #define HTT_TX_DESC_VDEV_ID_S 16
  1183. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1184. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1185. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1186. #define HTT_TX_DESC_EXT_TID_S 22
  1187. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1188. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1189. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1190. #define HTT_TX_DESC_POSTPONED_S 27
  1191. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1192. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1193. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1194. #define HTT_TX_DESC_EXTENSION_S 28
  1195. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1196. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1197. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1198. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1199. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1200. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1201. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1202. #define HTT_TX_DESC_TX_COMP_S 31
  1203. /* dword 1 */
  1204. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1205. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1206. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1207. #define HTT_TX_DESC_FRM_LEN_S 0
  1208. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1209. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1210. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1211. #define HTT_TX_DESC_FRM_ID_S 16
  1212. /* dword 2 */
  1213. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1214. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1215. /* for systems using 64-bit format for bus addresses */
  1216. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1217. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1218. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1219. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1220. /* for systems using 32-bit format for bus addresses */
  1221. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1222. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1223. /* dword 3 */
  1224. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1225. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1226. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1227. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1229. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1230. #if HTT_PADDR64
  1231. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1232. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1233. #else
  1234. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1235. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1236. #endif
  1237. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1238. #define HTT_TX_DESC_PEER_ID_S 0
  1239. /*
  1240. * TEMPORARY:
  1241. * The original definitions for the PEER_ID fields contained typos
  1242. * (with _DESC_PADDR appended to this PEER_ID field name).
  1243. * Retain deprecated original names for PEER_ID fields until all code that
  1244. * refers to them has been updated.
  1245. */
  1246. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1247. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1248. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1249. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1250. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1251. HTT_TX_DESC_PEER_ID_M
  1252. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1253. HTT_TX_DESC_PEER_ID_S
  1254. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1255. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1256. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1257. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1259. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1260. #if HTT_PADDR64
  1261. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1262. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1263. #else
  1264. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1265. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1266. #endif
  1267. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1268. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1269. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1270. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1271. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1275. } while (0)
  1276. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1277. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1278. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1282. } while (0)
  1283. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1285. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1292. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1299. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1306. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1310. } while (0)
  1311. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1312. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1313. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1314. do { \
  1315. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1316. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1317. } while (0)
  1318. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1319. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1320. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1324. } while (0)
  1325. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1326. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1327. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1331. } while (0)
  1332. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1333. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1334. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1338. } while (0)
  1339. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1340. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1341. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1342. do { \
  1343. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1344. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1345. } while (0)
  1346. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1347. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1348. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1352. } while (0)
  1353. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1354. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1355. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1356. do { \
  1357. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1358. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1359. } while (0)
  1360. /* enums used in the HTT tx MSDU extension descriptor */
  1361. enum {
  1362. htt_tx_guard_interval_regular = 0,
  1363. htt_tx_guard_interval_short = 1,
  1364. };
  1365. enum {
  1366. htt_tx_preamble_type_ofdm = 0,
  1367. htt_tx_preamble_type_cck = 1,
  1368. htt_tx_preamble_type_ht = 2,
  1369. htt_tx_preamble_type_vht = 3,
  1370. };
  1371. enum {
  1372. htt_tx_bandwidth_5MHz = 0,
  1373. htt_tx_bandwidth_10MHz = 1,
  1374. htt_tx_bandwidth_20MHz = 2,
  1375. htt_tx_bandwidth_40MHz = 3,
  1376. htt_tx_bandwidth_80MHz = 4,
  1377. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1378. };
  1379. /**
  1380. * @brief HTT tx MSDU extension descriptor
  1381. * @details
  1382. * If the target supports HTT tx MSDU extension descriptors, the host has
  1383. * the option of appending the following struct following the regular
  1384. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1385. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1386. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1387. * tx specs for each frame.
  1388. */
  1389. PREPACK struct htt_tx_msdu_desc_ext_t {
  1390. /* DWORD 0: flags */
  1391. A_UINT32
  1392. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1393. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1394. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1395. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1396. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1397. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1398. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1399. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1400. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1401. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1402. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1403. /* DWORD 1: tx power, tx rate, tx BW */
  1404. A_UINT32
  1405. /* pwr -
  1406. * Specify what power the tx frame needs to be transmitted at.
  1407. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1408. * The value needs to be appropriately sign-extended when extracting
  1409. * the value from the message and storing it in a variable that is
  1410. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1411. * automatically handles this sign-extension.)
  1412. * If the transmission uses multiple tx chains, this power spec is
  1413. * the total transmit power, assuming incoherent combination of
  1414. * per-chain power to produce the total power.
  1415. */
  1416. pwr: 8,
  1417. /* mcs_mask -
  1418. * Specify the allowable values for MCS index (modulation and coding)
  1419. * to use for transmitting the frame.
  1420. *
  1421. * For HT / VHT preamble types, this mask directly corresponds to
  1422. * the HT or VHT MCS indices that are allowed. For each bit N set
  1423. * within the mask, MCS index N is allowed for transmitting the frame.
  1424. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1425. * rates versus OFDM rates, so the host has the option of specifying
  1426. * that the target must transmit the frame with CCK or OFDM rates
  1427. * (not HT or VHT), but leaving the decision to the target whether
  1428. * to use CCK or OFDM.
  1429. *
  1430. * For CCK and OFDM, the bits within this mask are interpreted as
  1431. * follows:
  1432. * bit 0 -> CCK 1 Mbps rate is allowed
  1433. * bit 1 -> CCK 2 Mbps rate is allowed
  1434. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1435. * bit 3 -> CCK 11 Mbps rate is allowed
  1436. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1437. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1438. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1439. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1440. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1441. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1442. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1443. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1444. *
  1445. * The MCS index specification needs to be compatible with the
  1446. * bandwidth mask specification. For example, a MCS index == 9
  1447. * specification is inconsistent with a preamble type == VHT,
  1448. * Nss == 1, and channel bandwidth == 20 MHz.
  1449. *
  1450. * Furthermore, the host has only a limited ability to specify to
  1451. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1452. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1453. */
  1454. mcs_mask: 12,
  1455. /* nss_mask -
  1456. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1457. * Each bit in this mask corresponds to a Nss value:
  1458. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1459. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1460. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1461. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1462. * The values in the Nss mask must be suitable for the recipient, e.g.
  1463. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1464. * recipient which only supports 2x2 MIMO.
  1465. */
  1466. nss_mask: 4,
  1467. /* guard_interval -
  1468. * Specify a htt_tx_guard_interval enum value to indicate whether
  1469. * the transmission should use a regular guard interval or a
  1470. * short guard interval.
  1471. */
  1472. guard_interval: 1,
  1473. /* preamble_type_mask -
  1474. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1475. * may choose from for transmitting this frame.
  1476. * The bits in this mask correspond to the values in the
  1477. * htt_tx_preamble_type enum. For example, to allow the target
  1478. * to transmit the frame as either CCK or OFDM, this field would
  1479. * be set to
  1480. * (1 << htt_tx_preamble_type_ofdm) |
  1481. * (1 << htt_tx_preamble_type_cck)
  1482. */
  1483. preamble_type_mask: 4,
  1484. reserved1_31_29: 3; /* unused, set to 0x0 */
  1485. /* DWORD 2: tx chain mask, tx retries */
  1486. A_UINT32
  1487. /* chain_mask - specify which chains to transmit from */
  1488. chain_mask: 4,
  1489. /* retry_limit -
  1490. * Specify the maximum number of transmissions, including the
  1491. * initial transmission, to attempt before giving up if no ack
  1492. * is received.
  1493. * If the tx rate is specified, then all retries shall use the
  1494. * same rate as the initial transmission.
  1495. * If no tx rate is specified, the target can choose whether to
  1496. * retain the original rate during the retransmissions, or to
  1497. * fall back to a more robust rate.
  1498. */
  1499. retry_limit: 4,
  1500. /* bandwidth_mask -
  1501. * Specify what channel widths may be used for the transmission.
  1502. * A value of zero indicates "don't care" - the target may choose
  1503. * the transmission bandwidth.
  1504. * The bits within this mask correspond to the htt_tx_bandwidth
  1505. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1506. * The bandwidth_mask must be consistent with the preamble_type_mask
  1507. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1508. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1509. */
  1510. bandwidth_mask: 6,
  1511. reserved2_31_14: 18; /* unused, set to 0x0 */
  1512. /* DWORD 3: tx expiry time (TSF) LSBs */
  1513. A_UINT32 expire_tsf_lo;
  1514. /* DWORD 4: tx expiry time (TSF) MSBs */
  1515. A_UINT32 expire_tsf_hi;
  1516. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1517. } POSTPACK;
  1518. /* DWORD 0 */
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1539. /* DWORD 1 */
  1540. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1541. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1542. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1543. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1544. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1545. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1546. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1547. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1548. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1549. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1550. /* DWORD 2 */
  1551. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1552. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1553. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1554. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1555. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1556. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1557. /* DWORD 0 */
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1559. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1560. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1562. do { \
  1563. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1564. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1565. } while (0)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1567. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1568. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1570. do { \
  1571. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1572. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1573. } while (0)
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1575. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1576. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1578. do { \
  1579. HTT_CHECK_SET_VAL( \
  1580. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1581. ((_var) |= ((_val) \
  1582. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1583. } while (0)
  1584. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1586. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL( \
  1590. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1591. ((_var) |= ((_val) \
  1592. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1596. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1600. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1601. } while (0)
  1602. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1604. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1605. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1608. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1609. } while (0)
  1610. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1611. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1612. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1613. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1614. do { \
  1615. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1616. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1617. } while (0)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1619. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1620. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1621. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1622. do { \
  1623. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1624. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1625. } while (0)
  1626. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1628. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1629. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1633. } while (0)
  1634. /* DWORD 1 */
  1635. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1637. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1638. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1639. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1640. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1641. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1642. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1643. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1644. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1651. } while (0)
  1652. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1654. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1655. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1662. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1663. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1670. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1671. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1675. } while (0)
  1676. /* DWORD 2 */
  1677. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1678. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1679. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1680. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1681. do { \
  1682. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1683. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1684. } while (0)
  1685. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1686. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1687. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1688. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1689. do { \
  1690. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1691. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1692. } while (0)
  1693. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1694. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1695. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1696. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1697. do { \
  1698. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1699. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1700. } while (0)
  1701. typedef enum {
  1702. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1703. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1704. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1705. } htt_11ax_ltf_subtype_t;
  1706. typedef enum {
  1707. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1708. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1709. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1710. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1711. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1712. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1713. } htt_tx_ext2_preamble_type_t;
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1719. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1722. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1723. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1724. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1725. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1726. /**
  1727. * @brief HTT tx MSDU extension descriptor v2
  1728. * @details
  1729. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1730. * is received as tcl_exit_base->host_meta_info in firmware.
  1731. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1732. * are already part of tcl_exit_base.
  1733. */
  1734. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1735. /* DWORD 0: flags */
  1736. A_UINT32
  1737. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1738. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1739. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1740. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1741. valid_retries : 1, /* if set, tx retries spec is valid */
  1742. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1743. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1744. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1745. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1746. valid_key_flags : 1, /* if set, key flags is valid */
  1747. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1748. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1749. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1750. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1751. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1752. 1 = ENCRYPT,
  1753. 2 ~ 3 - Reserved */
  1754. /* retry_limit -
  1755. * Specify the maximum number of transmissions, including the
  1756. * initial transmission, to attempt before giving up if no ack
  1757. * is received.
  1758. * If the tx rate is specified, then all retries shall use the
  1759. * same rate as the initial transmission.
  1760. * If no tx rate is specified, the target can choose whether to
  1761. * retain the original rate during the retransmissions, or to
  1762. * fall back to a more robust rate.
  1763. */
  1764. retry_limit : 4,
  1765. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1766. * Valid only for 11ax preamble types HE_SU
  1767. * and HE_EXT_SU
  1768. */
  1769. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1770. * Valid only for 11ax preamble types HE_SU
  1771. * and HE_EXT_SU
  1772. */
  1773. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1774. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1775. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1776. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1777. */
  1778. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1779. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1780. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1781. * Use cases:
  1782. * Any time firmware uses TQM-BYPASS for Data
  1783. * TID, firmware expect host to set this bit.
  1784. */
  1785. /* DWORD 1: tx power, tx rate */
  1786. A_UINT32
  1787. power : 8, /* unit of the power field is 0.5 dbm
  1788. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1789. * signed value ranging from -64dbm to 63.5 dbm
  1790. */
  1791. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1792. * Setting more than one MCS isn't currently
  1793. * supported by the target (but is supported
  1794. * in the interface in case in the future
  1795. * the target supports specifications of
  1796. * a limited set of MCS values.
  1797. */
  1798. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1799. * Setting more than one Nss isn't currently
  1800. * supported by the target (but is supported
  1801. * in the interface in case in the future
  1802. * the target supports specifications of
  1803. * a limited set of Nss values.
  1804. */
  1805. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1806. update_peer_cache : 1; /* When set these custom values will be
  1807. * used for all packets, until the next
  1808. * update via this ext header.
  1809. * This is to make sure not all packets
  1810. * need to include this header.
  1811. */
  1812. /* DWORD 2: tx chain mask, tx retries */
  1813. A_UINT32
  1814. /* chain_mask - specify which chains to transmit from */
  1815. chain_mask : 8,
  1816. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1817. * TODO: Update Enum values for key_flags
  1818. */
  1819. /*
  1820. * Channel frequency: This identifies the desired channel
  1821. * frequency (in MHz) for tx frames. This is used by FW to help
  1822. * determine when it is safe to transmit or drop frames for
  1823. * off-channel operation.
  1824. * The default value of zero indicates to FW that the corresponding
  1825. * VDEV's home channel (if there is one) is the desired channel
  1826. * frequency.
  1827. */
  1828. chanfreq : 16;
  1829. /* DWORD 3: tx expiry time (TSF) LSBs */
  1830. A_UINT32 expire_tsf_lo;
  1831. /* DWORD 4: tx expiry time (TSF) MSBs */
  1832. A_UINT32 expire_tsf_hi;
  1833. /* DWORD 5: flags to control routing / processing of the MSDU */
  1834. A_UINT32
  1835. /* learning_frame
  1836. * When this flag is set, this frame will be dropped by FW
  1837. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1838. */
  1839. learning_frame : 1,
  1840. /* send_as_standalone
  1841. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1842. * i.e. with no A-MSDU or A-MPDU aggregation.
  1843. * The scope is extended to other use-cases.
  1844. */
  1845. send_as_standalone : 1,
  1846. /* is_host_opaque_valid
  1847. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1848. * with valid information.
  1849. */
  1850. is_host_opaque_valid : 1,
  1851. traffic_end_indication: 1,
  1852. rsvd0 : 28;
  1853. /* DWORD 6 : Host opaque cookie for special frames */
  1854. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1855. rsvd1 : 16;
  1856. /*
  1857. * This structure can be expanded further up to 40 bytes
  1858. * by adding further DWORDs as needed.
  1859. */
  1860. } POSTPACK;
  1861. /* DWORD 0 */
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1886. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1888. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1889. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1890. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1891. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1892. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1893. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1894. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1895. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1896. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1897. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1898. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1899. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1900. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1901. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1902. /* DWORD 1 */
  1903. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1904. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1905. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1906. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1907. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1908. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1909. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1910. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1911. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1912. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1913. /* DWORD 2 */
  1914. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1915. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1916. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1917. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1918. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1919. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1920. /* DWORD 5 */
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1927. /* DWORD 6 */
  1928. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1929. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1930. /* DWORD 0 */
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1932. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1935. do { \
  1936. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1937. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1938. } while (0)
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1940. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1941. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1943. do { \
  1944. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1945. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1946. } while (0)
  1947. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1948. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1949. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1951. do { \
  1952. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1953. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1954. } while (0)
  1955. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1956. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1957. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1959. do { \
  1960. HTT_CHECK_SET_VAL( \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1962. ((_var) |= ((_val) \
  1963. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL( \
  1987. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1988. ((_var) |= ((_val) \
  1989. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1990. } while (0)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1998. } while (0)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2025. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2026. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2030. } while (0)
  2031. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2032. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2033. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2034. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2038. } while (0)
  2039. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2040. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2041. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2042. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2043. do { \
  2044. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2045. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2046. } while (0)
  2047. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2048. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2049. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2050. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2051. do { \
  2052. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2053. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2054. } while (0)
  2055. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2056. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2057. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2058. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2059. do { \
  2060. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2061. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2062. } while (0)
  2063. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2064. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2065. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2066. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2070. } while (0)
  2071. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2072. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2073. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2074. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2078. } while (0)
  2079. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2081. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2082. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2086. } while (0)
  2087. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2088. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2089. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2090. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2091. do { \
  2092. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2093. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2094. } while (0)
  2095. /* DWORD 1 */
  2096. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2100. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2101. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2102. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2103. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2104. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2105. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2106. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2107. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2108. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2112. } while (0)
  2113. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2114. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2115. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2116. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2117. do { \
  2118. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2119. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2120. } while (0)
  2121. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2122. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2123. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2124. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2128. } while (0)
  2129. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2130. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2131. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2132. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2133. do { \
  2134. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2135. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2136. } while (0)
  2137. /* DWORD 2 */
  2138. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2139. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2140. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2141. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2142. do { \
  2143. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2144. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2145. } while (0)
  2146. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2147. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2148. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2149. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2150. do { \
  2151. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2152. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2153. } while (0)
  2154. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2155. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2156. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2157. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2158. do { \
  2159. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2160. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2161. } while (0)
  2162. /* DWORD 5 */
  2163. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2164. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2165. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2166. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2170. } while (0)
  2171. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2172. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2173. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2174. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2178. } while (0)
  2179. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2180. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2181. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2182. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2186. } while (0)
  2187. /* DWORD 6 */
  2188. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2189. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2190. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2191. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2192. do { \
  2193. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2194. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2195. } while (0)
  2196. typedef enum {
  2197. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2198. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2199. } htt_tcl_metadata_type;
  2200. /**
  2201. * @brief HTT TCL command number format
  2202. * @details
  2203. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2204. * available to firmware as tcl_exit_base->tcl_status_number.
  2205. * For regular / multicast packets host will send vdev and mac id and for
  2206. * NAWDS packets, host will send peer id.
  2207. * A_UINT32 is used to avoid endianness conversion problems.
  2208. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2209. */
  2210. typedef struct {
  2211. A_UINT32
  2212. type: 1, /* vdev_id based or peer_id based */
  2213. rsvd: 31;
  2214. } htt_tx_tcl_vdev_or_peer_t;
  2215. typedef struct {
  2216. A_UINT32
  2217. type: 1, /* vdev_id based or peer_id based */
  2218. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2219. vdev_id: 8,
  2220. pdev_id: 2,
  2221. host_inspected:1,
  2222. rsvd: 19;
  2223. } htt_tx_tcl_vdev_metadata;
  2224. typedef struct {
  2225. A_UINT32
  2226. type: 1, /* vdev_id based or peer_id based */
  2227. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2228. peer_id: 14,
  2229. rsvd: 16;
  2230. } htt_tx_tcl_peer_metadata;
  2231. PREPACK struct htt_tx_tcl_metadata {
  2232. union {
  2233. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2234. htt_tx_tcl_vdev_metadata vdev_meta;
  2235. htt_tx_tcl_peer_metadata peer_meta;
  2236. };
  2237. } POSTPACK;
  2238. /* DWORD 0 */
  2239. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2240. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2241. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2242. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2243. /* VDEV metadata */
  2244. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2245. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2246. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2247. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2248. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2249. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2250. /* PEER metadata */
  2251. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2252. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2253. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2254. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2255. HTT_TX_TCL_METADATA_TYPE_S)
  2256. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2257. do { \
  2258. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2259. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2260. } while (0)
  2261. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2262. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2263. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2264. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2265. do { \
  2266. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2267. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2268. } while (0)
  2269. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2270. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2271. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2272. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2276. } while (0)
  2277. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2278. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2279. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2280. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2281. do { \
  2282. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2283. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2284. } while (0)
  2285. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2286. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2287. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2288. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2289. do { \
  2290. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2291. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2292. } while (0)
  2293. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2294. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2295. HTT_TX_TCL_METADATA_PEER_ID_S)
  2296. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2297. do { \
  2298. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2299. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2300. } while (0)
  2301. /*------------------------------------------------------------------
  2302. * V2 Version of TCL Data Command
  2303. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2304. * MLO global_seq all flavours of TCL Data Cmd.
  2305. *-----------------------------------------------------------------*/
  2306. typedef enum {
  2307. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2308. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2309. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2310. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2311. } htt_tcl_metadata_type_v2;
  2312. /**
  2313. * @brief HTT TCL command number format
  2314. * @details
  2315. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2316. * available to firmware as tcl_exit_base->tcl_status_number.
  2317. * A_UINT32 is used to avoid endianness conversion problems.
  2318. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2319. */
  2320. typedef struct {
  2321. A_UINT32
  2322. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2323. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2324. vdev_id: 8,
  2325. pdev_id: 2,
  2326. host_inspected:1,
  2327. rsvd: 2,
  2328. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2329. } htt_tx_tcl_vdev_metadata_v2;
  2330. typedef struct {
  2331. A_UINT32
  2332. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2333. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2334. peer_id: 13,
  2335. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2336. } htt_tx_tcl_peer_metadata_v2;
  2337. typedef struct {
  2338. A_UINT32
  2339. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2340. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2341. svc_class_id: 8,
  2342. rsvd: 5,
  2343. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2344. } htt_tx_tcl_svc_class_id_metadata;
  2345. typedef struct {
  2346. A_UINT32
  2347. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2348. host_inspected: 1,
  2349. global_seq_no: 12,
  2350. rsvd: 1,
  2351. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2352. } htt_tx_tcl_global_seq_metadata;
  2353. PREPACK struct htt_tx_tcl_metadata_v2 {
  2354. union {
  2355. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2356. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2357. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2358. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2359. };
  2360. } POSTPACK;
  2361. /* DWORD 0 */
  2362. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2363. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2364. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2365. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2366. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2367. /* VDEV V2 metadata */
  2368. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2369. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2370. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2371. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2372. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2373. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2374. /* PEER V2 metadata */
  2375. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2376. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2377. /* SVC_CLASS_ID metadata */
  2378. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2379. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2380. /* Global Seq no metadata */
  2381. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2382. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2383. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2384. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2385. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2386. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2387. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2388. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2389. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2390. do { \
  2391. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2392. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2393. } while (0)
  2394. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2395. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2396. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2397. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2398. do { \
  2399. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2400. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2401. } while (0)
  2402. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2403. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2404. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2405. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2406. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2407. do { \
  2408. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2409. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2410. } while (0)
  2411. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2412. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2413. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2414. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2418. } while (0)
  2419. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2420. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2421. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2422. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2423. do { \
  2424. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2425. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2426. } while (0)
  2427. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2428. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2429. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2430. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2431. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2435. } while (0)
  2436. /*----- Get and Set V2 type field in Service Class fields ----*/
  2437. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2438. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2439. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2440. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2441. do { \
  2442. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2443. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2444. } while (0)
  2445. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2446. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2447. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2448. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2449. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2453. } while (0)
  2454. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2455. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2456. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2457. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2458. do { \
  2459. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2460. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2461. } while (0)
  2462. /*------------------------------------------------------------------
  2463. * End V2 Version of TCL Data Command
  2464. *-----------------------------------------------------------------*/
  2465. typedef enum {
  2466. HTT_TX_FW2WBM_TX_STATUS_OK,
  2467. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2468. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2469. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2470. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2471. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2472. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2473. HTT_TX_FW2WBM_TX_STATUS_MAX
  2474. } htt_tx_fw2wbm_tx_status_t;
  2475. typedef enum {
  2476. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2477. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2478. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2479. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2480. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2481. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2482. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2483. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2484. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2485. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2486. } htt_tx_fw2wbm_reinject_reason_t;
  2487. /**
  2488. * @brief HTT TX WBM Completion from firmware to host
  2489. * @details
  2490. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2491. * DWORD 3 and 4 for software based completions (Exception frames and
  2492. * TQM bypass frames)
  2493. * For software based completions, wbm_release_ring->release_source_module will
  2494. * be set to release_source_fw
  2495. */
  2496. PREPACK struct htt_tx_wbm_completion {
  2497. A_UINT32
  2498. sch_cmd_id: 24,
  2499. exception_frame: 1, /* If set, this packet was queued via exception path */
  2500. rsvd0_31_25: 7;
  2501. A_UINT32
  2502. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2503. * reception of an ACK or BA, this field indicates
  2504. * the RSSI of the received ACK or BA frame.
  2505. * When the frame is removed as result of a direct
  2506. * remove command from the SW, this field is set
  2507. * to 0x0 (which is never a valid value when real
  2508. * RSSI is available).
  2509. * Units: dB w.r.t noise floor
  2510. */
  2511. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2512. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2513. rsvd1_31_16: 16;
  2514. } POSTPACK;
  2515. /* DWORD 0 */
  2516. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2517. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2518. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2519. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2520. /* DWORD 1 */
  2521. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2522. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2523. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2524. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2525. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2526. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2527. /* DWORD 0 */
  2528. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2529. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2530. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2531. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2532. do { \
  2533. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2534. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2535. } while (0)
  2536. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2537. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2538. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2539. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2540. do { \
  2541. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2542. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2543. } while (0)
  2544. /* DWORD 1 */
  2545. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2546. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2547. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2548. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2549. do { \
  2550. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2551. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2552. } while (0)
  2553. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2554. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2555. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2556. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2557. do { \
  2558. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2559. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2560. } while (0)
  2561. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2562. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2563. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2564. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2565. do { \
  2566. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2567. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2568. } while (0)
  2569. /**
  2570. * @brief HTT TX WBM Completion from firmware to host
  2571. * @details
  2572. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2573. * (WBM) offload HW.
  2574. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2575. * For software based completions, release_source_module will
  2576. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2577. * struct wbm_release_ring and then switch to this after looking at
  2578. * release_source_module.
  2579. */
  2580. PREPACK struct htt_tx_wbm_completion_v2 {
  2581. A_UINT32
  2582. used_by_hw0; /* Refer to struct wbm_release_ring */
  2583. A_UINT32
  2584. used_by_hw1; /* Refer to struct wbm_release_ring */
  2585. A_UINT32
  2586. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2587. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2588. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2589. exception_frame: 1,
  2590. rsvd0: 12, /* For future use */
  2591. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2592. rsvd1: 1; /* For future use */
  2593. A_UINT32
  2594. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2595. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2596. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2597. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2598. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2599. */
  2600. A_UINT32
  2601. data1: 32;
  2602. A_UINT32
  2603. data2: 32;
  2604. A_UINT32
  2605. used_by_hw3; /* Refer to struct wbm_release_ring */
  2606. } POSTPACK;
  2607. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2608. /* DWORD 3 */
  2609. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2610. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2611. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2612. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2613. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2614. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2615. /* DWORD 3 */
  2616. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2617. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2618. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2619. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2620. do { \
  2621. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2622. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2623. } while (0)
  2624. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2625. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2626. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2627. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2628. do { \
  2629. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2630. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2631. } while (0)
  2632. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2633. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2634. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2635. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2636. do { \
  2637. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2638. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2639. } while (0)
  2640. /**
  2641. * @brief HTT TX WBM Completion from firmware to host (V3)
  2642. * @details
  2643. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2644. * (WBM) offload HW.
  2645. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2646. * For software based completions, release_source_module will
  2647. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2648. * struct wbm_release_ring and then switch to this after looking at
  2649. * release_source_module.
  2650. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2651. * by new generations of targets.
  2652. */
  2653. PREPACK struct htt_tx_wbm_completion_v3 {
  2654. A_UINT32
  2655. used_by_hw0; /* Refer to struct wbm_release_ring */
  2656. A_UINT32
  2657. used_by_hw1; /* Refer to struct wbm_release_ring */
  2658. A_UINT32
  2659. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2660. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2661. used_by_hw3: 15;
  2662. A_UINT32
  2663. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2664. exception_frame: 1,
  2665. rsvd0: 27; /* For future use */
  2666. A_UINT32
  2667. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2668. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2669. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2670. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2671. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2672. */
  2673. A_UINT32
  2674. data1: 32;
  2675. A_UINT32
  2676. data2: 32;
  2677. A_UINT32
  2678. rsvd1: 20,
  2679. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2680. } POSTPACK;
  2681. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2682. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2683. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2684. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2685. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2686. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2687. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2688. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2689. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2690. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2691. do { \
  2692. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2693. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2694. } while (0)
  2695. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2696. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2697. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2698. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2699. do { \
  2700. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2701. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2702. } while (0)
  2703. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2704. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2705. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2706. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2707. do { \
  2708. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2709. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2710. } while (0)
  2711. typedef enum {
  2712. TX_FRAME_TYPE_UNDEFINED = 0,
  2713. TX_FRAME_TYPE_EAPOL = 1,
  2714. } htt_tx_wbm_status_frame_type;
  2715. /**
  2716. * @brief HTT TX WBM transmit status from firmware to host
  2717. * @details
  2718. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2719. * (WBM) offload HW.
  2720. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2721. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2722. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2723. */
  2724. PREPACK struct htt_tx_wbm_transmit_status {
  2725. A_UINT32
  2726. sch_cmd_id: 24,
  2727. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2728. * reception of an ACK or BA, this field indicates
  2729. * the RSSI of the received ACK or BA frame.
  2730. * When the frame is removed as result of a direct
  2731. * remove command from the SW, this field is set
  2732. * to 0x0 (which is never a valid value when real
  2733. * RSSI is available).
  2734. * Units: dB w.r.t noise floor
  2735. */
  2736. A_UINT32
  2737. sw_peer_id: 16,
  2738. tid_num: 5,
  2739. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2740. * and tid_num fields contain valid data.
  2741. * If this "valid" flag is not set, the
  2742. * sw_peer_id and tid_num fields must be ignored.
  2743. */
  2744. mcast: 1,
  2745. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2746. * contains valid data.
  2747. */
  2748. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2749. reserved: 4;
  2750. A_UINT32
  2751. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2752. * packets in the wbm completion path
  2753. */
  2754. } POSTPACK;
  2755. /* DWORD 4 */
  2756. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2757. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2758. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2759. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2760. /* DWORD 5 */
  2761. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2762. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2763. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2764. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2765. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2766. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2767. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2768. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2769. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2770. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2771. /* DWORD 4 */
  2772. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2773. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2774. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2775. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2776. do { \
  2777. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2778. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2779. } while (0)
  2780. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2781. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2782. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2783. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2784. do { \
  2785. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2786. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2787. } while (0)
  2788. /* DWORD 5 */
  2789. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2790. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2791. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2792. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2795. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2796. } while (0)
  2797. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2798. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2799. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2800. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2801. do { \
  2802. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2803. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2804. } while (0)
  2805. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2806. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2807. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2808. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2809. do { \
  2810. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2811. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2812. } while (0)
  2813. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2814. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2815. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2816. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2817. do { \
  2818. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2819. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2820. } while (0)
  2821. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2822. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2823. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2824. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2825. do { \
  2826. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2827. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2828. } while (0)
  2829. /**
  2830. * @brief HTT TX WBM reinject status from firmware to host
  2831. * @details
  2832. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2833. * (WBM) offload HW.
  2834. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2835. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2836. */
  2837. PREPACK struct htt_tx_wbm_reinject_status {
  2838. A_UINT32
  2839. reserved0: 32;
  2840. A_UINT32
  2841. reserved1: 32;
  2842. A_UINT32
  2843. reserved2: 32;
  2844. } POSTPACK;
  2845. /**
  2846. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2847. * @details
  2848. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2849. * (WBM) offload HW.
  2850. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2851. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2852. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2853. * STA side.
  2854. */
  2855. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2856. A_UINT32
  2857. mec_sa_addr_31_0;
  2858. A_UINT32
  2859. mec_sa_addr_47_32: 16,
  2860. sa_ast_index: 16;
  2861. A_UINT32
  2862. vdev_id: 8,
  2863. reserved0: 24;
  2864. } POSTPACK;
  2865. /* DWORD 4 - mec_sa_addr_31_0 */
  2866. /* DWORD 5 */
  2867. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2868. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2869. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2870. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2871. /* DWORD 6 */
  2872. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2873. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2874. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2875. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2876. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2877. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2878. do { \
  2879. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2880. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2881. } while (0)
  2882. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2883. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2884. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2885. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2886. do { \
  2887. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2888. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2889. } while (0)
  2890. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2891. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2892. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2893. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2894. do { \
  2895. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2896. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2897. } while (0)
  2898. typedef enum {
  2899. TX_FLOW_PRIORITY_BE,
  2900. TX_FLOW_PRIORITY_HIGH,
  2901. TX_FLOW_PRIORITY_LOW,
  2902. } htt_tx_flow_priority_t;
  2903. typedef enum {
  2904. TX_FLOW_LATENCY_SENSITIVE,
  2905. TX_FLOW_LATENCY_INSENSITIVE,
  2906. } htt_tx_flow_latency_t;
  2907. typedef enum {
  2908. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2909. TX_FLOW_INTERACTIVE_TRAFFIC,
  2910. TX_FLOW_PERIODIC_TRAFFIC,
  2911. TX_FLOW_BURSTY_TRAFFIC,
  2912. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2913. } htt_tx_flow_traffic_pattern_t;
  2914. /**
  2915. * @brief HTT TX Flow search metadata format
  2916. * @details
  2917. * Host will set this metadata in flow table's flow search entry along with
  2918. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2919. * firmware and TQM ring if the flow search entry wins.
  2920. * This metadata is available to firmware in that first MSDU's
  2921. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2922. * to one of the available flows for specific tid and returns the tqm flow
  2923. * pointer as part of htt_tx_map_flow_info message.
  2924. */
  2925. PREPACK struct htt_tx_flow_metadata {
  2926. A_UINT32
  2927. rsvd0_1_0: 2,
  2928. tid: 4,
  2929. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2930. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2931. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2932. * Else choose final tid based on latency, priority.
  2933. */
  2934. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2935. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2936. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2937. } POSTPACK;
  2938. /* DWORD 0 */
  2939. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2940. #define HTT_TX_FLOW_METADATA_TID_S 2
  2941. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2942. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2943. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2944. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2945. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2946. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2947. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2948. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2949. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2950. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2951. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2952. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2953. /* DWORD 0 */
  2954. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2955. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2956. HTT_TX_FLOW_METADATA_TID_S)
  2957. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2960. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2961. } while (0)
  2962. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2963. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2964. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2965. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2968. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2969. } while (0)
  2970. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2971. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2972. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2973. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2974. do { \
  2975. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2976. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2977. } while (0)
  2978. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2979. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2980. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2981. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2982. do { \
  2983. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2984. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2985. } while (0)
  2986. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2987. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2988. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2989. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2990. do { \
  2991. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2992. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2993. } while (0)
  2994. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2995. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2996. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2997. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2998. do { \
  2999. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  3000. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  3001. } while (0)
  3002. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3003. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3004. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3005. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3008. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3009. } while (0)
  3010. /**
  3011. * @brief host -> target ADD WDS Entry
  3012. *
  3013. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3014. *
  3015. * @brief host -> target DELETE WDS Entry
  3016. *
  3017. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3018. *
  3019. * @details
  3020. * HTT wds entry from source port learning
  3021. * Host will learn wds entries from rx and send this message to firmware
  3022. * to enable firmware to configure/delete AST entries for wds clients.
  3023. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3024. * and when SA's entry is deleted, firmware removes this AST entry
  3025. *
  3026. * The message would appear as follows:
  3027. *
  3028. * |31 30|29 |17 16|15 8|7 0|
  3029. * |----------------+----------------+----------------+----------------|
  3030. * | rsvd0 |PDVID| vdev_id | msg_type |
  3031. * |-------------------------------------------------------------------|
  3032. * | sa_addr_31_0 |
  3033. * |-------------------------------------------------------------------|
  3034. * | | ta_peer_id | sa_addr_47_32 |
  3035. * |-------------------------------------------------------------------|
  3036. * Where PDVID = pdev_id
  3037. *
  3038. * The message is interpreted as follows:
  3039. *
  3040. * dword0 - b'0:7 - msg_type: This will be set to
  3041. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3042. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3043. *
  3044. * dword0 - b'8:15 - vdev_id
  3045. *
  3046. * dword0 - b'16:17 - pdev_id
  3047. *
  3048. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3049. *
  3050. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3051. *
  3052. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3053. *
  3054. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3055. */
  3056. PREPACK struct htt_wds_entry {
  3057. A_UINT32
  3058. msg_type: 8,
  3059. vdev_id: 8,
  3060. pdev_id: 2,
  3061. rsvd0: 14;
  3062. A_UINT32 sa_addr_31_0;
  3063. A_UINT32
  3064. sa_addr_47_32: 16,
  3065. ta_peer_id: 14,
  3066. rsvd2: 2;
  3067. } POSTPACK;
  3068. /* DWORD 0 */
  3069. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3070. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3071. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3072. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3073. /* DWORD 2 */
  3074. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3075. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3076. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3077. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3078. /* DWORD 0 */
  3079. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3080. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3081. HTT_WDS_ENTRY_VDEV_ID_S)
  3082. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3083. do { \
  3084. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3085. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3086. } while (0)
  3087. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3088. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3089. HTT_WDS_ENTRY_PDEV_ID_S)
  3090. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3091. do { \
  3092. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3093. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3094. } while (0)
  3095. /* DWORD 2 */
  3096. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3097. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3098. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3099. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3100. do { \
  3101. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3102. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3103. } while (0)
  3104. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3105. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3106. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3107. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3108. do { \
  3109. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3110. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3111. } while (0)
  3112. /**
  3113. * @brief MAC DMA rx ring setup specification
  3114. *
  3115. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3116. *
  3117. * @details
  3118. * To allow for dynamic rx ring reconfiguration and to avoid race
  3119. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3120. * it uses. Instead, it sends this message to the target, indicating how
  3121. * the rx ring used by the host should be set up and maintained.
  3122. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3123. * specifications.
  3124. *
  3125. * |31 16|15 8|7 0|
  3126. * |---------------------------------------------------------------|
  3127. * header: | reserved | num rings | msg type |
  3128. * |---------------------------------------------------------------|
  3129. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3130. #if HTT_PADDR64
  3131. * | FW_IDX shadow register physical address (bits 63:32) |
  3132. #endif
  3133. * |---------------------------------------------------------------|
  3134. * | rx ring base physical address (bits 31:0) |
  3135. #if HTT_PADDR64
  3136. * | rx ring base physical address (bits 63:32) |
  3137. #endif
  3138. * |---------------------------------------------------------------|
  3139. * | rx ring buffer size | rx ring length |
  3140. * |---------------------------------------------------------------|
  3141. * | FW_IDX initial value | enabled flags |
  3142. * |---------------------------------------------------------------|
  3143. * | MSDU payload offset | 802.11 header offset |
  3144. * |---------------------------------------------------------------|
  3145. * | PPDU end offset | PPDU start offset |
  3146. * |---------------------------------------------------------------|
  3147. * | MPDU end offset | MPDU start offset |
  3148. * |---------------------------------------------------------------|
  3149. * | MSDU end offset | MSDU start offset |
  3150. * |---------------------------------------------------------------|
  3151. * | frag info offset | rx attention offset |
  3152. * |---------------------------------------------------------------|
  3153. * payload 2, if present, has the same format as payload 1
  3154. * Header fields:
  3155. * - MSG_TYPE
  3156. * Bits 7:0
  3157. * Purpose: identifies this as an rx ring configuration message
  3158. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3159. * - NUM_RINGS
  3160. * Bits 15:8
  3161. * Purpose: indicates whether the host is setting up one rx ring or two
  3162. * Value: 1 or 2
  3163. * Payload:
  3164. * for systems using 64-bit format for bus addresses:
  3165. * - IDX_SHADOW_REG_PADDR_LO
  3166. * Bits 31:0
  3167. * Value: lower 4 bytes of physical address of the host's
  3168. * FW_IDX shadow register
  3169. * - IDX_SHADOW_REG_PADDR_HI
  3170. * Bits 31:0
  3171. * Value: upper 4 bytes of physical address of the host's
  3172. * FW_IDX shadow register
  3173. * - RING_BASE_PADDR_LO
  3174. * Bits 31:0
  3175. * Value: lower 4 bytes of physical address of the host's rx ring
  3176. * - RING_BASE_PADDR_HI
  3177. * Bits 31:0
  3178. * Value: uppper 4 bytes of physical address of the host's rx ring
  3179. * for systems using 32-bit format for bus addresses:
  3180. * - IDX_SHADOW_REG_PADDR
  3181. * Bits 31:0
  3182. * Value: physical address of the host's FW_IDX shadow register
  3183. * - RING_BASE_PADDR
  3184. * Bits 31:0
  3185. * Value: physical address of the host's rx ring
  3186. * - RING_LEN
  3187. * Bits 15:0
  3188. * Value: number of elements in the rx ring
  3189. * - RING_BUF_SZ
  3190. * Bits 31:16
  3191. * Value: size of the buffers referenced by the rx ring, in byte units
  3192. * - ENABLED_FLAGS
  3193. * Bits 15:0
  3194. * Value: 1-bit flags to show whether different rx fields are enabled
  3195. * bit 0: 802.11 header enabled (1) or disabled (0)
  3196. * bit 1: MSDU payload enabled (1) or disabled (0)
  3197. * bit 2: PPDU start enabled (1) or disabled (0)
  3198. * bit 3: PPDU end enabled (1) or disabled (0)
  3199. * bit 4: MPDU start enabled (1) or disabled (0)
  3200. * bit 5: MPDU end enabled (1) or disabled (0)
  3201. * bit 6: MSDU start enabled (1) or disabled (0)
  3202. * bit 7: MSDU end enabled (1) or disabled (0)
  3203. * bit 8: rx attention enabled (1) or disabled (0)
  3204. * bit 9: frag info enabled (1) or disabled (0)
  3205. * bit 10: unicast rx enabled (1) or disabled (0)
  3206. * bit 11: multicast rx enabled (1) or disabled (0)
  3207. * bit 12: ctrl rx enabled (1) or disabled (0)
  3208. * bit 13: mgmt rx enabled (1) or disabled (0)
  3209. * bit 14: null rx enabled (1) or disabled (0)
  3210. * bit 15: phy data rx enabled (1) or disabled (0)
  3211. * - IDX_INIT_VAL
  3212. * Bits 31:16
  3213. * Purpose: Specify the initial value for the FW_IDX.
  3214. * Value: the number of buffers initially present in the host's rx ring
  3215. * - OFFSET_802_11_HDR
  3216. * Bits 15:0
  3217. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3218. * - OFFSET_MSDU_PAYLOAD
  3219. * Bits 31:16
  3220. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3221. * - OFFSET_PPDU_START
  3222. * Bits 15:0
  3223. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3224. * - OFFSET_PPDU_END
  3225. * Bits 31:16
  3226. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3227. * - OFFSET_MPDU_START
  3228. * Bits 15:0
  3229. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3230. * - OFFSET_MPDU_END
  3231. * Bits 31:16
  3232. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3233. * - OFFSET_MSDU_START
  3234. * Bits 15:0
  3235. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3236. * - OFFSET_MSDU_END
  3237. * Bits 31:16
  3238. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3239. * - OFFSET_RX_ATTN
  3240. * Bits 15:0
  3241. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3242. * - OFFSET_FRAG_INFO
  3243. * Bits 31:16
  3244. * Value: offset in QUAD-bytes of frag info table
  3245. */
  3246. /* header fields */
  3247. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3248. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3249. /* payload fields */
  3250. /* for systems using a 64-bit format for bus addresses */
  3251. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3252. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3253. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3254. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3255. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3256. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3257. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3258. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3259. /* for systems using a 32-bit format for bus addresses */
  3260. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3261. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3262. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3263. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3264. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3265. #define HTT_RX_RING_CFG_LEN_S 0
  3266. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3267. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3268. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3269. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3270. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3271. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3272. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3273. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3274. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3275. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3276. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3277. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3278. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3279. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3280. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3281. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3282. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3283. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3284. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3285. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3286. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3287. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3288. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3289. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3290. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3291. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3292. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3293. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3294. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3295. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3296. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3297. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3298. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3299. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3300. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3301. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3302. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3303. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3304. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3305. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3306. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3307. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3308. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3309. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3310. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3311. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3312. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3313. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3314. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3315. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3316. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3317. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3318. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3319. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3320. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3321. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3322. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3323. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3324. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3325. #if HTT_PADDR64
  3326. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3327. #else
  3328. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3329. #endif
  3330. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3331. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3332. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3333. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3334. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3337. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3338. } while (0)
  3339. /* degenerate case for 32-bit fields */
  3340. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3341. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3342. ((_var) = (_val))
  3343. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3344. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3345. ((_var) = (_val))
  3346. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3347. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3348. ((_var) = (_val))
  3349. /* degenerate case for 32-bit fields */
  3350. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3351. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3352. ((_var) = (_val))
  3353. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3354. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3355. ((_var) = (_val))
  3356. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3357. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3358. ((_var) = (_val))
  3359. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3360. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3361. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3362. do { \
  3363. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3364. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3365. } while (0)
  3366. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3367. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3368. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3369. do { \
  3370. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3371. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3372. } while (0)
  3373. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3374. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3375. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3376. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3377. do { \
  3378. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3379. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3380. } while (0)
  3381. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3382. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3383. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3384. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3385. do { \
  3386. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3387. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3388. } while (0)
  3389. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3390. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3391. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3392. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3395. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3396. } while (0)
  3397. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3398. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3399. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3400. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3403. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3404. } while (0)
  3405. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3406. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3407. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3408. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3411. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3412. } while (0)
  3413. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3414. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3415. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3416. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3419. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3420. } while (0)
  3421. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3422. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3423. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3424. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3427. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3428. } while (0)
  3429. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3430. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3431. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3432. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3435. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3436. } while (0)
  3437. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3438. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3439. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3440. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3443. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3444. } while (0)
  3445. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3446. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3447. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3448. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3451. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3452. } while (0)
  3453. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3454. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3455. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3456. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3459. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3460. } while (0)
  3461. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3462. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3463. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3464. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3467. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3468. } while (0)
  3469. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3470. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3471. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3472. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3475. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3476. } while (0)
  3477. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3478. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3479. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3480. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3483. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3484. } while (0)
  3485. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3486. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3487. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3488. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3491. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3492. } while (0)
  3493. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3494. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3495. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3496. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3499. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3500. } while (0)
  3501. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3502. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3503. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3504. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3507. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3508. } while (0)
  3509. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3510. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3511. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3512. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3515. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3516. } while (0)
  3517. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3518. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3519. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3520. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3523. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3524. } while (0)
  3525. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3526. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3527. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3528. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3531. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3532. } while (0)
  3533. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3534. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3535. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3536. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3539. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3540. } while (0)
  3541. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3542. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3543. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3544. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3547. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3548. } while (0)
  3549. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3550. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3551. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3552. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3555. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3556. } while (0)
  3557. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3558. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3559. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3560. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3563. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3564. } while (0)
  3565. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3566. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3567. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3568. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3569. do { \
  3570. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3571. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3572. } while (0)
  3573. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3574. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3575. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3576. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3577. do { \
  3578. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3579. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3580. } while (0)
  3581. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3582. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3583. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3584. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3585. do { \
  3586. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3587. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3588. } while (0)
  3589. /**
  3590. * @brief host -> target FW statistics retrieve
  3591. *
  3592. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3593. *
  3594. * @details
  3595. * The following field definitions describe the format of the HTT host
  3596. * to target FW stats retrieve message. The message specifies the type of
  3597. * stats host wants to retrieve.
  3598. *
  3599. * |31 24|23 16|15 8|7 0|
  3600. * |-----------------------------------------------------------|
  3601. * | stats types request bitmask | msg type |
  3602. * |-----------------------------------------------------------|
  3603. * | stats types reset bitmask | reserved |
  3604. * |-----------------------------------------------------------|
  3605. * | stats type | config value |
  3606. * |-----------------------------------------------------------|
  3607. * | cookie LSBs |
  3608. * |-----------------------------------------------------------|
  3609. * | cookie MSBs |
  3610. * |-----------------------------------------------------------|
  3611. * Header fields:
  3612. * - MSG_TYPE
  3613. * Bits 7:0
  3614. * Purpose: identifies this is a stats upload request message
  3615. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3616. * - UPLOAD_TYPES
  3617. * Bits 31:8
  3618. * Purpose: identifies which types of FW statistics to upload
  3619. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3620. * - RESET_TYPES
  3621. * Bits 31:8
  3622. * Purpose: identifies which types of FW statistics to reset
  3623. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3624. * - CFG_VAL
  3625. * Bits 23:0
  3626. * Purpose: give an opaque configuration value to the specified stats type
  3627. * Value: stats-type specific configuration value
  3628. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3629. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3630. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3631. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3632. * - CFG_STAT_TYPE
  3633. * Bits 31:24
  3634. * Purpose: specify which stats type (if any) the config value applies to
  3635. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3636. * a valid configuration specification
  3637. * - COOKIE_LSBS
  3638. * Bits 31:0
  3639. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3640. * message with its preceding host->target stats request message.
  3641. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3642. * - COOKIE_MSBS
  3643. * Bits 31:0
  3644. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3645. * message with its preceding host->target stats request message.
  3646. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3647. */
  3648. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3649. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3650. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3651. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3652. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3653. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3654. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3655. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3656. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3657. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3658. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3659. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3660. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3661. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3664. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3665. } while (0)
  3666. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3667. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3668. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3669. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3670. do { \
  3671. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3672. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3673. } while (0)
  3674. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3675. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3676. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3677. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3678. do { \
  3679. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3680. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3681. } while (0)
  3682. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3683. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3684. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3685. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3686. do { \
  3687. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3688. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3689. } while (0)
  3690. /**
  3691. * @brief host -> target HTT out-of-band sync request
  3692. *
  3693. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3694. *
  3695. * @details
  3696. * The HTT SYNC tells the target to suspend processing of subsequent
  3697. * HTT host-to-target messages until some other target agent locally
  3698. * informs the target HTT FW that the current sync counter is equal to
  3699. * or greater than (in a modulo sense) the sync counter specified in
  3700. * the SYNC message.
  3701. * This allows other host-target components to synchronize their operation
  3702. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3703. * security key has been downloaded to and activated by the target.
  3704. * In the absence of any explicit synchronization counter value
  3705. * specification, the target HTT FW will use zero as the default current
  3706. * sync value.
  3707. *
  3708. * |31 24|23 16|15 8|7 0|
  3709. * |-----------------------------------------------------------|
  3710. * | reserved | sync count | msg type |
  3711. * |-----------------------------------------------------------|
  3712. * Header fields:
  3713. * - MSG_TYPE
  3714. * Bits 7:0
  3715. * Purpose: identifies this as a sync message
  3716. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3717. * - SYNC_COUNT
  3718. * Bits 15:8
  3719. * Purpose: specifies what sync value the HTT FW will wait for from
  3720. * an out-of-band specification to resume its operation
  3721. * Value: in-band sync counter value to compare against the out-of-band
  3722. * counter spec.
  3723. * The HTT target FW will suspend its host->target message processing
  3724. * as long as
  3725. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3726. */
  3727. #define HTT_H2T_SYNC_MSG_SZ 4
  3728. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3729. #define HTT_H2T_SYNC_COUNT_S 8
  3730. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3731. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3732. HTT_H2T_SYNC_COUNT_S)
  3733. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3736. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3737. } while (0)
  3738. /**
  3739. * @brief host -> target HTT aggregation configuration
  3740. *
  3741. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3742. */
  3743. #define HTT_AGGR_CFG_MSG_SZ 4
  3744. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3745. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3746. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3747. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3748. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3749. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3750. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3751. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3752. do { \
  3753. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3754. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3755. } while (0)
  3756. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3757. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3758. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3759. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3760. do { \
  3761. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3762. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3763. } while (0)
  3764. /**
  3765. * @brief host -> target HTT configure max amsdu info per vdev
  3766. *
  3767. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3768. *
  3769. * @details
  3770. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3771. *
  3772. * |31 21|20 16|15 8|7 0|
  3773. * |-----------------------------------------------------------|
  3774. * | reserved | vdev id | max amsdu | msg type |
  3775. * |-----------------------------------------------------------|
  3776. * Header fields:
  3777. * - MSG_TYPE
  3778. * Bits 7:0
  3779. * Purpose: identifies this as a aggr cfg ex message
  3780. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3781. * - MAX_NUM_AMSDU_SUBFRM
  3782. * Bits 15:8
  3783. * Purpose: max MSDUs per A-MSDU
  3784. * - VDEV_ID
  3785. * Bits 20:16
  3786. * Purpose: ID of the vdev to which this limit is applied
  3787. */
  3788. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3789. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3790. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3791. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3792. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3793. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3794. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3795. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3796. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3797. do { \
  3798. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3799. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3800. } while (0)
  3801. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3802. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3803. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3804. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3805. do { \
  3806. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3807. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3808. } while (0)
  3809. /**
  3810. * @brief HTT WDI_IPA Config Message
  3811. *
  3812. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3813. *
  3814. * @details
  3815. * The HTT WDI_IPA config message is created/sent by host at driver
  3816. * init time. It contains information about data structures used on
  3817. * WDI_IPA TX and RX path.
  3818. * TX CE ring is used for pushing packet metadata from IPA uC
  3819. * to WLAN FW
  3820. * TX Completion ring is used for generating TX completions from
  3821. * WLAN FW to IPA uC
  3822. * RX Indication ring is used for indicating RX packets from FW
  3823. * to IPA uC
  3824. * RX Ring2 is used as either completion ring or as second
  3825. * indication ring. when Ring2 is used as completion ring, IPA uC
  3826. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3827. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3828. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3829. * indicated in RX Indication ring. Please see WDI_IPA specification
  3830. * for more details.
  3831. * |31 24|23 16|15 8|7 0|
  3832. * |----------------+----------------+----------------+----------------|
  3833. * | tx pkt pool size | Rsvd | msg_type |
  3834. * |-------------------------------------------------------------------|
  3835. * | tx comp ring base (bits 31:0) |
  3836. #if HTT_PADDR64
  3837. * | tx comp ring base (bits 63:32) |
  3838. #endif
  3839. * |-------------------------------------------------------------------|
  3840. * | tx comp ring size |
  3841. * |-------------------------------------------------------------------|
  3842. * | tx comp WR_IDX physical address (bits 31:0) |
  3843. #if HTT_PADDR64
  3844. * | tx comp WR_IDX physical address (bits 63:32) |
  3845. #endif
  3846. * |-------------------------------------------------------------------|
  3847. * | tx CE WR_IDX physical address (bits 31:0) |
  3848. #if HTT_PADDR64
  3849. * | tx CE WR_IDX physical address (bits 63:32) |
  3850. #endif
  3851. * |-------------------------------------------------------------------|
  3852. * | rx indication ring base (bits 31:0) |
  3853. #if HTT_PADDR64
  3854. * | rx indication ring base (bits 63:32) |
  3855. #endif
  3856. * |-------------------------------------------------------------------|
  3857. * | rx indication ring size |
  3858. * |-------------------------------------------------------------------|
  3859. * | rx ind RD_IDX physical address (bits 31:0) |
  3860. #if HTT_PADDR64
  3861. * | rx ind RD_IDX physical address (bits 63:32) |
  3862. #endif
  3863. * |-------------------------------------------------------------------|
  3864. * | rx ind WR_IDX physical address (bits 31:0) |
  3865. #if HTT_PADDR64
  3866. * | rx ind WR_IDX physical address (bits 63:32) |
  3867. #endif
  3868. * |-------------------------------------------------------------------|
  3869. * |-------------------------------------------------------------------|
  3870. * | rx ring2 base (bits 31:0) |
  3871. #if HTT_PADDR64
  3872. * | rx ring2 base (bits 63:32) |
  3873. #endif
  3874. * |-------------------------------------------------------------------|
  3875. * | rx ring2 size |
  3876. * |-------------------------------------------------------------------|
  3877. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3878. #if HTT_PADDR64
  3879. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3880. #endif
  3881. * |-------------------------------------------------------------------|
  3882. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3883. #if HTT_PADDR64
  3884. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3885. #endif
  3886. * |-------------------------------------------------------------------|
  3887. *
  3888. * Header fields:
  3889. * Header fields:
  3890. * - MSG_TYPE
  3891. * Bits 7:0
  3892. * Purpose: Identifies this as WDI_IPA config message
  3893. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3894. * - TX_PKT_POOL_SIZE
  3895. * Bits 15:0
  3896. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3897. * WDI_IPA TX path
  3898. * For systems using 32-bit format for bus addresses:
  3899. * - TX_COMP_RING_BASE_ADDR
  3900. * Bits 31:0
  3901. * Purpose: TX Completion Ring base address in DDR
  3902. * - TX_COMP_RING_SIZE
  3903. * Bits 31:0
  3904. * Purpose: TX Completion Ring size (must be power of 2)
  3905. * - TX_COMP_WR_IDX_ADDR
  3906. * Bits 31:0
  3907. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3908. * updates the Write Index for WDI_IPA TX completion ring
  3909. * - TX_CE_WR_IDX_ADDR
  3910. * Bits 31:0
  3911. * Purpose: DDR address where IPA uC
  3912. * updates the WR Index for TX CE ring
  3913. * (needed for fusion platforms)
  3914. * - RX_IND_RING_BASE_ADDR
  3915. * Bits 31:0
  3916. * Purpose: RX Indication Ring base address in DDR
  3917. * - RX_IND_RING_SIZE
  3918. * Bits 31:0
  3919. * Purpose: RX Indication Ring size
  3920. * - RX_IND_RD_IDX_ADDR
  3921. * Bits 31:0
  3922. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3923. * RX indication ring
  3924. * - RX_IND_WR_IDX_ADDR
  3925. * Bits 31:0
  3926. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3927. * updates the Write Index for WDI_IPA RX indication ring
  3928. * - RX_RING2_BASE_ADDR
  3929. * Bits 31:0
  3930. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3931. * - RX_RING2_SIZE
  3932. * Bits 31:0
  3933. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3934. * - RX_RING2_RD_IDX_ADDR
  3935. * Bits 31:0
  3936. * Purpose: If Second RX ring is Indication ring, DDR address where
  3937. * IPA uC updates the Read Index for Ring2.
  3938. * If Second RX ring is completion ring, this is NOT used
  3939. * - RX_RING2_WR_IDX_ADDR
  3940. * Bits 31:0
  3941. * Purpose: If Second RX ring is Indication ring, DDR address where
  3942. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3943. * If second RX ring is completion ring, DDR address where
  3944. * IPA uC updates the Write Index for Ring 2.
  3945. * For systems using 64-bit format for bus addresses:
  3946. * - TX_COMP_RING_BASE_ADDR_LO
  3947. * Bits 31:0
  3948. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3949. * - TX_COMP_RING_BASE_ADDR_HI
  3950. * Bits 31:0
  3951. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3952. * - TX_COMP_RING_SIZE
  3953. * Bits 31:0
  3954. * Purpose: TX Completion Ring size (must be power of 2)
  3955. * - TX_COMP_WR_IDX_ADDR_LO
  3956. * Bits 31:0
  3957. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3958. * Lower 4 bytes of DDR address where WIFI FW
  3959. * updates the Write Index for WDI_IPA TX completion ring
  3960. * - TX_COMP_WR_IDX_ADDR_HI
  3961. * Bits 31:0
  3962. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3963. * Higher 4 bytes of DDR address where WIFI FW
  3964. * updates the Write Index for WDI_IPA TX completion ring
  3965. * - TX_CE_WR_IDX_ADDR_LO
  3966. * Bits 31:0
  3967. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3968. * updates the WR Index for TX CE ring
  3969. * (needed for fusion platforms)
  3970. * - TX_CE_WR_IDX_ADDR_HI
  3971. * Bits 31:0
  3972. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3973. * updates the WR Index for TX CE ring
  3974. * (needed for fusion platforms)
  3975. * - RX_IND_RING_BASE_ADDR_LO
  3976. * Bits 31:0
  3977. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3978. * - RX_IND_RING_BASE_ADDR_HI
  3979. * Bits 31:0
  3980. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3981. * - RX_IND_RING_SIZE
  3982. * Bits 31:0
  3983. * Purpose: RX Indication Ring size
  3984. * - RX_IND_RD_IDX_ADDR_LO
  3985. * Bits 31:0
  3986. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3987. * for WDI_IPA RX indication ring
  3988. * - RX_IND_RD_IDX_ADDR_HI
  3989. * Bits 31:0
  3990. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3991. * for WDI_IPA RX indication ring
  3992. * - RX_IND_WR_IDX_ADDR_LO
  3993. * Bits 31:0
  3994. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3995. * Lower 4 bytes of DDR address where WIFI FW
  3996. * updates the Write Index for WDI_IPA RX indication ring
  3997. * - RX_IND_WR_IDX_ADDR_HI
  3998. * Bits 31:0
  3999. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  4000. * Higher 4 bytes of DDR address where WIFI FW
  4001. * updates the Write Index for WDI_IPA RX indication ring
  4002. * - RX_RING2_BASE_ADDR_LO
  4003. * Bits 31:0
  4004. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4005. * - RX_RING2_BASE_ADDR_HI
  4006. * Bits 31:0
  4007. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4008. * - RX_RING2_SIZE
  4009. * Bits 31:0
  4010. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4011. * - RX_RING2_RD_IDX_ADDR_LO
  4012. * Bits 31:0
  4013. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4014. * DDR address where IPA uC updates the Read Index for Ring2.
  4015. * If Second RX ring is completion ring, this is NOT used
  4016. * - RX_RING2_RD_IDX_ADDR_HI
  4017. * Bits 31:0
  4018. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4019. * DDR address where IPA uC updates the Read Index for Ring2.
  4020. * If Second RX ring is completion ring, this is NOT used
  4021. * - RX_RING2_WR_IDX_ADDR_LO
  4022. * Bits 31:0
  4023. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4024. * DDR address where WIFI FW updates the Write Index
  4025. * for WDI_IPA RX ring2
  4026. * If second RX ring is completion ring, lower 4 bytes of
  4027. * DDR address where IPA uC updates the Write Index for Ring 2.
  4028. * - RX_RING2_WR_IDX_ADDR_HI
  4029. * Bits 31:0
  4030. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4031. * DDR address where WIFI FW updates the Write Index
  4032. * for WDI_IPA RX ring2
  4033. * If second RX ring is completion ring, higher 4 bytes of
  4034. * DDR address where IPA uC updates the Write Index for Ring 2.
  4035. */
  4036. #if HTT_PADDR64
  4037. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4038. #else
  4039. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4040. #endif
  4041. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4042. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4051. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4055. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4057. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4059. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4061. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4079. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4080. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4081. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4082. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4100. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4101. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4102. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4103. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4104. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4105. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4108. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4109. } while (0)
  4110. /* for systems using 32-bit format for bus addr */
  4111. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4112. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4113. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4114. do { \
  4115. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4116. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4117. } while (0)
  4118. /* for systems using 64-bit format for bus addr */
  4119. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4120. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4121. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4122. do { \
  4123. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4124. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4125. } while (0)
  4126. /* for systems using 64-bit format for bus addr */
  4127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4128. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4129. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4132. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4133. } while (0)
  4134. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4135. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4136. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4139. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4140. } while (0)
  4141. /* for systems using 32-bit format for bus addr */
  4142. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4143. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4144. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4147. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4148. } while (0)
  4149. /* for systems using 64-bit format for bus addr */
  4150. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4151. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4152. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4153. do { \
  4154. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4155. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4156. } while (0)
  4157. /* for systems using 64-bit format for bus addr */
  4158. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4159. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4160. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4163. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4164. } while (0)
  4165. /* for systems using 32-bit format for bus addr */
  4166. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4167. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4168. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4169. do { \
  4170. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4171. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4172. } while (0)
  4173. /* for systems using 64-bit format for bus addr */
  4174. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4175. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4176. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4179. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4180. } while (0)
  4181. /* for systems using 64-bit format for bus addr */
  4182. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4183. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4184. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4187. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4188. } while (0)
  4189. /* for systems using 32-bit format for bus addr */
  4190. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4191. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4192. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4193. do { \
  4194. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4195. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4196. } while (0)
  4197. /* for systems using 64-bit format for bus addr */
  4198. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4199. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4200. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4201. do { \
  4202. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4203. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4204. } while (0)
  4205. /* for systems using 64-bit format for bus addr */
  4206. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4207. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4208. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4211. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4212. } while (0)
  4213. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4214. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4219. } while (0)
  4220. /* for systems using 32-bit format for bus addr */
  4221. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4222. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4223. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4224. do { \
  4225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4226. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4227. } while (0)
  4228. /* for systems using 64-bit format for bus addr */
  4229. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4230. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4231. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4232. do { \
  4233. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4234. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4235. } while (0)
  4236. /* for systems using 64-bit format for bus addr */
  4237. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4238. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4239. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4242. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4243. } while (0)
  4244. /* for systems using 32-bit format for bus addr */
  4245. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4246. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4247. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4248. do { \
  4249. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4250. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4251. } while (0)
  4252. /* for systems using 64-bit format for bus addr */
  4253. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4254. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4255. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4258. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4259. } while (0)
  4260. /* for systems using 64-bit format for bus addr */
  4261. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4262. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4263. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4266. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4267. } while (0)
  4268. /* for systems using 32-bit format for bus addr */
  4269. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4270. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4271. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4272. do { \
  4273. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4274. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4275. } while (0)
  4276. /* for systems using 64-bit format for bus addr */
  4277. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4278. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4279. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4280. do { \
  4281. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4282. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4283. } while (0)
  4284. /* for systems using 64-bit format for bus addr */
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4286. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4287. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4288. do { \
  4289. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4290. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4291. } while (0)
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4293. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4295. do { \
  4296. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4297. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4298. } while (0)
  4299. /* for systems using 32-bit format for bus addr */
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4301. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4302. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4303. do { \
  4304. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4305. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4306. } while (0)
  4307. /* for systems using 64-bit format for bus addr */
  4308. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4309. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4310. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4311. do { \
  4312. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4313. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4314. } while (0)
  4315. /* for systems using 64-bit format for bus addr */
  4316. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4317. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4318. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4321. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4322. } while (0)
  4323. /* for systems using 32-bit format for bus addr */
  4324. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4325. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4326. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4327. do { \
  4328. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4329. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4330. } while (0)
  4331. /* for systems using 64-bit format for bus addr */
  4332. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4333. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4334. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4335. do { \
  4336. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4337. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4338. } while (0)
  4339. /* for systems using 64-bit format for bus addr */
  4340. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4341. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4342. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4343. do { \
  4344. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4345. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4346. } while (0)
  4347. /*
  4348. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4349. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4350. * addresses are stored in a XXX-bit field.
  4351. * This macro is used to define both htt_wdi_ipa_config32_t and
  4352. * htt_wdi_ipa_config64_t structs.
  4353. */
  4354. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4355. _paddr__tx_comp_ring_base_addr_, \
  4356. _paddr__tx_comp_wr_idx_addr_, \
  4357. _paddr__tx_ce_wr_idx_addr_, \
  4358. _paddr__rx_ind_ring_base_addr_, \
  4359. _paddr__rx_ind_rd_idx_addr_, \
  4360. _paddr__rx_ind_wr_idx_addr_, \
  4361. _paddr__rx_ring2_base_addr_,\
  4362. _paddr__rx_ring2_rd_idx_addr_,\
  4363. _paddr__rx_ring2_wr_idx_addr_) \
  4364. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4365. { \
  4366. /* DWORD 0: flags and meta-data */ \
  4367. A_UINT32 \
  4368. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4369. reserved: 8, \
  4370. tx_pkt_pool_size: 16;\
  4371. /* DWORD 1 */\
  4372. _paddr__tx_comp_ring_base_addr_;\
  4373. /* DWORD 2 (or 3)*/\
  4374. A_UINT32 tx_comp_ring_size;\
  4375. /* DWORD 3 (or 4)*/\
  4376. _paddr__tx_comp_wr_idx_addr_;\
  4377. /* DWORD 4 (or 6)*/\
  4378. _paddr__tx_ce_wr_idx_addr_;\
  4379. /* DWORD 5 (or 8)*/\
  4380. _paddr__rx_ind_ring_base_addr_;\
  4381. /* DWORD 6 (or 10)*/\
  4382. A_UINT32 rx_ind_ring_size;\
  4383. /* DWORD 7 (or 11)*/\
  4384. _paddr__rx_ind_rd_idx_addr_;\
  4385. /* DWORD 8 (or 13)*/\
  4386. _paddr__rx_ind_wr_idx_addr_;\
  4387. /* DWORD 9 (or 15)*/\
  4388. _paddr__rx_ring2_base_addr_;\
  4389. /* DWORD 10 (or 17) */\
  4390. A_UINT32 rx_ring2_size;\
  4391. /* DWORD 11 (or 18) */\
  4392. _paddr__rx_ring2_rd_idx_addr_;\
  4393. /* DWORD 12 (or 20) */\
  4394. _paddr__rx_ring2_wr_idx_addr_;\
  4395. } POSTPACK
  4396. /* define a htt_wdi_ipa_config32_t type */
  4397. 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));
  4398. /* define a htt_wdi_ipa_config64_t type */
  4399. 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));
  4400. #if HTT_PADDR64
  4401. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4402. #else
  4403. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4404. #endif
  4405. enum htt_wdi_ipa_op_code {
  4406. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4407. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4408. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4409. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4410. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4411. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4412. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4413. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4414. /* keep this last */
  4415. HTT_WDI_IPA_OPCODE_MAX
  4416. };
  4417. /**
  4418. * @brief HTT WDI_IPA Operation Request Message
  4419. *
  4420. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4421. *
  4422. * @details
  4423. * HTT WDI_IPA Operation Request message is sent by host
  4424. * to either suspend or resume WDI_IPA TX or RX path.
  4425. * |31 24|23 16|15 8|7 0|
  4426. * |----------------+----------------+----------------+----------------|
  4427. * | op_code | Rsvd | msg_type |
  4428. * |-------------------------------------------------------------------|
  4429. *
  4430. * Header fields:
  4431. * - MSG_TYPE
  4432. * Bits 7:0
  4433. * Purpose: Identifies this as WDI_IPA Operation Request message
  4434. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4435. * - OP_CODE
  4436. * Bits 31:16
  4437. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4438. * value: = enum htt_wdi_ipa_op_code
  4439. */
  4440. PREPACK struct htt_wdi_ipa_op_request_t
  4441. {
  4442. /* DWORD 0: flags and meta-data */
  4443. A_UINT32
  4444. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4445. reserved: 8,
  4446. op_code: 16;
  4447. } POSTPACK;
  4448. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4449. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4450. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4451. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4452. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4453. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4454. do { \
  4455. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4456. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4457. } while (0)
  4458. /*
  4459. * @brief host -> target HTT_MSI_SETUP message
  4460. *
  4461. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4462. *
  4463. * @details
  4464. * After target is booted up, host can send MSI setup message so that
  4465. * target sets up HW registers based on setup message.
  4466. *
  4467. * The message would appear as follows:
  4468. * |31 24|23 16|15|14 8|7 0|
  4469. * |---------------+-----------------+-----------------+-----------------|
  4470. * | reserved | msi_type | pdev_id | msg_type |
  4471. * |---------------------------------------------------------------------|
  4472. * | msi_addr_lo |
  4473. * |---------------------------------------------------------------------|
  4474. * | msi_addr_hi |
  4475. * |---------------------------------------------------------------------|
  4476. * | msi_data |
  4477. * |---------------------------------------------------------------------|
  4478. *
  4479. * The message is interpreted as follows:
  4480. * dword0 - b'0:7 - msg_type: This will be set to
  4481. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4482. * b'8:15 - pdev_id:
  4483. * 0 (for rings at SOC/UMAC level),
  4484. * 1/2/3 mac id (for rings at LMAC level)
  4485. * b'16:23 - msi_type: identify which msi registers need to be setup
  4486. * more details can be got from enum htt_msi_setup_type
  4487. * b'24:31 - reserved
  4488. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4489. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4490. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4491. */
  4492. PREPACK struct htt_msi_setup_t {
  4493. A_UINT32 msg_type: 8,
  4494. pdev_id: 8,
  4495. msi_type: 8,
  4496. reserved: 8;
  4497. A_UINT32 msi_addr_lo;
  4498. A_UINT32 msi_addr_hi;
  4499. A_UINT32 msi_data;
  4500. } POSTPACK;
  4501. enum htt_msi_setup_type {
  4502. HTT_PPDU_END_MSI_SETUP_TYPE,
  4503. /* Insert new types here*/
  4504. };
  4505. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4506. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4507. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4508. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4509. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4510. HTT_MSI_SETUP_PDEV_ID_S)
  4511. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4514. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4515. } while (0)
  4516. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4517. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4518. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4519. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4520. HTT_MSI_SETUP_MSI_TYPE_S)
  4521. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4522. do { \
  4523. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4524. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4525. } while (0)
  4526. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4527. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4528. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4529. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4530. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4531. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4534. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4535. } while (0)
  4536. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4537. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4538. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4539. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4540. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4541. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4544. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4545. } while (0)
  4546. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4547. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4548. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4549. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4550. HTT_MSI_SETUP_MSI_DATA_S)
  4551. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4554. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4555. } while (0)
  4556. /*
  4557. * @brief host -> target HTT_SRING_SETUP message
  4558. *
  4559. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4560. *
  4561. * @details
  4562. * After target is booted up, Host can send SRING setup message for
  4563. * each host facing LMAC SRING. Target setups up HW registers based
  4564. * on setup message and confirms back to Host if response_required is set.
  4565. * Host should wait for confirmation message before sending new SRING
  4566. * setup message
  4567. *
  4568. * The message would appear as follows:
  4569. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4570. * |--------------- +-----------------+-----------------+-----------------|
  4571. * | ring_type | ring_id | pdev_id | msg_type |
  4572. * |----------------------------------------------------------------------|
  4573. * | ring_base_addr_lo |
  4574. * |----------------------------------------------------------------------|
  4575. * | ring_base_addr_hi |
  4576. * |----------------------------------------------------------------------|
  4577. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4578. * |----------------------------------------------------------------------|
  4579. * | ring_head_offset32_remote_addr_lo |
  4580. * |----------------------------------------------------------------------|
  4581. * | ring_head_offset32_remote_addr_hi |
  4582. * |----------------------------------------------------------------------|
  4583. * | ring_tail_offset32_remote_addr_lo |
  4584. * |----------------------------------------------------------------------|
  4585. * | ring_tail_offset32_remote_addr_hi |
  4586. * |----------------------------------------------------------------------|
  4587. * | ring_msi_addr_lo |
  4588. * |----------------------------------------------------------------------|
  4589. * | ring_msi_addr_hi |
  4590. * |----------------------------------------------------------------------|
  4591. * | ring_msi_data |
  4592. * |----------------------------------------------------------------------|
  4593. * | intr_timer_th |IM| intr_batch_counter_th |
  4594. * |----------------------------------------------------------------------|
  4595. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4596. * |----------------------------------------------------------------------|
  4597. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4598. * |----------------------------------------------------------------------|
  4599. * Where
  4600. * IM = sw_intr_mode
  4601. * RR = response_required
  4602. * PTCF = prefetch_timer_cfg
  4603. * IP = IPA drop flag
  4604. *
  4605. * The message is interpreted as follows:
  4606. * dword0 - b'0:7 - msg_type: This will be set to
  4607. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4608. * b'8:15 - pdev_id:
  4609. * 0 (for rings at SOC/UMAC level),
  4610. * 1/2/3 mac id (for rings at LMAC level)
  4611. * b'16:23 - ring_id: identify which ring is to setup,
  4612. * more details can be got from enum htt_srng_ring_id
  4613. * b'24:31 - ring_type: identify type of host rings,
  4614. * more details can be got from enum htt_srng_ring_type
  4615. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4616. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4617. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4618. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4619. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4620. * SW_TO_HW_RING.
  4621. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4622. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4623. * Lower 32 bits of memory address of the remote variable
  4624. * storing the 4-byte word offset that identifies the head
  4625. * element within the ring.
  4626. * (The head offset variable has type A_UINT32.)
  4627. * Valid for HW_TO_SW and SW_TO_SW rings.
  4628. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4629. * Upper 32 bits of memory address of the remote variable
  4630. * storing the 4-byte word offset that identifies the head
  4631. * element within the ring.
  4632. * (The head offset variable has type A_UINT32.)
  4633. * Valid for HW_TO_SW and SW_TO_SW rings.
  4634. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4635. * Lower 32 bits of memory address of the remote variable
  4636. * storing the 4-byte word offset that identifies the tail
  4637. * element within the ring.
  4638. * (The tail offset variable has type A_UINT32.)
  4639. * Valid for HW_TO_SW and SW_TO_SW rings.
  4640. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4641. * Upper 32 bits of memory address of the remote variable
  4642. * storing the 4-byte word offset that identifies the tail
  4643. * element within the ring.
  4644. * (The tail offset variable has type A_UINT32.)
  4645. * Valid for HW_TO_SW and SW_TO_SW rings.
  4646. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4647. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4648. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4649. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4650. * dword10 - b'0:31 - ring_msi_data: MSI data
  4651. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4652. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4653. * dword11 - b'0:14 - intr_batch_counter_th:
  4654. * batch counter threshold is in units of 4-byte words.
  4655. * HW internally maintains and increments batch count.
  4656. * (see SRING spec for detail description).
  4657. * When batch count reaches threshold value, an interrupt
  4658. * is generated by HW.
  4659. * b'15 - sw_intr_mode:
  4660. * This configuration shall be static.
  4661. * Only programmed at power up.
  4662. * 0: generate pulse style sw interrupts
  4663. * 1: generate level style sw interrupts
  4664. * b'16:31 - intr_timer_th:
  4665. * The timer init value when timer is idle or is
  4666. * initialized to start downcounting.
  4667. * In 8us units (to cover a range of 0 to 524 ms)
  4668. * dword12 - b'0:15 - intr_low_threshold:
  4669. * Used only by Consumer ring to generate ring_sw_int_p.
  4670. * Ring entries low threshold water mark, that is used
  4671. * in combination with the interrupt timer as well as
  4672. * the the clearing of the level interrupt.
  4673. * b'16:18 - prefetch_timer_cfg:
  4674. * Used only by Consumer ring to set timer mode to
  4675. * support Application prefetch handling.
  4676. * The external tail offset/pointer will be updated
  4677. * at following intervals:
  4678. * 3'b000: (Prefetch feature disabled; used only for debug)
  4679. * 3'b001: 1 usec
  4680. * 3'b010: 4 usec
  4681. * 3'b011: 8 usec (default)
  4682. * 3'b100: 16 usec
  4683. * Others: Reserved
  4684. * b'19 - response_required:
  4685. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4686. * b'20 - ipa_drop_flag:
  4687. Indicates that host will config ipa drop threshold percentage
  4688. * b'21:31 - reserved: reserved for future use
  4689. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4690. * b'8:15 - ipa drop high threshold percentage:
  4691. * b'16:31 - Reserved
  4692. */
  4693. PREPACK struct htt_sring_setup_t {
  4694. A_UINT32 msg_type: 8,
  4695. pdev_id: 8,
  4696. ring_id: 8,
  4697. ring_type: 8;
  4698. A_UINT32 ring_base_addr_lo;
  4699. A_UINT32 ring_base_addr_hi;
  4700. A_UINT32 ring_size: 16,
  4701. ring_entry_size: 8,
  4702. ring_misc_cfg_flag: 8;
  4703. A_UINT32 ring_head_offset32_remote_addr_lo;
  4704. A_UINT32 ring_head_offset32_remote_addr_hi;
  4705. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4706. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4707. A_UINT32 ring_msi_addr_lo;
  4708. A_UINT32 ring_msi_addr_hi;
  4709. A_UINT32 ring_msi_data;
  4710. A_UINT32 intr_batch_counter_th: 15,
  4711. sw_intr_mode: 1,
  4712. intr_timer_th: 16;
  4713. A_UINT32 intr_low_threshold: 16,
  4714. prefetch_timer_cfg: 3,
  4715. response_required: 1,
  4716. ipa_drop_flag: 1,
  4717. reserved1: 11;
  4718. A_UINT32 ipa_drop_low_threshold: 8,
  4719. ipa_drop_high_threshold: 8,
  4720. reserved: 16;
  4721. } POSTPACK;
  4722. enum htt_srng_ring_type {
  4723. HTT_HW_TO_SW_RING = 0,
  4724. HTT_SW_TO_HW_RING,
  4725. HTT_SW_TO_SW_RING,
  4726. /* Insert new ring types above this line */
  4727. };
  4728. enum htt_srng_ring_id {
  4729. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4730. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4731. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4732. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4733. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4734. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4735. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4736. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4737. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4738. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4739. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4740. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4741. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4742. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4743. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4744. /* Add Other SRING which can't be directly configured by host software above this line */
  4745. };
  4746. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4747. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4748. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4749. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4750. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4751. HTT_SRING_SETUP_PDEV_ID_S)
  4752. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4753. do { \
  4754. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4755. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4756. } while (0)
  4757. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4758. #define HTT_SRING_SETUP_RING_ID_S 16
  4759. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4760. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4761. HTT_SRING_SETUP_RING_ID_S)
  4762. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4765. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4766. } while (0)
  4767. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4768. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4769. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4770. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4771. HTT_SRING_SETUP_RING_TYPE_S)
  4772. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4775. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4776. } while (0)
  4777. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4778. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4779. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4780. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4781. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4782. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4783. do { \
  4784. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4785. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4786. } while (0)
  4787. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4788. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4789. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4790. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4791. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4792. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4795. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4796. } while (0)
  4797. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4798. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4799. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4800. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4801. HTT_SRING_SETUP_RING_SIZE_S)
  4802. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4803. do { \
  4804. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4805. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4806. } while (0)
  4807. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4808. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4809. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4810. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4811. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4812. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4815. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4816. } while (0)
  4817. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4818. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4819. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4820. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4821. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4822. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4825. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4826. } while (0)
  4827. /* This control bit is applicable to only Producer, which updates Ring ID field
  4828. * of each descriptor before pushing into the ring.
  4829. * 0: updates ring_id(default)
  4830. * 1: ring_id updating disabled */
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4833. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4834. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4835. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4837. do { \
  4838. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4839. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4840. } while (0)
  4841. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4842. * of each descriptor before pushing into the ring.
  4843. * 0: updates Loopcnt(default)
  4844. * 1: Loopcnt updating disabled */
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4848. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4849. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4851. do { \
  4852. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4853. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4854. } while (0)
  4855. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4856. * into security_id port of GXI/AXI. */
  4857. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4860. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4861. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4863. do { \
  4864. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4865. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4866. } while (0)
  4867. /* During MSI write operation, SRNG drives value of this register bit into
  4868. * swap bit of GXI/AXI. */
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4872. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4873. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4875. do { \
  4876. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4877. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4878. } while (0)
  4879. /* During Pointer write operation, SRNG drives value of this register bit into
  4880. * swap bit of GXI/AXI. */
  4881. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4884. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4885. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4887. do { \
  4888. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4889. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4890. } while (0)
  4891. /* During any data or TLV write operation, SRNG drives value of this register
  4892. * bit into swap bit of GXI/AXI. */
  4893. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4894. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4896. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4897. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4898. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4899. do { \
  4900. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4901. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4902. } while (0)
  4903. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4904. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4905. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4906. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4907. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4908. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4909. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4910. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4911. do { \
  4912. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4913. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4914. } while (0)
  4915. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4916. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4917. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4918. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4919. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4920. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4921. do { \
  4922. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4923. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4924. } while (0)
  4925. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4926. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4927. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4928. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4929. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4930. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4931. do { \
  4932. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4933. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4934. } while (0)
  4935. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4936. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4937. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4938. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4939. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4940. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4941. do { \
  4942. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4943. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4944. } while (0)
  4945. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4946. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4947. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4948. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4949. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4950. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4951. do { \
  4952. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4953. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4954. } while (0)
  4955. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4956. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4957. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4958. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4959. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4960. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4961. do { \
  4962. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4963. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4964. } while (0)
  4965. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4966. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4967. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4968. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4969. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4970. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4971. do { \
  4972. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4973. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4974. } while (0)
  4975. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4976. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4977. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4978. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4979. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4980. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4981. do { \
  4982. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4983. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4984. } while (0)
  4985. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4986. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4987. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4988. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4989. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4990. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4991. do { \
  4992. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4993. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4994. } while (0)
  4995. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4996. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4997. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4998. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4999. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  5000. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  5001. do { \
  5002. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5003. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5004. } while (0)
  5005. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5006. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5007. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5008. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5009. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5010. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5011. do { \
  5012. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5013. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5014. } while (0)
  5015. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5016. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5017. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5018. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5019. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5020. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5021. do { \
  5022. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5023. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5024. } while (0)
  5025. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5026. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5027. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5028. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5029. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5030. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5031. do { \
  5032. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5033. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5034. } while (0)
  5035. /**
  5036. * @brief host -> target RX ring selection config message
  5037. *
  5038. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5039. *
  5040. * @details
  5041. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5042. * configure RXDMA rings.
  5043. * The configuration is per ring based and includes both packet subtypes
  5044. * and PPDU/MPDU TLVs.
  5045. *
  5046. * The message would appear as follows:
  5047. *
  5048. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5049. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5050. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5051. * |-----------------------+-----+-----+--------------------------------|
  5052. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5053. * |--------------------------------------------------------------------|
  5054. * | packet_type_enable_flags_0 |
  5055. * |--------------------------------------------------------------------|
  5056. * | packet_type_enable_flags_1 |
  5057. * |--------------------------------------------------------------------|
  5058. * | packet_type_enable_flags_2 |
  5059. * |--------------------------------------------------------------------|
  5060. * | packet_type_enable_flags_3 |
  5061. * |--------------------------------------------------------------------|
  5062. * | tlv_filter_in_flags |
  5063. * |-----------------------------------+--------------------------------|
  5064. * | rx_header_offset | rx_packet_offset |
  5065. * |-----------------------------------+--------------------------------|
  5066. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5067. * |-----------------------------------+--------------------------------|
  5068. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5069. * |-----------------------------------+--------------------------------|
  5070. * | rsvd3 | rx_attention_offset |
  5071. * |--------------------------------------------------------------------|
  5072. * | rsvd4 | mo| fp| rx_drop_threshold |
  5073. * | |ndp|ndp| |
  5074. * |--------------------------------------------------------------------|
  5075. * Where:
  5076. * PS = pkt_swap
  5077. * SS = status_swap
  5078. * OV = rx_offsets_valid
  5079. * DT = drop_thresh_valid
  5080. * CLM = config_length_mgmt
  5081. * CLC = config_length_ctrl
  5082. * CLD = config_length_data
  5083. * RXHDL = rx_hdr_len
  5084. * RX = rxpcu_filter_enable_flag
  5085. * The message is interpreted as follows:
  5086. * dword0 - b'0:7 - msg_type: This will be set to
  5087. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5088. * b'8:15 - pdev_id:
  5089. * 0 (for rings at SOC/UMAC level),
  5090. * 1/2/3 mac id (for rings at LMAC level)
  5091. * b'16:23 - ring_id : Identify the ring to configure.
  5092. * More details can be got from enum htt_srng_ring_id
  5093. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5094. * BUF_RING_CFG_0 defs within HW .h files,
  5095. * e.g. wmac_top_reg_seq_hwioreg.h
  5096. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5097. * BUF_RING_CFG_0 defs within HW .h files,
  5098. * e.g. wmac_top_reg_seq_hwioreg.h
  5099. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5100. * configuration fields are valid
  5101. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5102. * rx_drop_threshold field is valid
  5103. * b'28 - rx_mon_global_en: Enable/Disable global register
  5104. 8 configuration in Rx monitor module.
  5105. * b'29:31 - rsvd1: reserved for future use
  5106. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5107. * in byte units.
  5108. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5109. * b'16:18 - config_length_mgmt (MGMT):
  5110. * Represents the length of mpdu bytes for mgmt pkt.
  5111. * valid values:
  5112. * 001 - 64bytes
  5113. * 010 - 128bytes
  5114. * 100 - 256bytes
  5115. * 111 - Full mpdu bytes
  5116. * b'19:21 - config_length_ctrl (CTRL):
  5117. * Represents the length of mpdu bytes for ctrl pkt.
  5118. * valid values:
  5119. * 001 - 64bytes
  5120. * 010 - 128bytes
  5121. * 100 - 256bytes
  5122. * 111 - Full mpdu bytes
  5123. * b'22:24 - config_length_data (DATA):
  5124. * Represents the length of mpdu bytes for data pkt.
  5125. * valid values:
  5126. * 001 - 64bytes
  5127. * 010 - 128bytes
  5128. * 100 - 256bytes
  5129. * 111 - Full mpdu bytes
  5130. * b'25:26 - rx_hdr_len:
  5131. * Specifies the number of bytes of recvd packet to copy
  5132. * into the rx_hdr tlv.
  5133. * supported values for now by host:
  5134. * 01 - 64bytes
  5135. * 10 - 128bytes
  5136. * 11 - 256bytes
  5137. * default - 128 bytes
  5138. * b'27 - rxpcu_filter_enable_flag
  5139. * For Scan Radio Host CPU utilization is very high.
  5140. * In order to reduce CPU utilization we need to filter out
  5141. * certain configured MAC frames.
  5142. * To filter out configured MAC address frames, RxPCU should
  5143. * be zero which means allow all frames for MD at RxOLE
  5144. * host wil fiter out frames.
  5145. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5146. * b'28:31 - rsvd2: Reserved for future use
  5147. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5148. * Enable MGMT packet from 0b0000 to 0b1001
  5149. * bits from low to high: FP, MD, MO - 3 bits
  5150. * FP: Filter_Pass
  5151. * MD: Monitor_Direct
  5152. * MO: Monitor_Other
  5153. * 10 mgmt subtypes * 3 bits -> 30 bits
  5154. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5155. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5156. * Enable MGMT packet from 0b1010 to 0b1111
  5157. * bits from low to high: FP, MD, MO - 3 bits
  5158. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5159. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5160. * Enable CTRL packet from 0b0000 to 0b1001
  5161. * bits from low to high: FP, MD, MO - 3 bits
  5162. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5163. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5164. * Enable CTRL packet from 0b1010 to 0b1111,
  5165. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5166. * bits from low to high: FP, MD, MO - 3 bits
  5167. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5168. * dword6 - b'0:31 - tlv_filter_in_flags:
  5169. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5170. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5171. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5172. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5173. * A value of 0 will be considered as ignore this config.
  5174. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5175. * e.g. wmac_top_reg_seq_hwioreg.h
  5176. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5177. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5178. * A value of 0 will be considered as ignore this config.
  5179. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5180. * e.g. wmac_top_reg_seq_hwioreg.h
  5181. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5182. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5183. * A value of 0 will be considered as ignore this config.
  5184. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5185. * e.g. wmac_top_reg_seq_hwioreg.h
  5186. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5187. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5188. * A value of 0 will be considered as ignore this config.
  5189. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5190. * e.g. wmac_top_reg_seq_hwioreg.h
  5191. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5192. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5193. * A value of 0 will be considered as ignore this config.
  5194. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5195. * e.g. wmac_top_reg_seq_hwioreg.h
  5196. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5197. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5198. * A value of 0 will be considered as ignore this config.
  5199. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5200. * e.g. wmac_top_reg_seq_hwioreg.h
  5201. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5202. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5203. * A value of 0 will be considered as ignore this config.
  5204. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5205. * e.g. wmac_top_reg_seq_hwioreg.h
  5206. * - b'16:31 - rsvd3 for future use
  5207. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5208. * to source rings. Consumer drops packets if the available
  5209. * words in the ring falls below the configured threshold
  5210. * value.
  5211. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5212. * by host. 1 -> subscribed
  5213. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5214. * by host. 1 -> subscribed
  5215. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5216. * subscribed by host. 1 -> subscribed
  5217. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5218. * selection for the FP PHY ERR status tlv.
  5219. * 0 - wbm2rxdma_buf_source_ring
  5220. * 1 - fw2rxdma_buf_source_ring
  5221. * 2 - sw2rxdma_buf_source_ring
  5222. * 3 - no_buffer_ring
  5223. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5224. * selection for the FP PHY ERR status tlv.
  5225. * 0 - rxdma_release_ring
  5226. * 1 - rxdma2fw_ring
  5227. * 2 - rxdma2sw_ring
  5228. * 3 - rxdma2reo_ring
  5229. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5230. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5231. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5232. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5233. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5234. * 0: MSDU level logging
  5235. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5236. * 0: MSDU level logging
  5237. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5238. * 0: MSDU level logging
  5239. * - b'23 - word_mask_compaction: enable/disable word mask for
  5240. * mpdu/msdu start/end tlvs
  5241. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5242. * manager override
  5243. * - b'25:28 - rbm_override_val: return buffer manager override value
  5244. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5245. * which have to be posted to host from phy.
  5246. * Corresponding to errors defined in
  5247. * phyrx_abort_request_reason enums 0 to 31.
  5248. * Refer to RXPCU register definition header files for the
  5249. * phyrx_abort_request_reason enum definition.
  5250. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5251. * errors which have to be posted to host from phy.
  5252. * Corresponding to errors defined in
  5253. * phyrx_abort_request_reason enums 32 to 63.
  5254. * Refer to RXPCU register definition header files for the
  5255. * phyrx_abort_request_reason enum definition.
  5256. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5257. * applicable if word mask enabled
  5258. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5259. * applicable if word mask enabled
  5260. * - b'19:31 - rsvd7
  5261. * dword15- b'0:16 - rx_msdu_end_word_mask
  5262. * - b'17:31 - rsvd5
  5263. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5264. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5265. * buffer
  5266. * 1: RX_PKT TLV logging at specified offset for the
  5267. * subsequent buffer
  5268. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5269. */
  5270. PREPACK struct htt_rx_ring_selection_cfg_t {
  5271. A_UINT32 msg_type: 8,
  5272. pdev_id: 8,
  5273. ring_id: 8,
  5274. status_swap: 1,
  5275. pkt_swap: 1,
  5276. rx_offsets_valid: 1,
  5277. drop_thresh_valid: 1,
  5278. rx_mon_global_en: 1,
  5279. rsvd1: 3;
  5280. A_UINT32 ring_buffer_size: 16,
  5281. config_length_mgmt:3,
  5282. config_length_ctrl:3,
  5283. config_length_data:3,
  5284. rx_hdr_len: 2,
  5285. rxpcu_filter_enable_flag:1,
  5286. rsvd2: 4;
  5287. A_UINT32 packet_type_enable_flags_0;
  5288. A_UINT32 packet_type_enable_flags_1;
  5289. A_UINT32 packet_type_enable_flags_2;
  5290. A_UINT32 packet_type_enable_flags_3;
  5291. A_UINT32 tlv_filter_in_flags;
  5292. A_UINT32 rx_packet_offset: 16,
  5293. rx_header_offset: 16;
  5294. A_UINT32 rx_mpdu_end_offset: 16,
  5295. rx_mpdu_start_offset: 16;
  5296. A_UINT32 rx_msdu_end_offset: 16,
  5297. rx_msdu_start_offset: 16;
  5298. A_UINT32 rx_attn_offset: 16,
  5299. rsvd3: 16;
  5300. A_UINT32 rx_drop_threshold: 10,
  5301. fp_ndp: 1,
  5302. mo_ndp: 1,
  5303. fp_phy_err: 1,
  5304. fp_phy_err_buf_src: 2,
  5305. fp_phy_err_buf_dest: 2,
  5306. pkt_type_enable_msdu_or_mpdu_logging:3,
  5307. dma_mpdu_mgmt: 1,
  5308. dma_mpdu_ctrl: 1,
  5309. dma_mpdu_data: 1,
  5310. word_mask_compaction_enable:1,
  5311. rbm_override_enable: 1,
  5312. rbm_override_val: 4,
  5313. rsvd4: 3;
  5314. A_UINT32 phy_err_mask;
  5315. A_UINT32 phy_err_mask_cont;
  5316. A_UINT32 rx_mpdu_start_word_mask:16,
  5317. rx_mpdu_end_word_mask: 3,
  5318. rsvd7: 13;
  5319. A_UINT32 rx_msdu_end_word_mask: 17,
  5320. rsvd5: 15;
  5321. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5322. rx_pkt_tlv_offset: 15,
  5323. rsvd6: 16;
  5324. } POSTPACK;
  5325. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5326. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5327. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5328. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5329. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5330. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5331. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5332. do { \
  5333. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5334. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5335. } while (0)
  5336. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5337. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5338. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5339. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5340. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5341. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5342. do { \
  5343. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5344. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5345. } while (0)
  5346. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5347. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5348. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5349. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5350. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5351. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5352. do { \
  5353. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5354. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5355. } while (0)
  5356. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5357. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5358. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5359. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5360. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5361. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5362. do { \
  5363. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5364. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5365. } while (0)
  5366. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5367. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5368. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5369. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5370. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5371. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5374. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5375. } while (0)
  5376. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5377. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5378. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5379. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5380. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5381. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5382. do { \
  5383. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5384. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5385. } while (0)
  5386. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5387. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5388. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5389. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5390. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5391. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5394. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5395. } while (0)
  5396. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5397. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5398. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5399. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5400. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5401. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5404. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5405. } while (0)
  5406. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5407. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5408. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5409. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5410. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5411. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5414. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5415. } while (0)
  5416. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5417. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5418. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5419. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5420. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5421. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5424. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5425. } while (0)
  5426. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5427. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5428. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5429. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5430. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5431. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5432. do { \
  5433. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5434. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5435. } while (0)
  5436. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5437. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5438. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5439. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5440. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5441. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5442. do { \
  5443. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5445. } while(0)
  5446. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5447. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S 27
  5448. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5449. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5450. HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S)
  5451. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5452. do { \
  5453. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_S));\
  5455. } while(0)
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5459. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5460. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5462. do { \
  5463. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5465. } while (0)
  5466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5469. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5470. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5475. } while (0)
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5479. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5480. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5482. do { \
  5483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5485. } while (0)
  5486. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5487. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5489. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5490. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5492. do { \
  5493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5495. } while (0)
  5496. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5497. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5498. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5499. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5500. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5501. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5502. do { \
  5503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5505. } while (0)
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5507. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5509. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5510. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5511. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5515. } while (0)
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5517. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5519. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5520. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5522. do { \
  5523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5525. } while (0)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5529. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5530. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5535. } while (0)
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5539. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5540. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5545. } while (0)
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5549. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5550. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5551. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5555. } while (0)
  5556. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5557. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5559. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5560. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5561. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5565. } while (0)
  5566. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5567. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5569. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5570. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5571. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5572. do { \
  5573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5575. } while (0)
  5576. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5577. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5579. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5580. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5581. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5582. do { \
  5583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5585. } while (0)
  5586. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5587. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5588. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5589. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5590. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5591. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5595. } while (0)
  5596. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5597. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5598. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5599. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5600. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5601. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5605. } while (0)
  5606. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5607. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5608. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5609. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5610. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5611. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5612. do { \
  5613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5615. } while (0)
  5616. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5617. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5618. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5619. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5620. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5621. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5625. } while (0)
  5626. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5627. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5629. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5630. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5631. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5632. do { \
  5633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5635. } while (0)
  5636. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5637. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5639. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5640. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5641. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5645. } while (0)
  5646. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5647. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5648. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5649. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5650. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5651. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5652. do { \
  5653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5655. } while (0)
  5656. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5657. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5658. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5659. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5660. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5661. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5662. do { \
  5663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5665. } while (0)
  5666. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5667. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5668. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5669. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5670. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5671. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5675. } while (0)
  5676. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5677. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5678. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5679. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5680. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5681. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5685. } while (0)
  5686. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5687. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5688. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5689. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5690. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5691. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5692. do { \
  5693. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5694. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5695. } while (0)
  5696. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5697. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5698. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5699. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5700. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5701. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5702. do { \
  5703. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5704. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5705. } while (0)
  5706. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5707. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5708. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5709. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5710. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5711. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5714. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5715. } while (0)
  5716. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5717. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5718. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5719. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5720. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5721. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5722. do { \
  5723. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5724. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5725. } while (0)
  5726. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5727. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5728. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5729. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5730. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5731. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5732. do { \
  5733. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5734. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5735. } while (0)
  5736. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5737. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5738. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5739. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5740. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5741. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5742. do { \
  5743. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5744. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5745. } while (0)
  5746. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5747. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5748. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5749. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5750. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5751. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5752. do { \
  5753. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5754. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5755. } while (0)
  5756. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5757. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5758. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5759. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5760. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5761. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5762. do { \
  5763. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5764. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5765. } while (0)
  5766. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5767. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5768. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5769. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5770. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5771. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5772. do { \
  5773. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5774. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5775. } while (0)
  5776. /*
  5777. * Subtype based MGMT frames enable bits.
  5778. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5779. */
  5780. /* association request */
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5787. /* association response */
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5794. /* Reassociation request */
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5801. /* Reassociation response */
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5808. /* Probe request */
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5815. /* Probe response */
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5822. /* Timing Advertisement */
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5829. /* Reserved */
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5836. /* Beacon */
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5843. /* ATIM */
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5850. /* Disassociation */
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5857. /* Authentication */
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5864. /* Deauthentication */
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5871. /* Action */
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5878. /* Action No Ack */
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5885. /* Reserved */
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5892. /*
  5893. * Subtype based CTRL frames enable bits.
  5894. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5895. */
  5896. /* Reserved */
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5903. /* Reserved */
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5910. /* Reserved */
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5917. /* Reserved */
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5924. /* Reserved */
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5931. /* Reserved */
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5938. /* Reserved */
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5945. /* Control Wrapper */
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5952. /* Block Ack Request */
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5959. /* Block Ack*/
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5966. /* PS-POLL */
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5973. /* RTS */
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5980. /* CTS */
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5987. /* ACK */
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5994. /* CF-END */
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  6001. /* CF-END + CF-ACK */
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6008. /* Multicast data */
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6015. /* Unicast data */
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6022. /* NULL data */
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6030. do { \
  6031. HTT_CHECK_SET_VAL(httsym, value); \
  6032. (word) |= (value) << httsym##_S; \
  6033. } while (0)
  6034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6035. (((word) & httsym##_M) >> httsym##_S)
  6036. #define htt_rx_ring_pkt_enable_subtype_set( \
  6037. word, flag, mode, type, subtype, val) \
  6038. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6039. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6040. #define htt_rx_ring_pkt_enable_subtype_get( \
  6041. word, flag, mode, type, subtype) \
  6042. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6043. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6044. /* Definition to filter in TLVs */
  6045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6068. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6069. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6070. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6071. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6072. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6073. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6074. do { \
  6075. HTT_CHECK_SET_VAL(httsym, enable); \
  6076. (word) |= (enable) << httsym##_S; \
  6077. } while (0)
  6078. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6079. (((word) & httsym##_M) >> httsym##_S)
  6080. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6081. HTT_RX_RING_TLV_ENABLE_SET( \
  6082. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6083. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6084. HTT_RX_RING_TLV_ENABLE_GET( \
  6085. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6086. /**
  6087. * @brief host -> target TX monitor config message
  6088. *
  6089. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6090. *
  6091. * @details
  6092. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6093. * configure RXDMA rings.
  6094. * The configuration is per ring based and includes both packet types
  6095. * and PPDU/MPDU TLVs.
  6096. *
  6097. * The message would appear as follows:
  6098. *
  6099. * |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|
  6100. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6101. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6102. * |-----------+--------+--------+-----+------------------------------------|
  6103. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6104. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6105. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6106. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6107. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6108. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6109. * |------------------------------------------------------------------------|
  6110. * | tlv_filter_mask_in0 |
  6111. * |------------------------------------------------------------------------|
  6112. * | tlv_filter_mask_in1 |
  6113. * |------------------------------------------------------------------------|
  6114. * | tlv_filter_mask_in2 |
  6115. * |------------------------------------------------------------------------|
  6116. * | tlv_filter_mask_in3 |
  6117. * |-----------------+-----------------+---------------------+--------------|
  6118. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6119. * |------------------------------------------------------------------------|
  6120. * | pcu_ppdu_setup_word_mask |
  6121. * |--------------------+--+--+--+-----+---------------------+--------------|
  6122. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6123. * |------------------------------------------------------------------------|
  6124. *
  6125. * Where:
  6126. * PS = pkt_swap
  6127. * SS = status_swap
  6128. * The message is interpreted as follows:
  6129. * dword0 - b'0:7 - msg_type: This will be set to
  6130. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6131. * b'8:15 - pdev_id:
  6132. * 0 (for rings at SOC level),
  6133. * 1/2/3 mac id (for rings at LMAC level)
  6134. * b'16:23 - ring_id : Identify the ring to configure.
  6135. * More details can be got from enum htt_srng_ring_id
  6136. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6137. * BUF_RING_CFG_0 defs within HW .h files,
  6138. * e.g. wmac_top_reg_seq_hwioreg.h
  6139. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6140. * BUF_RING_CFG_0 defs within HW .h files,
  6141. * e.g. wmac_top_reg_seq_hwioreg.h
  6142. * b'26 - tx_mon_global_en: Enable/Disable global register
  6143. * configuration in Tx monitor module.
  6144. * b'27:31 - rsvd1: reserved for future use
  6145. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6146. * in byte units.
  6147. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6148. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6149. * 64, 128, 256.
  6150. * If all 3 bits are set config length is > 256.
  6151. * if val is '0', then ignore this field.
  6152. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6153. * 64, 128, 256.
  6154. * If all 3 bits are set config length is > 256.
  6155. * if val is '0', then ignore this field.
  6156. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6157. * 64, 128, 256.
  6158. * If all 3 bits are set config length is > 256.
  6159. * If val is '0', then ignore this field.
  6160. * - b'25:31 - rsvd2: Reserved for future use
  6161. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6162. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6163. * If packet_type_enable_flags is '1' for MGMT type,
  6164. * monitor will ignore this bit and allow this TLV.
  6165. * If packet_type_enable_flags is '0' for MGMT type,
  6166. * monitor will use this bit to enable/disable logging
  6167. * of this TLV.
  6168. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6169. * If packet_type_enable_flags is '1' for CTRL type,
  6170. * monitor will ignore this bit and allow this TLV.
  6171. * If packet_type_enable_flags is '0' for CTRL type,
  6172. * monitor will use this bit to enable/disable logging
  6173. * of this TLV.
  6174. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6175. * If packet_type_enable_flags is '1' for DATA type,
  6176. * monitor will ignore this bit and allow this TLV.
  6177. * If packet_type_enable_flags is '0' for DATA type,
  6178. * monitor will use this bit to enable/disable logging
  6179. * of this TLV.
  6180. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6181. * If packet_type_enable_flags is '1' for MGMT type,
  6182. * monitor will ignore this bit and allow this TLV.
  6183. * If packet_type_enable_flags is '0' for MGMT type,
  6184. * monitor will use this bit to enable/disable logging
  6185. * of this TLV.
  6186. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6187. * If packet_type_enable_flags is '1' for CTRL type,
  6188. * monitor will ignore this bit and allow this TLV.
  6189. * If packet_type_enable_flags is '0' for CTRL type,
  6190. * monitor will use this bit to enable/disable logging
  6191. * of this TLV.
  6192. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6193. * If packet_type_enable_flags is '1' for DATA type,
  6194. * monitor will ignore this bit and allow this TLV.
  6195. * If packet_type_enable_flags is '0' for DATA type,
  6196. * monitor will use this bit to enable/disable logging
  6197. * of this TLV.
  6198. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6199. * If packet_type_enable_flags is '1' for MGMT type,
  6200. * monitor will ignore this bit and allow this TLV.
  6201. * If packet_type_enable_flags is '0' for MGMT type,
  6202. * monitor will use this bit to enable/disable logging
  6203. * of this TLV.
  6204. * If filter_in_TX_MPDU_START = 1 it is recommended
  6205. * to set this bit.
  6206. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6207. * If packet_type_enable_flags is '1' for CTRL type,
  6208. * monitor will ignore this bit and allow this TLV.
  6209. * If packet_type_enable_flags is '0' for CTRL type,
  6210. * monitor will use this bit to enable/disable logging
  6211. * of this TLV.
  6212. * If filter_in_TX_MPDU_START = 1 it is recommended
  6213. * to set this bit.
  6214. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6215. * If packet_type_enable_flags is '1' for DATA type,
  6216. * monitor will ignore this bit and allow this TLV.
  6217. * If packet_type_enable_flags is '0' for DATA type,
  6218. * monitor will use this bit to enable/disable logging
  6219. * of this TLV.
  6220. * If filter_in_TX_MPDU_START = 1 it is recommended
  6221. * to set this bit.
  6222. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6223. * If packet_type_enable_flags is '1' for MGMT type,
  6224. * monitor will ignore this bit and allow this TLV.
  6225. * If packet_type_enable_flags is '0' for MGMT type,
  6226. * monitor will use this bit to enable/disable logging
  6227. * of this TLV.
  6228. * If filter_in_TX_MSDU_START = 1 it is recommended
  6229. * to set this bit.
  6230. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6231. * If packet_type_enable_flags is '1' for CTRL type,
  6232. * monitor will ignore this bit and allow this TLV.
  6233. * If packet_type_enable_flags is '0' for CTRL type,
  6234. * monitor will use this bit to enable/disable logging
  6235. * of this TLV.
  6236. * If filter_in_TX_MSDU_START = 1 it is recommended
  6237. * to set this bit.
  6238. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6239. * If packet_type_enable_flags is '1' for DATA type,
  6240. * monitor will ignore this bit and allow this TLV.
  6241. * If packet_type_enable_flags is '0' for DATA type,
  6242. * monitor will use this bit to enable/disable logging
  6243. * of this TLV.
  6244. * If filter_in_TX_MSDU_START = 1 it is recommended
  6245. * to set this bit.
  6246. * b'15:31 - rsvd3: Reserved for future use
  6247. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6248. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6249. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6250. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6251. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6252. * - b'8:15 - tx_peer_entry_word_mask:
  6253. * - b'16:23 - tx_queue_ext_word_mask:
  6254. * - b'24:31 - tx_msdu_start_word_mask:
  6255. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6256. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6257. * - b'8:15 - rxpcu_user_setup_word_mask:
  6258. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6259. * MGMT, CTRL, DATA
  6260. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6261. * 0 -> MSDU level logging is enabled
  6262. * (valid only if bit is set in
  6263. * pkt_type_enable_msdu_or_mpdu_logging)
  6264. * 1 -> MPDU level logging is enabled
  6265. * (valid only if bit is set in
  6266. * pkt_type_enable_msdu_or_mpdu_logging)
  6267. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6268. * 0 -> MSDU level logging is enabled
  6269. * (valid only if bit is set in
  6270. * pkt_type_enable_msdu_or_mpdu_logging)
  6271. * 1 -> MPDU level logging is enabled
  6272. * (valid only if bit is set in
  6273. * pkt_type_enable_msdu_or_mpdu_logging)
  6274. * - b'21 - dma_mpdu_data(D) : For DATA
  6275. * 0 -> MSDU level logging is enabled
  6276. * (valid only if bit is set in
  6277. * pkt_type_enable_msdu_or_mpdu_logging)
  6278. * 1 -> MPDU level logging is enabled
  6279. * (valid only if bit is set in
  6280. * pkt_type_enable_msdu_or_mpdu_logging)
  6281. * - b'22:31 - rsvd4 for future use
  6282. */
  6283. PREPACK struct htt_tx_monitor_cfg_t {
  6284. A_UINT32 msg_type: 8,
  6285. pdev_id: 8,
  6286. ring_id: 8,
  6287. status_swap: 1,
  6288. pkt_swap: 1,
  6289. tx_mon_global_en: 1,
  6290. rsvd1: 5;
  6291. A_UINT32 ring_buffer_size: 16,
  6292. config_length_mgmt: 3,
  6293. config_length_ctrl: 3,
  6294. config_length_data: 3,
  6295. rsvd2: 7;
  6296. A_UINT32 pkt_type_enable_flags: 3,
  6297. filter_in_tx_mpdu_start_mgmt: 1,
  6298. filter_in_tx_mpdu_start_ctrl: 1,
  6299. filter_in_tx_mpdu_start_data: 1,
  6300. filter_in_tx_msdu_start_mgmt: 1,
  6301. filter_in_tx_msdu_start_ctrl: 1,
  6302. filter_in_tx_msdu_start_data: 1,
  6303. filter_in_tx_mpdu_end_mgmt: 1,
  6304. filter_in_tx_mpdu_end_ctrl: 1,
  6305. filter_in_tx_mpdu_end_data: 1,
  6306. filter_in_tx_msdu_end_mgmt: 1,
  6307. filter_in_tx_msdu_end_ctrl: 1,
  6308. filter_in_tx_msdu_end_data: 1,
  6309. rsvd3: 17;
  6310. A_UINT32 tlv_filter_mask_in0;
  6311. A_UINT32 tlv_filter_mask_in1;
  6312. A_UINT32 tlv_filter_mask_in2;
  6313. A_UINT32 tlv_filter_mask_in3;
  6314. A_UINT32 tx_fes_setup_word_mask: 8,
  6315. tx_peer_entry_word_mask: 8,
  6316. tx_queue_ext_word_mask: 8,
  6317. tx_msdu_start_word_mask: 8;
  6318. A_UINT32 pcu_ppdu_setup_word_mask;
  6319. A_UINT32 tx_mpdu_start_word_mask: 8,
  6320. rxpcu_user_setup_word_mask: 8,
  6321. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6322. dma_mpdu_mgmt: 1,
  6323. dma_mpdu_ctrl: 1,
  6324. dma_mpdu_data: 1,
  6325. rsvd4: 10;
  6326. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6327. tx_peer_entry_v2_word_mask: 12,
  6328. rsvd5: 10;
  6329. A_UINT32 fes_status_end_word_mask: 16,
  6330. response_end_status_word_mask: 16;
  6331. A_UINT32 fes_status_prot_word_mask: 11,
  6332. rsvd6: 21;
  6333. } POSTPACK;
  6334. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6335. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6336. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6337. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6338. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6339. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6340. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6341. do { \
  6342. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6343. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6344. } while (0)
  6345. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6346. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6347. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6348. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6349. HTT_TX_MONITOR_CFG_RING_ID_S)
  6350. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6351. do { \
  6352. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6353. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6354. } while (0)
  6355. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6356. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6357. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6358. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6359. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6360. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6361. do { \
  6362. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6363. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6364. } while (0)
  6365. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6366. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6367. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6368. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6369. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6370. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6371. do { \
  6372. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6373. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6374. } while (0)
  6375. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6376. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6377. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6378. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6379. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6380. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6381. do { \
  6382. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6383. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6384. } while (0)
  6385. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6386. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6387. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6388. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6389. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6390. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6391. do { \
  6392. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6393. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6394. } while (0)
  6395. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6396. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6397. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6398. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6399. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6400. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6401. do { \
  6402. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6403. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6404. } while (0)
  6405. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6406. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6407. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6408. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6409. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6410. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6411. do { \
  6412. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6413. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6414. } while (0)
  6415. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6416. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6417. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6418. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6419. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6420. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6423. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6424. } while (0)
  6425. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6426. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6427. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6428. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6429. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6430. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6431. do { \
  6432. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6433. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6434. } while (0)
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6438. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6439. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6441. do { \
  6442. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6443. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6444. } while (0)
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6448. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6449. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6451. do { \
  6452. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6453. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6454. } while (0)
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6456. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6458. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6459. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6460. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6463. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6464. } while (0)
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6466. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6468. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6469. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6470. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6473. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6474. } while (0)
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6476. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6478. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6479. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6480. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6481. do { \
  6482. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6483. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6484. } while (0)
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6486. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6488. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6489. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6490. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6491. do { \
  6492. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6493. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6494. } while (0)
  6495. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6496. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6498. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6499. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6500. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6501. do { \
  6502. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6503. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6504. } while (0)
  6505. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6506. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6508. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6509. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6510. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6511. do { \
  6512. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6513. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6514. } while (0)
  6515. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6516. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6517. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6518. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6519. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6520. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6523. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6524. } while (0)
  6525. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6526. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6527. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6528. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6529. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6530. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6533. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6534. } while (0)
  6535. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6536. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6537. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6538. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6539. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6540. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6543. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6544. } while (0)
  6545. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6546. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6547. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6548. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6549. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6550. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6551. do { \
  6552. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6553. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6554. } while (0)
  6555. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6556. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6557. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6558. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6559. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6560. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6561. do { \
  6562. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6563. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6564. } while (0)
  6565. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6566. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6567. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6568. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6569. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6570. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6571. do { \
  6572. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6573. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6574. } while (0)
  6575. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6576. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6577. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6578. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6579. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6580. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6583. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6584. } while (0)
  6585. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6586. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6587. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6588. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6589. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6590. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6593. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6594. } while (0)
  6595. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6596. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6597. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6598. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6599. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6600. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6603. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6604. } while (0)
  6605. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6606. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6607. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6608. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6609. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6610. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6611. do { \
  6612. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6613. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6614. } while (0)
  6615. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6616. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6617. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6618. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6619. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6620. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6621. do { \
  6622. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6623. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6624. } while (0)
  6625. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6626. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6627. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6628. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6629. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6630. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6633. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6634. } while (0)
  6635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6638. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6639. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6643. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6644. } while (0)
  6645. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6646. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6647. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6648. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6649. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6650. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6653. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6654. } while (0)
  6655. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6656. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6657. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6658. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6659. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6660. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6663. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6664. } while (0)
  6665. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6666. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6667. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6668. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6669. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6670. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6671. do { \
  6672. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6673. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6674. } while (0)
  6675. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6676. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6677. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6678. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6679. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6680. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6681. do { \
  6682. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6683. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6684. } while (0)
  6685. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6686. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6687. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6688. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6689. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6690. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6691. do { \
  6692. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6693. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6694. } while (0)
  6695. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6696. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6697. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6698. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6699. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6700. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6701. do { \
  6702. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6703. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6704. } while (0)
  6705. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6706. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6707. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6708. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6709. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6710. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6711. do { \
  6712. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6713. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6714. } while (0)
  6715. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6716. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6717. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6718. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6719. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6720. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6721. do { \
  6722. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6723. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6724. } while (0)
  6725. /*
  6726. * pkt_type_enable_flags
  6727. */
  6728. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6729. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6730. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6731. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6732. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6733. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6734. /*
  6735. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6736. */
  6737. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6738. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6739. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6740. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6741. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6742. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6743. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6744. do { \
  6745. HTT_CHECK_SET_VAL(httsym, value); \
  6746. (word) |= (value) << httsym##_S; \
  6747. } while (0)
  6748. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6749. (((word) & httsym##_M) >> httsym##_S)
  6750. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6751. * type -> MGMT, CTRL, DATA*/
  6752. #define htt_tx_ring_pkt_type_set( \
  6753. word, mode, type, val) \
  6754. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6755. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6756. #define htt_tx_ring_pkt_type_get( \
  6757. word, mode, type) \
  6758. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6759. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6760. /* Definition to filter in TLVs */
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6825. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6826. do { \
  6827. HTT_CHECK_SET_VAL(httsym, enable); \
  6828. (word) |= (enable) << httsym##_S; \
  6829. } while (0)
  6830. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6831. (((word) & httsym##_M) >> httsym##_S)
  6832. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6833. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6834. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6835. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6836. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6837. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6902. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6903. do { \
  6904. HTT_CHECK_SET_VAL(httsym, enable); \
  6905. (word) |= (enable) << httsym##_S; \
  6906. } while (0)
  6907. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6908. (((word) & httsym##_M) >> httsym##_S)
  6909. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6910. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6911. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6912. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6913. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6914. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6976. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6977. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6978. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6979. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6980. do { \
  6981. HTT_CHECK_SET_VAL(httsym, enable); \
  6982. (word) |= (enable) << httsym##_S; \
  6983. } while (0)
  6984. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6985. (((word) & httsym##_M) >> httsym##_S)
  6986. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6987. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6988. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6989. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6990. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6991. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7033. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7034. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7035. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7036. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7037. do { \
  7038. HTT_CHECK_SET_VAL(httsym, enable); \
  7039. (word) |= (enable) << httsym##_S; \
  7040. } while (0)
  7041. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7042. (((word) & httsym##_M) >> httsym##_S)
  7043. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7044. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7045. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7046. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7047. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7048. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7049. /**
  7050. * @brief host --> target Receive Flow Steering configuration message definition
  7051. *
  7052. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7053. *
  7054. * host --> target Receive Flow Steering configuration message definition.
  7055. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7056. * The reason for this is we want RFS to be configured and ready before MAC
  7057. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7058. *
  7059. * |31 24|23 16|15 9|8|7 0|
  7060. * |----------------+----------------+----------------+----------------|
  7061. * | reserved |E| msg type |
  7062. * |-------------------------------------------------------------------|
  7063. * Where E = RFS enable flag
  7064. *
  7065. * The RFS_CONFIG message consists of a single 4-byte word.
  7066. *
  7067. * Header fields:
  7068. * - MSG_TYPE
  7069. * Bits 7:0
  7070. * Purpose: identifies this as a RFS config msg
  7071. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7072. * - RFS_CONFIG
  7073. * Bit 8
  7074. * Purpose: Tells target whether to enable (1) or disable (0)
  7075. * flow steering feature when sending rx indication messages to host
  7076. */
  7077. #define HTT_H2T_RFS_CONFIG_M 0x100
  7078. #define HTT_H2T_RFS_CONFIG_S 8
  7079. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7080. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7081. HTT_H2T_RFS_CONFIG_S)
  7082. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7083. do { \
  7084. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7085. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7086. } while (0)
  7087. #define HTT_RFS_CFG_REQ_BYTES 4
  7088. /**
  7089. * @brief host -> target FW extended statistics request
  7090. *
  7091. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7092. *
  7093. * @details
  7094. * The following field definitions describe the format of the HTT host
  7095. * to target FW extended stats retrieve message.
  7096. * The message specifies the type of stats the host wants to retrieve.
  7097. *
  7098. * |31 24|23 16|15 8|7 0|
  7099. * |-----------------------------------------------------------|
  7100. * | reserved | stats type | pdev_mask | msg type |
  7101. * |-----------------------------------------------------------|
  7102. * | config param [0] |
  7103. * |-----------------------------------------------------------|
  7104. * | config param [1] |
  7105. * |-----------------------------------------------------------|
  7106. * | config param [2] |
  7107. * |-----------------------------------------------------------|
  7108. * | config param [3] |
  7109. * |-----------------------------------------------------------|
  7110. * | reserved |
  7111. * |-----------------------------------------------------------|
  7112. * | cookie LSBs |
  7113. * |-----------------------------------------------------------|
  7114. * | cookie MSBs |
  7115. * |-----------------------------------------------------------|
  7116. * Header fields:
  7117. * - MSG_TYPE
  7118. * Bits 7:0
  7119. * Purpose: identifies this is a extended stats upload request message
  7120. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7121. * - PDEV_MASK
  7122. * Bits 8:15
  7123. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7124. * Value: This is a overloaded field, refer to usage and interpretation of
  7125. * PDEV in interface document.
  7126. * Bit 8 : Reserved for SOC stats
  7127. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7128. * Indicates MACID_MASK in DBS
  7129. * - STATS_TYPE
  7130. * Bits 23:16
  7131. * Purpose: identifies which FW statistics to upload
  7132. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7133. * - Reserved
  7134. * Bits 31:24
  7135. * - CONFIG_PARAM [0]
  7136. * Bits 31:0
  7137. * Purpose: give an opaque configuration value to the specified stats type
  7138. * Value: stats-type specific configuration value
  7139. * Refer to htt_stats.h for interpretation for each stats sub_type
  7140. * - CONFIG_PARAM [1]
  7141. * Bits 31:0
  7142. * Purpose: give an opaque configuration value to the specified stats type
  7143. * Value: stats-type specific configuration value
  7144. * Refer to htt_stats.h for interpretation for each stats sub_type
  7145. * - CONFIG_PARAM [2]
  7146. * Bits 31:0
  7147. * Purpose: give an opaque configuration value to the specified stats type
  7148. * Value: stats-type specific configuration value
  7149. * Refer to htt_stats.h for interpretation for each stats sub_type
  7150. * - CONFIG_PARAM [3]
  7151. * Bits 31:0
  7152. * Purpose: give an opaque configuration value to the specified stats type
  7153. * Value: stats-type specific configuration value
  7154. * Refer to htt_stats.h for interpretation for each stats sub_type
  7155. * - Reserved [31:0] for future use.
  7156. * - COOKIE_LSBS
  7157. * Bits 31:0
  7158. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7159. * message with its preceding host->target stats request message.
  7160. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7161. * - COOKIE_MSBS
  7162. * Bits 31:0
  7163. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7164. * message with its preceding host->target stats request message.
  7165. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7166. */
  7167. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7168. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7169. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7170. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7171. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7172. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7173. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7174. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7175. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7176. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7177. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7178. do { \
  7179. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7180. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7181. } while (0)
  7182. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7183. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7184. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7185. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7186. do { \
  7187. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7188. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7189. } while (0)
  7190. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7191. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7192. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7193. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7194. do { \
  7195. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7196. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7197. } while (0)
  7198. /**
  7199. * @brief host -> target FW streaming statistics request
  7200. *
  7201. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7202. *
  7203. * @details
  7204. * The following field definitions describe the format of the HTT host
  7205. * to target message that requests the target to start or stop producing
  7206. * ongoing stats of the specified type.
  7207. *
  7208. * |31|30 |23 16|15 8|7 0|
  7209. * |-----------------------------------------------------------|
  7210. * |EN| reserved | stats type | reserved | msg type |
  7211. * |-----------------------------------------------------------|
  7212. * | config param [0] |
  7213. * |-----------------------------------------------------------|
  7214. * | config param [1] |
  7215. * |-----------------------------------------------------------|
  7216. * | config param [2] |
  7217. * |-----------------------------------------------------------|
  7218. * | config param [3] |
  7219. * |-----------------------------------------------------------|
  7220. * Where:
  7221. * - EN is an enable/disable flag
  7222. * Header fields:
  7223. * - MSG_TYPE
  7224. * Bits 7:0
  7225. * Purpose: identifies this is a streaming stats upload request message
  7226. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7227. * - STATS_TYPE
  7228. * Bits 23:16
  7229. * Purpose: identifies which FW statistics to upload
  7230. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7231. * Only the htt_dbg_ext_stats_type values identified as streaming
  7232. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7233. * - ENABLE
  7234. * Bit 31
  7235. * Purpose: enable/disable the target's ongoing stats of the specified type
  7236. * Value:
  7237. * 0 - disable ongoing production of the specified stats type
  7238. * 1 - enable ongoing production of the specified stats type
  7239. * - CONFIG_PARAM [0]
  7240. * Bits 31:0
  7241. * Purpose: give an opaque configuration value to the specified stats type
  7242. * Value: stats-type specific configuration value
  7243. * Refer to htt_stats.h for interpretation for each stats sub_type
  7244. * - CONFIG_PARAM [1]
  7245. * Bits 31:0
  7246. * Purpose: give an opaque configuration value to the specified stats type
  7247. * Value: stats-type specific configuration value
  7248. * Refer to htt_stats.h for interpretation for each stats sub_type
  7249. * - CONFIG_PARAM [2]
  7250. * Bits 31:0
  7251. * Purpose: give an opaque configuration value to the specified stats type
  7252. * Value: stats-type specific configuration value
  7253. * Refer to htt_stats.h for interpretation for each stats sub_type
  7254. * - CONFIG_PARAM [3]
  7255. * Bits 31:0
  7256. * Purpose: give an opaque configuration value to the specified stats type
  7257. * Value: stats-type specific configuration value
  7258. * Refer to htt_stats.h for interpretation for each stats sub_type
  7259. */
  7260. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7261. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7262. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7263. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7264. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7265. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7266. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7267. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7268. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7269. do { \
  7270. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7271. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7272. } while (0)
  7273. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7274. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7275. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7276. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7277. do { \
  7278. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7279. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7280. } while (0)
  7281. /**
  7282. * @brief host -> target FW PPDU_STATS request message
  7283. *
  7284. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7285. *
  7286. * @details
  7287. * The following field definitions describe the format of the HTT host
  7288. * to target FW for PPDU_STATS_CFG msg.
  7289. * The message allows the host to configure the PPDU_STATS_IND messages
  7290. * produced by the target.
  7291. *
  7292. * |31 24|23 16|15 8|7 0|
  7293. * |-----------------------------------------------------------|
  7294. * | REQ bit mask | pdev_mask | msg type |
  7295. * |-----------------------------------------------------------|
  7296. * Header fields:
  7297. * - MSG_TYPE
  7298. * Bits 7:0
  7299. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7300. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7301. * - PDEV_MASK
  7302. * Bits 8:15
  7303. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7304. * Value: This is a overloaded field, refer to usage and interpretation of
  7305. * PDEV in interface document.
  7306. * Bit 8 : Reserved for SOC stats
  7307. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7308. * Indicates MACID_MASK in DBS
  7309. * - REQ_TLV_BIT_MASK
  7310. * Bits 16:31
  7311. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7312. * needs to be included in the target's PPDU_STATS_IND messages.
  7313. * Value: refer htt_ppdu_stats_tlv_tag_t
  7314. *
  7315. */
  7316. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7317. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7318. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7319. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7320. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7321. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7322. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7323. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7324. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7325. do { \
  7326. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7327. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7328. } while (0)
  7329. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7330. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7331. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7332. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7333. do { \
  7334. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7335. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7336. } while (0)
  7337. /**
  7338. * @brief Host-->target HTT RX FSE setup message
  7339. *
  7340. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7341. *
  7342. * @details
  7343. * Through this message, the host will provide details of the flow tables
  7344. * in host DDR along with hash keys.
  7345. * This message can be sent per SOC or per PDEV, which is differentiated
  7346. * by pdev id values.
  7347. * The host will allocate flow search table and sends table size,
  7348. * physical DMA address of flow table, and hash keys to firmware to
  7349. * program into the RXOLE FSE HW block.
  7350. *
  7351. * The following field definitions describe the format of the RX FSE setup
  7352. * message sent from the host to target
  7353. *
  7354. * Header fields:
  7355. * dword0 - b'7:0 - msg_type: This will be set to
  7356. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7357. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7358. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7359. * pdev's LMAC ring.
  7360. * b'31:16 - reserved : Reserved for future use
  7361. * dword1 - b'19:0 - number of records: This field indicates the number of
  7362. * entries in the flow table. For example: 8k number of
  7363. * records is equivalent to
  7364. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7365. * b'27:20 - max search: This field specifies the skid length to FSE
  7366. * parser HW module whenever match is not found at the
  7367. * exact index pointed by hash.
  7368. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7369. * Refer htt_ip_da_sa_prefix below for more details.
  7370. * b'31:30 - reserved: Reserved for future use
  7371. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7372. * table allocated by host in DDR
  7373. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7374. * table allocated by host in DDR
  7375. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7376. * entry hashing
  7377. *
  7378. *
  7379. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7380. * |---------------------------------------------------------------|
  7381. * | reserved | pdev_id | MSG_TYPE |
  7382. * |---------------------------------------------------------------|
  7383. * |resvd|IPDSA| max_search | Number of records |
  7384. * |---------------------------------------------------------------|
  7385. * | base address lo |
  7386. * |---------------------------------------------------------------|
  7387. * | base address high |
  7388. * |---------------------------------------------------------------|
  7389. * | toeplitz key 31_0 |
  7390. * |---------------------------------------------------------------|
  7391. * | toeplitz key 63_32 |
  7392. * |---------------------------------------------------------------|
  7393. * | toeplitz key 95_64 |
  7394. * |---------------------------------------------------------------|
  7395. * | toeplitz key 127_96 |
  7396. * |---------------------------------------------------------------|
  7397. * | toeplitz key 159_128 |
  7398. * |---------------------------------------------------------------|
  7399. * | toeplitz key 191_160 |
  7400. * |---------------------------------------------------------------|
  7401. * | toeplitz key 223_192 |
  7402. * |---------------------------------------------------------------|
  7403. * | toeplitz key 255_224 |
  7404. * |---------------------------------------------------------------|
  7405. * | toeplitz key 287_256 |
  7406. * |---------------------------------------------------------------|
  7407. * | reserved | toeplitz key 314_288(26:0 bits) |
  7408. * |---------------------------------------------------------------|
  7409. * where:
  7410. * IPDSA = ip_da_sa
  7411. */
  7412. /**
  7413. * @brief: htt_ip_da_sa_prefix
  7414. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7415. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7416. * documentation per RFC3849
  7417. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7418. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7419. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7420. */
  7421. enum htt_ip_da_sa_prefix {
  7422. HTT_RX_IPV6_20010db8,
  7423. HTT_RX_IPV4_MAPPED_IPV6,
  7424. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7425. HTT_RX_IPV6_64FF9B,
  7426. };
  7427. /**
  7428. * @brief Host-->target HTT RX FISA configure and enable
  7429. *
  7430. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7431. *
  7432. * @details
  7433. * The host will send this command down to configure and enable the FISA
  7434. * operational params.
  7435. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7436. * register.
  7437. * Should configure both the MACs.
  7438. *
  7439. * dword0 - b'7:0 - msg_type:
  7440. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7441. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7442. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7443. * pdev's LMAC ring.
  7444. * b'31:16 - reserved : Reserved for future use
  7445. *
  7446. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7447. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7448. * packets. 1 flow search will be skipped
  7449. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7450. * tcp,udp packets
  7451. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7452. * calculation
  7453. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7454. * calculation
  7455. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7456. * calculation
  7457. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7458. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7459. * length
  7460. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7461. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7462. * length
  7463. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7464. * num jump
  7465. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7466. * num jump
  7467. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7468. * data type switch has happened for MPDU Sequence num jump
  7469. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7470. * for MPDU Sequence num jump
  7471. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7472. * for decrypt errors
  7473. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7474. * while aggregating a msdu
  7475. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7476. * The aggregation is done until (number of MSDUs aggregated
  7477. * < LIMIT + 1)
  7478. * b'31:18 - Reserved
  7479. *
  7480. * fisa_control_value - 32bit value FW can write to register
  7481. *
  7482. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7483. * Threshold value for FISA timeout (units are microseconds).
  7484. * When the global timestamp exceeds this threshold, FISA
  7485. * aggregation will be restarted.
  7486. * A value of 0 means timeout is disabled.
  7487. * Compare the threshold register with timestamp field in
  7488. * flow entry to generate timeout for the flow.
  7489. *
  7490. * |31 18 |17 16|15 8|7 0|
  7491. * |-------------------------------------------------------------|
  7492. * | reserved | pdev_mask | msg type |
  7493. * |-------------------------------------------------------------|
  7494. * | reserved | FISA_CTRL |
  7495. * |-------------------------------------------------------------|
  7496. * | FISA_TIMEOUT_THRESH |
  7497. * |-------------------------------------------------------------|
  7498. */
  7499. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7500. A_UINT32 msg_type:8,
  7501. pdev_id:8,
  7502. reserved0:16;
  7503. /**
  7504. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7505. * [17:0]
  7506. */
  7507. union {
  7508. /*
  7509. * fisa_control_bits structure is deprecated.
  7510. * Please use fisa_control_bits_v2 going forward.
  7511. */
  7512. struct {
  7513. A_UINT32 fisa_enable: 1,
  7514. ipsec_skip_search: 1,
  7515. nontcp_skip_search: 1,
  7516. add_ipv4_fixed_hdr_len: 1,
  7517. add_ipv6_fixed_hdr_len: 1,
  7518. add_tcp_fixed_hdr_len: 1,
  7519. add_udp_hdr_len: 1,
  7520. chksum_cum_ip_len_en: 1,
  7521. disable_tid_check: 1,
  7522. disable_ta_check: 1,
  7523. disable_qos_check: 1,
  7524. disable_raw_check: 1,
  7525. disable_decrypt_err_check: 1,
  7526. disable_msdu_drop_check: 1,
  7527. fisa_aggr_limit: 4,
  7528. reserved: 14;
  7529. } fisa_control_bits;
  7530. struct {
  7531. A_UINT32 fisa_enable: 1,
  7532. fisa_aggr_limit: 4,
  7533. reserved: 27;
  7534. } fisa_control_bits_v2;
  7535. A_UINT32 fisa_control_value;
  7536. } u_fisa_control;
  7537. /**
  7538. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7539. * timeout threshold for aggregation. Unit in usec.
  7540. * [31:0]
  7541. */
  7542. A_UINT32 fisa_timeout_threshold;
  7543. } POSTPACK;
  7544. /* DWord 0: pdev-ID */
  7545. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7546. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7547. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7548. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7549. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7550. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7551. do { \
  7552. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7553. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7554. } while (0)
  7555. /* Dword 1: fisa_control_value fisa config */
  7556. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7557. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7558. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7559. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7560. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7561. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7562. do { \
  7563. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7564. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7565. } while (0)
  7566. /* Dword 1: fisa_control_value ipsec_skip_search */
  7567. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7568. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7569. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7570. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7571. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7572. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7573. do { \
  7574. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7575. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7576. } while (0)
  7577. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7578. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7579. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7580. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7581. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7582. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7583. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7584. do { \
  7585. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7586. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7587. } while (0)
  7588. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7589. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7590. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7591. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7592. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7593. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7594. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7595. do { \
  7596. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7597. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7598. } while (0)
  7599. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7600. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7601. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7602. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7603. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7604. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7605. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7606. do { \
  7607. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7608. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7609. } while (0)
  7610. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7611. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7612. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7613. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7614. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7615. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7616. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7617. do { \
  7618. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7619. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7620. } while (0)
  7621. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7622. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7623. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7624. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7625. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7626. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7627. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7628. do { \
  7629. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7630. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7631. } while (0)
  7632. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7633. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7634. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7635. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7636. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7637. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7638. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7639. do { \
  7640. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7641. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7642. } while (0)
  7643. /* Dword 1: fisa_control_value disable_tid_check */
  7644. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7645. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7646. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7647. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7648. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7649. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7650. do { \
  7651. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7652. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7653. } while (0)
  7654. /* Dword 1: fisa_control_value disable_ta_check */
  7655. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7656. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7657. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7658. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7659. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7660. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7661. do { \
  7662. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7663. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7664. } while (0)
  7665. /* Dword 1: fisa_control_value disable_qos_check */
  7666. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7667. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7668. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7669. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7670. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7671. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7672. do { \
  7673. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7674. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7675. } while (0)
  7676. /* Dword 1: fisa_control_value disable_raw_check */
  7677. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7678. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7679. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7680. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7681. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7682. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7683. do { \
  7684. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7685. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7686. } while (0)
  7687. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7688. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7689. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7690. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7691. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7692. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7693. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7694. do { \
  7695. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7696. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7697. } while (0)
  7698. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7699. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7700. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7701. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7702. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7703. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7704. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7705. do { \
  7706. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7707. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7708. } while (0)
  7709. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7710. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7711. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7712. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7713. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7714. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7715. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7718. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7719. } while (0)
  7720. /* Dword 1: fisa_control_value fisa config */
  7721. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7722. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7723. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7724. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7725. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7726. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7727. do { \
  7728. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7729. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7730. } while (0)
  7731. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7732. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7733. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7734. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7735. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7736. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7737. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7738. do { \
  7739. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7740. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7741. } while (0)
  7742. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7743. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7744. pdev_id:8,
  7745. reserved0:16;
  7746. A_UINT32 num_records:20,
  7747. max_search:8,
  7748. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7749. reserved1:2;
  7750. A_UINT32 base_addr_lo;
  7751. A_UINT32 base_addr_hi;
  7752. A_UINT32 toeplitz31_0;
  7753. A_UINT32 toeplitz63_32;
  7754. A_UINT32 toeplitz95_64;
  7755. A_UINT32 toeplitz127_96;
  7756. A_UINT32 toeplitz159_128;
  7757. A_UINT32 toeplitz191_160;
  7758. A_UINT32 toeplitz223_192;
  7759. A_UINT32 toeplitz255_224;
  7760. A_UINT32 toeplitz287_256;
  7761. A_UINT32 toeplitz314_288:27,
  7762. reserved2:5;
  7763. } POSTPACK;
  7764. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7765. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7766. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7767. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7768. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7769. /* DWORD 0: Pdev ID */
  7770. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7771. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7772. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7773. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7774. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7775. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7776. do { \
  7777. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7778. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7779. } while (0)
  7780. /* DWORD 1:num of records */
  7781. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7782. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7783. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7784. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7785. HTT_RX_FSE_SETUP_NUM_REC_S)
  7786. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7787. do { \
  7788. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7789. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7790. } while (0)
  7791. /* DWORD 1:max_search */
  7792. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7793. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7794. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7795. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7796. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7797. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7798. do { \
  7799. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7800. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7801. } while (0)
  7802. /* DWORD 1:ip_da_sa prefix */
  7803. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7804. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7805. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7806. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7807. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7808. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7809. do { \
  7810. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7811. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7812. } while (0)
  7813. /* DWORD 2: Base Address LO */
  7814. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7815. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7816. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7817. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7818. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7819. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7820. do { \
  7821. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7822. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7823. } while (0)
  7824. /* DWORD 3: Base Address High */
  7825. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7826. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7827. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7828. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7829. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7830. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7831. do { \
  7832. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7833. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7834. } while (0)
  7835. /* DWORD 4-12: Hash Value */
  7836. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7837. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7838. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7839. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7840. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7841. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7842. do { \
  7843. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7844. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7845. } while (0)
  7846. /* DWORD 13: Hash Value 314:288 bits */
  7847. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7848. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7849. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7850. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7851. do { \
  7852. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7853. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7854. } while (0)
  7855. /**
  7856. * @brief Host-->target HTT RX FSE operation message
  7857. *
  7858. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7859. *
  7860. * @details
  7861. * The host will send this Flow Search Engine (FSE) operation message for
  7862. * every flow add/delete operation.
  7863. * The FSE operation includes FSE full cache invalidation or individual entry
  7864. * invalidation.
  7865. * This message can be sent per SOC or per PDEV which is differentiated
  7866. * by pdev id values.
  7867. *
  7868. * |31 16|15 8|7 1|0|
  7869. * |-------------------------------------------------------------|
  7870. * | reserved | pdev_id | MSG_TYPE |
  7871. * |-------------------------------------------------------------|
  7872. * | reserved | operation |I|
  7873. * |-------------------------------------------------------------|
  7874. * | ip_src_addr_31_0 |
  7875. * |-------------------------------------------------------------|
  7876. * | ip_src_addr_63_32 |
  7877. * |-------------------------------------------------------------|
  7878. * | ip_src_addr_95_64 |
  7879. * |-------------------------------------------------------------|
  7880. * | ip_src_addr_127_96 |
  7881. * |-------------------------------------------------------------|
  7882. * | ip_dst_addr_31_0 |
  7883. * |-------------------------------------------------------------|
  7884. * | ip_dst_addr_63_32 |
  7885. * |-------------------------------------------------------------|
  7886. * | ip_dst_addr_95_64 |
  7887. * |-------------------------------------------------------------|
  7888. * | ip_dst_addr_127_96 |
  7889. * |-------------------------------------------------------------|
  7890. * | l4_dst_port | l4_src_port |
  7891. * | (32-bit SPI incase of IPsec) |
  7892. * |-------------------------------------------------------------|
  7893. * | reserved | l4_proto |
  7894. * |-------------------------------------------------------------|
  7895. *
  7896. * where I is 1-bit ipsec_valid.
  7897. *
  7898. * The following field definitions describe the format of the RX FSE operation
  7899. * message sent from the host to target for every add/delete flow entry to flow
  7900. * table.
  7901. *
  7902. * Header fields:
  7903. * dword0 - b'7:0 - msg_type: This will be set to
  7904. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7905. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7906. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7907. * specified pdev's LMAC ring.
  7908. * b'31:16 - reserved : Reserved for future use
  7909. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7910. * (Internet Protocol Security).
  7911. * IPsec describes the framework for providing security at
  7912. * IP layer. IPsec is defined for both versions of IP:
  7913. * IPV4 and IPV6.
  7914. * Please refer to htt_rx_flow_proto enumeration below for
  7915. * more info.
  7916. * ipsec_valid = 1 for IPSEC packets
  7917. * ipsec_valid = 0 for IP Packets
  7918. * b'7:1 - operation: This indicates types of FSE operation.
  7919. * Refer to htt_rx_fse_operation enumeration:
  7920. * 0 - No Cache Invalidation required
  7921. * 1 - Cache invalidate only one entry given by IP
  7922. * src/dest address at DWORD[2:9]
  7923. * 2 - Complete FSE Cache Invalidation
  7924. * 3 - FSE Disable
  7925. * 4 - FSE Enable
  7926. * b'31:8 - reserved: Reserved for future use
  7927. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7928. * for per flow addition/deletion
  7929. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7930. * and the subsequent 3 A_UINT32 will be padding bytes.
  7931. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7932. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7933. * from 0 to 65535 but only 0 to 1023 are designated as
  7934. * well-known ports. Refer to [RFC1700] for more details.
  7935. * This field is valid only if
  7936. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7937. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7938. * range from 0 to 65535 but only 0 to 1023 are designated
  7939. * as well-known ports. Refer to [RFC1700] for more details.
  7940. * This field is valid only if
  7941. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7942. * - SPI (31:0): Security Parameters Index is an
  7943. * identification tag added to the header while using IPsec
  7944. * for tunneling the IP traffici.
  7945. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7946. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7947. * Assigned Internet Protocol Numbers.
  7948. * l4_proto numbers for standard protocol like UDP/TCP
  7949. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7950. * l4_proto = 17 for UDP etc.
  7951. * b'31:8 - reserved: Reserved for future use.
  7952. *
  7953. */
  7954. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7955. A_UINT32 msg_type:8,
  7956. pdev_id:8,
  7957. reserved0:16;
  7958. A_UINT32 ipsec_valid:1,
  7959. operation:7,
  7960. reserved1:24;
  7961. A_UINT32 ip_src_addr_31_0;
  7962. A_UINT32 ip_src_addr_63_32;
  7963. A_UINT32 ip_src_addr_95_64;
  7964. A_UINT32 ip_src_addr_127_96;
  7965. A_UINT32 ip_dest_addr_31_0;
  7966. A_UINT32 ip_dest_addr_63_32;
  7967. A_UINT32 ip_dest_addr_95_64;
  7968. A_UINT32 ip_dest_addr_127_96;
  7969. union {
  7970. A_UINT32 spi;
  7971. struct {
  7972. A_UINT32 l4_src_port:16,
  7973. l4_dest_port:16;
  7974. } ip;
  7975. } u;
  7976. A_UINT32 l4_proto:8,
  7977. reserved:24;
  7978. } POSTPACK;
  7979. /**
  7980. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7981. *
  7982. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7983. *
  7984. * @details
  7985. * The host will send this Full monitor mode register configuration message.
  7986. * This message can be sent per SOC or per PDEV which is differentiated
  7987. * by pdev id values.
  7988. *
  7989. * |31 16|15 11|10 8|7 3|2|1|0|
  7990. * |-------------------------------------------------------------|
  7991. * | reserved | pdev_id | MSG_TYPE |
  7992. * |-------------------------------------------------------------|
  7993. * | reserved |Release Ring |N|Z|E|
  7994. * |-------------------------------------------------------------|
  7995. *
  7996. * where E is 1-bit full monitor mode enable/disable.
  7997. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7998. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7999. *
  8000. * The following field definitions describe the format of the full monitor
  8001. * mode configuration message sent from the host to target for each pdev.
  8002. *
  8003. * Header fields:
  8004. * dword0 - b'7:0 - msg_type: This will be set to
  8005. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8006. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8007. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8008. * specified pdev's LMAC ring.
  8009. * b'31:16 - reserved : Reserved for future use.
  8010. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8011. * monitor mode rxdma register is to be enabled or disabled.
  8012. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8013. * additional descriptors at ppdu end for zero mpdus
  8014. * enabled or disabled.
  8015. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8016. * additional descriptors at ppdu end for non zero mpdus
  8017. * enabled or disabled.
  8018. * b'10:3 - release_ring: This indicates the destination ring
  8019. * selection for the descriptor at the end of PPDU
  8020. * 0 - REO ring select
  8021. * 1 - FW ring select
  8022. * 2 - SW ring select
  8023. * 3 - Release ring select
  8024. * Refer to htt_rx_full_mon_release_ring.
  8025. * b'31:11 - reserved for future use
  8026. */
  8027. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8028. A_UINT32 msg_type:8,
  8029. pdev_id:8,
  8030. reserved0:16;
  8031. A_UINT32 full_monitor_mode_enable:1,
  8032. addnl_descs_zero_mpdus_end:1,
  8033. addnl_descs_non_zero_mpdus_end:1,
  8034. release_ring:8,
  8035. reserved1:21;
  8036. } POSTPACK;
  8037. /**
  8038. * Enumeration for full monitor mode destination ring select
  8039. * 0 - REO destination ring select
  8040. * 1 - FW destination ring select
  8041. * 2 - SW destination ring select
  8042. * 3 - Release destination ring select
  8043. */
  8044. enum htt_rx_full_mon_release_ring {
  8045. HTT_RX_MON_RING_REO,
  8046. HTT_RX_MON_RING_FW,
  8047. HTT_RX_MON_RING_SW,
  8048. HTT_RX_MON_RING_RELEASE,
  8049. };
  8050. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8051. /* DWORD 0: Pdev ID */
  8052. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8053. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8054. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8055. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8056. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8057. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8058. do { \
  8059. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8060. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8061. } while (0)
  8062. /* DWORD 1:ENABLE */
  8063. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8064. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8065. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8066. do { \
  8067. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8068. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8069. } while (0)
  8070. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8071. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8072. /* DWORD 1:ZERO_MPDU */
  8073. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8074. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8075. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8076. do { \
  8077. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8078. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8079. } while (0)
  8080. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8081. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8082. /* DWORD 1:NON_ZERO_MPDU */
  8083. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8084. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8085. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8086. do { \
  8087. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8088. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8089. } while (0)
  8090. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8091. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8092. /* DWORD 1:RELEASE_RINGS */
  8093. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8094. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8095. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8096. do { \
  8097. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8098. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8099. } while (0)
  8100. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8101. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8102. /**
  8103. * Enumeration for IP Protocol or IPSEC Protocol
  8104. * IPsec describes the framework for providing security at IP layer.
  8105. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8106. */
  8107. enum htt_rx_flow_proto {
  8108. HTT_RX_FLOW_IP_PROTO,
  8109. HTT_RX_FLOW_IPSEC_PROTO,
  8110. };
  8111. /**
  8112. * Enumeration for FSE Cache Invalidation
  8113. * 0 - No Cache Invalidation required
  8114. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8115. * 2 - Complete FSE Cache Invalidation
  8116. * 3 - FSE Disable
  8117. * 4 - FSE Enable
  8118. */
  8119. enum htt_rx_fse_operation {
  8120. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8121. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8122. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8123. HTT_RX_FSE_DISABLE,
  8124. HTT_RX_FSE_ENABLE,
  8125. };
  8126. /* DWORD 0: Pdev ID */
  8127. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8128. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8129. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8130. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8131. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8132. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8133. do { \
  8134. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8135. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8136. } while (0)
  8137. /* DWORD 1:IP PROTO or IPSEC */
  8138. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8139. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8140. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8141. do { \
  8142. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8143. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8144. } while (0)
  8145. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8146. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8147. /* DWORD 1:FSE Operation */
  8148. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8149. #define HTT_RX_FSE_OPERATION_S 1
  8150. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8151. do { \
  8152. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8153. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8154. } while (0)
  8155. #define HTT_RX_FSE_OPERATION_GET(word) \
  8156. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8157. /* DWORD 2-9:IP Address */
  8158. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8159. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8160. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8161. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8162. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8163. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8164. do { \
  8165. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8166. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8167. } while (0)
  8168. /* DWORD 10:Source Port Number */
  8169. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8170. #define HTT_RX_FSE_SOURCEPORT_S 0
  8171. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8172. do { \
  8173. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8174. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8175. } while (0)
  8176. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8177. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8178. /* DWORD 11:Destination Port Number */
  8179. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8180. #define HTT_RX_FSE_DESTPORT_S 16
  8181. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8182. do { \
  8183. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8184. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8185. } while (0)
  8186. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8187. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8188. /* DWORD 10-11:SPI (In case of IPSEC) */
  8189. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8190. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8191. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8192. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8193. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8194. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8195. do { \
  8196. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8197. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8198. } while (0)
  8199. /* DWORD 12:L4 PROTO */
  8200. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8201. #define HTT_RX_FSE_L4_PROTO_S 0
  8202. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8203. do { \
  8204. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8205. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8206. } while (0)
  8207. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8208. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8209. /**
  8210. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8211. *
  8212. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8213. *
  8214. * |31 24|23 |15 8|7 2|1|0|
  8215. * |----------------+----------------+----------------+----------------|
  8216. * | reserved | pdev_id | msg_type |
  8217. * |---------------------------------+----------------+----------------|
  8218. * | reserved |E|F|
  8219. * |---------------------------------+----------------+----------------|
  8220. * Where E = Configure the target to provide the 3-tuple hash value in
  8221. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8222. * F = Configure the target to provide the 3-tuple hash value in
  8223. * flow_id_toeplitz field of rx_msdu_start tlv
  8224. *
  8225. * The following field definitions describe the format of the 3 tuple hash value
  8226. * message sent from the host to target as part of initialization sequence.
  8227. *
  8228. * Header fields:
  8229. * dword0 - b'7:0 - msg_type: This will be set to
  8230. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8231. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8232. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8233. * specified pdev's LMAC ring.
  8234. * b'31:16 - reserved : Reserved for future use
  8235. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8236. * b'1 - toeplitz_hash_2_or_4_field_enable
  8237. * b'31:2 - reserved : Reserved for future use
  8238. * ---------+------+----------------------------------------------------------
  8239. * bit1 | bit0 | Functionality
  8240. * ---------+------+----------------------------------------------------------
  8241. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8242. * | | in flow_id_toeplitz field
  8243. * ---------+------+----------------------------------------------------------
  8244. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8245. * | | in toeplitz_hash_2_or_4 field
  8246. * ---------+------+----------------------------------------------------------
  8247. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8248. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8249. * ---------+------+----------------------------------------------------------
  8250. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8251. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8252. * | | toeplitz_hash_2_or_4 field
  8253. *----------------------------------------------------------------------------
  8254. */
  8255. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8256. A_UINT32 msg_type :8,
  8257. pdev_id :8,
  8258. reserved0 :16;
  8259. A_UINT32 flow_id_toeplitz_field_enable :1,
  8260. toeplitz_hash_2_or_4_field_enable :1,
  8261. reserved1 :30;
  8262. } POSTPACK;
  8263. /* DWORD0 : pdev_id configuration Macros */
  8264. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8265. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8266. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8267. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8268. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8269. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8270. do { \
  8271. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8272. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8273. } while (0)
  8274. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8275. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8276. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8277. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8278. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8279. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8280. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8281. do { \
  8282. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8283. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8284. } while (0)
  8285. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8286. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8287. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8288. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8289. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8290. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8291. do { \
  8292. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8293. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8294. } while (0)
  8295. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8296. /**
  8297. * @brief host --> target Host PA Address Size
  8298. *
  8299. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8300. *
  8301. * @details
  8302. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8303. * provide the physical start address and size of each of the memory
  8304. * areas within host DDR that the target FW may need to access.
  8305. *
  8306. * For example, the host can use this message to allow the target FW
  8307. * to set up access to the host's pools of TQM link descriptors.
  8308. * The message would appear as follows:
  8309. *
  8310. * |31 24|23 16|15 8|7 0|
  8311. * |----------------+----------------+----------------+----------------|
  8312. * | reserved | num_entries | msg_type |
  8313. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8314. * | mem area 0 size |
  8315. * |----------------+----------------+----------------+----------------|
  8316. * | mem area 0 physical_address_lo |
  8317. * |----------------+----------------+----------------+----------------|
  8318. * | mem area 0 physical_address_hi |
  8319. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8320. * | mem area 1 size |
  8321. * |----------------+----------------+----------------+----------------|
  8322. * | mem area 1 physical_address_lo |
  8323. * |----------------+----------------+----------------+----------------|
  8324. * | mem area 1 physical_address_hi |
  8325. * |----------------+----------------+----------------+----------------|
  8326. * ...
  8327. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8328. * | mem area N size |
  8329. * |----------------+----------------+----------------+----------------|
  8330. * | mem area N physical_address_lo |
  8331. * |----------------+----------------+----------------+----------------|
  8332. * | mem area N physical_address_hi |
  8333. * |----------------+----------------+----------------+----------------|
  8334. *
  8335. * The message is interpreted as follows:
  8336. * dword0 - b'0:7 - msg_type: This will be set to
  8337. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8338. * b'8:15 - number_entries: Indicated the number of host memory
  8339. * areas specified within the remainder of the message
  8340. * b'16:31 - reserved.
  8341. * dword1 - b'0:31 - memory area 0 size in bytes
  8342. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8343. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8344. * and similar for memory area 1 through memory area N.
  8345. */
  8346. PREPACK struct htt_h2t_host_paddr_size {
  8347. A_UINT32 msg_type: 8,
  8348. num_entries: 8,
  8349. reserved: 16;
  8350. } POSTPACK;
  8351. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8352. A_UINT32 size;
  8353. A_UINT32 physical_address_lo;
  8354. A_UINT32 physical_address_hi;
  8355. } POSTPACK;
  8356. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8357. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8358. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8359. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8360. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8361. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8362. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8363. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8364. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8365. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8366. do { \
  8367. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8368. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8369. } while (0)
  8370. /**
  8371. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8372. *
  8373. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8374. *
  8375. * @details
  8376. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8377. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8378. *
  8379. * The message would appear as follows:
  8380. *
  8381. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8382. * |---------------------------------+---+---+----------+-+-----------|
  8383. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8384. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8385. *
  8386. *
  8387. * The message is interpreted as follows:
  8388. * dword0 - b'0:7 - msg_type: This will be set to
  8389. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8390. * b'8 - override bit to drive MSDUs to PPE ring
  8391. * b'9:13 - REO destination ring indication
  8392. * b'14 - Multi buffer msdu override enable bit
  8393. * b'15 - Intra BSS override
  8394. * b'16 - Decap raw override
  8395. * b'17 - Decap Native wifi override
  8396. * b'18 - IP frag override
  8397. * b'19:31 - reserved
  8398. */
  8399. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8400. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8401. override: 1,
  8402. reo_destination_indication: 5,
  8403. multi_buffer_msdu_override_en: 1,
  8404. intra_bss_override: 1,
  8405. decap_raw_override: 1,
  8406. decap_nwifi_override: 1,
  8407. ip_frag_override: 1,
  8408. reserved: 13;
  8409. } POSTPACK;
  8410. /* DWORD 0: Override */
  8411. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8412. #define HTT_PPE_CFG_OVERRIDE_S 8
  8413. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8414. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8415. HTT_PPE_CFG_OVERRIDE_S)
  8416. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8417. do { \
  8418. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8419. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8420. } while (0)
  8421. /* DWORD 0: REO Destination Indication*/
  8422. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8423. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8424. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8425. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8426. HTT_PPE_CFG_REO_DEST_IND_S)
  8427. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8428. do { \
  8429. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8430. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8431. } while (0)
  8432. /* DWORD 0: Multi buffer MSDU override */
  8433. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8434. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8435. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8436. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8437. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8438. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8439. do { \
  8440. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8441. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8442. } while (0)
  8443. /* DWORD 0: Intra BSS override */
  8444. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8445. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8446. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8447. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8448. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8449. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8450. do { \
  8451. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8452. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8453. } while (0)
  8454. /* DWORD 0: Decap RAW override */
  8455. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8456. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8457. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8458. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8459. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8460. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8461. do { \
  8462. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8463. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8464. } while (0)
  8465. /* DWORD 0: Decap NWIFI override */
  8466. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8467. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8468. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8469. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8470. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8471. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8472. do { \
  8473. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8474. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8475. } while (0)
  8476. /* DWORD 0: IP frag override */
  8477. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8478. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8479. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8480. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8481. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8482. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8483. do { \
  8484. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8485. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8486. } while (0)
  8487. /*
  8488. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8489. *
  8490. * @details
  8491. * The following field definitions describe the format of the HTT host
  8492. * to target FW VDEV TX RX stats retrieve message.
  8493. * The message specifies the type of stats the host wants to retrieve.
  8494. *
  8495. * |31 27|26 25|24 17|16|15 8|7 0|
  8496. * |-----------------------------------------------------------|
  8497. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8498. * |-----------------------------------------------------------|
  8499. * | vdev_id lower bitmask |
  8500. * |-----------------------------------------------------------|
  8501. * | vdev_id upper bitmask |
  8502. * |-----------------------------------------------------------|
  8503. * Header fields:
  8504. * Where:
  8505. * dword0 - b'7:0 - msg_type: This will be set to
  8506. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8507. * b'15:8 - pdev id
  8508. * b'16(E) - Enable/Disable the vdev HW stats
  8509. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8510. * b'25:26(R) - Reset stats bits
  8511. * 0: don't reset stats
  8512. * 1: reset stats once
  8513. * 2: reset stats at the start of each periodic interval
  8514. * b'27:31 - reserved for future use
  8515. * dword1 - b'0:31 - vdev_id lower bitmask
  8516. * dword2 - b'0:31 - vdev_id upper bitmask
  8517. */
  8518. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8519. A_UINT32 msg_type :8,
  8520. pdev_id :8,
  8521. enable :1,
  8522. periodic_interval :8,
  8523. reset_stats_bits :2,
  8524. reserved0 :5;
  8525. A_UINT32 vdev_id_lower_bitmask;
  8526. A_UINT32 vdev_id_upper_bitmask;
  8527. } POSTPACK;
  8528. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8529. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8530. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8531. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8532. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8533. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8534. do { \
  8535. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8536. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8537. } while (0)
  8538. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8539. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8540. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8541. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8542. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8543. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8544. do { \
  8545. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8546. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8547. } while (0)
  8548. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8549. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8550. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8551. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8552. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8553. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8554. do { \
  8555. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8556. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8557. } while (0)
  8558. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8559. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8560. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8561. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8562. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8563. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8564. do { \
  8565. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8566. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8567. } while (0)
  8568. /*
  8569. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8570. *
  8571. * @details
  8572. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8573. * the default MSDU queues for one of the TIDs within the specified peer
  8574. * to the specified service class.
  8575. * The TID is indirectly specified - each service class is associated
  8576. * with a TID. All default MSDU queues for this peer-TID will be
  8577. * linked to the service class in question.
  8578. *
  8579. * |31 16|15 8|7 0|
  8580. * |------------------------------+--------------+--------------|
  8581. * | peer ID | svc class ID | msg type |
  8582. * |------------------------------------------------------------|
  8583. * Header fields:
  8584. * dword0 - b'7:0 - msg_type: This will be set to
  8585. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8586. * b'15:8 - service class ID
  8587. * b'31:16 - peer ID
  8588. */
  8589. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8590. A_UINT32 msg_type :8,
  8591. svc_class_id :8,
  8592. peer_id :16;
  8593. } POSTPACK;
  8594. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8595. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8596. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8597. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8598. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8599. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8600. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8601. do { \
  8602. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8603. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8604. } while (0)
  8605. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8606. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8607. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8608. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8609. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8610. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8611. do { \
  8612. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8613. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8614. } while (0)
  8615. /*
  8616. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8617. *
  8618. * @details
  8619. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8620. * remove the linkage of the specified peer-TID's MSDU queues to
  8621. * service classes.
  8622. *
  8623. * |31 16|15 8|7 0|
  8624. * |------------------------------+--------------+--------------|
  8625. * | peer ID | svc class ID | msg type |
  8626. * |------------------------------------------------------------|
  8627. * Header fields:
  8628. * dword0 - b'7:0 - msg_type: This will be set to
  8629. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8630. * b'15:8 - service class ID
  8631. * b'31:16 - peer ID
  8632. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8633. * value for peer ID indicates that the target should
  8634. * apply the UNMAP_REQ to all peers.
  8635. */
  8636. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8637. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8638. A_UINT32 msg_type :8,
  8639. svc_class_id :8,
  8640. peer_id :16;
  8641. } POSTPACK;
  8642. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8643. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8644. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8645. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8646. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8647. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8648. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8649. do { \
  8650. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8651. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8652. } while (0)
  8653. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8654. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8655. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8656. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8657. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8658. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8659. do { \
  8660. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8661. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8662. } while (0)
  8663. /*
  8664. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8665. *
  8666. * @details
  8667. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8668. * request the target to report what service class the default MSDU queues
  8669. * of the specified TIDs within the peer are linked to.
  8670. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8671. * to report what service class (if any) the default MSDU queues for
  8672. * each of the specified TIDs are linked to.
  8673. *
  8674. * |31 16|15 8|7 1| 0|
  8675. * |------------------------------+--------------+--------------|
  8676. * | peer ID | TID mask | msg type |
  8677. * |------------------------------------------------------------|
  8678. * | reserved |ETO|
  8679. * |------------------------------------------------------------|
  8680. * Header fields:
  8681. * dword0 - b'7:0 - msg_type: This will be set to
  8682. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8683. * b'15:8 - TID mask
  8684. * b'31:16 - peer ID
  8685. * dword1 - b'0 - "Existing Tids Only" flag
  8686. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8687. * message generated by this REQ will only show the
  8688. * mapping for TIDs that actually exist in the target's
  8689. * peer object.
  8690. * Any TIDs that are covered by a MAP_REQ but which
  8691. * do not actually exist will be shown as being
  8692. * unmapped (i.e. svc class ID 0xff).
  8693. * If this flag is cleared, the MAP_REPORT_CONF message
  8694. * will consider not only the mapping of TIDs currently
  8695. * existing in the peer, but also the mapping that will
  8696. * be applied for any TID objects created within this
  8697. * peer in the future.
  8698. * b'31:1 - reserved for future use
  8699. */
  8700. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8701. A_UINT32 msg_type :8,
  8702. tid_mask :8,
  8703. peer_id :16;
  8704. A_UINT32 existing_tids_only:1,
  8705. reserved :31;
  8706. } POSTPACK;
  8707. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8708. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8709. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8710. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8711. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8712. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8713. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8714. do { \
  8715. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8716. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8717. } while (0)
  8718. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8719. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8720. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8721. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8722. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8723. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8724. do { \
  8725. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8726. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8727. } while (0)
  8728. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8729. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8730. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8731. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8732. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8733. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8734. do { \
  8735. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8736. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8737. } while (0)
  8738. /**
  8739. * @brief Format of shared memory between Host and Target
  8740. * for UMAC hang recovery feature messaging.
  8741. * @details
  8742. * This is shared memory between Host and Target allocated
  8743. * and used in chips where UMAC hang recovery feature is supported.
  8744. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8745. * then host interprets it as a new message from target.
  8746. * Host clears that particular read bit in t2h_msg after each read
  8747. * operation. It is vice versa for h2t_msg. At any given point
  8748. * of time there is expected to be only one bit set
  8749. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8750. *
  8751. * The message is interpreted as follows:
  8752. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8753. * added for debuggability purpose.
  8754. * dword1 - b'0 - do_pre_reset
  8755. * b'1 - do_post_reset_start
  8756. * b'2 - do_post_reset_complete
  8757. * b'3:31 - rsvd_t2h
  8758. * dword2 - b'0 - pre_reset_done
  8759. * b'1 - post_reset_start_done
  8760. * b'2 - post_reset_complete_done
  8761. * b'3:31 - rsvd_h2t
  8762. */
  8763. PREPACK typedef struct {
  8764. /** Magic number added for debuggability. */
  8765. A_UINT32 magic_num;
  8766. union {
  8767. /*
  8768. * BIT [0] :- T2H msg to do pre-reset
  8769. * BIT [1] :- T2H msg to do post-reset start
  8770. * BIT [2] :- T2H msg to do post-reset complete
  8771. * BIT [31 : 3] :- reserved
  8772. */
  8773. A_UINT32 t2h_msg;
  8774. struct {
  8775. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8776. do_post_reset_start : 1, /* BIT [1] */
  8777. do_post_reset_complete : 1, /* BIT [2] */
  8778. rsvd_t2h : 29; /* BIT [31 : 3] */
  8779. };
  8780. };
  8781. union {
  8782. /*
  8783. * BIT [0] :- H2T msg to send pre-reset done
  8784. * BIT [1] :- H2T msg to send post-reset start done
  8785. * BIT [2] :- H2T msg to send post-reset complete done
  8786. * BIT [31 : 3] :- reserved
  8787. */
  8788. A_UINT32 h2t_msg;
  8789. struct {
  8790. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8791. post_reset_start_done : 1, /* BIT [1] */
  8792. post_reset_complete_done : 1, /* BIT [2] */
  8793. rsvd_h2t : 29; /* BIT [31 : 3] */
  8794. };
  8795. };
  8796. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8797. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8798. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8799. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8800. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8801. /* dword1 - b'0 - do_pre_reset */
  8802. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8803. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8804. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8805. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8806. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8807. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8808. do { \
  8809. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8810. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8811. } while (0)
  8812. /* dword1 - b'1 - do_post_reset_start */
  8813. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8814. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8815. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8816. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8817. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8818. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8819. do { \
  8820. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8821. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8822. } while (0)
  8823. /* dword1 - b'2 - do_post_reset_complete */
  8824. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8825. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8826. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8827. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8828. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8829. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8830. do { \
  8831. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8832. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8833. } while (0)
  8834. /* dword2 - b'0 - pre_reset_done */
  8835. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8836. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8837. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8838. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8839. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8840. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8841. do { \
  8842. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8843. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8844. } while (0)
  8845. /* dword2 - b'1 - post_reset_start_done */
  8846. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8847. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8848. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8849. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8850. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8851. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8852. do { \
  8853. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8854. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8855. } while (0)
  8856. /* dword2 - b'2 - post_reset_complete_done */
  8857. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8858. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8859. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8860. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8861. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8862. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8863. do { \
  8864. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8865. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8866. } while (0)
  8867. /**
  8868. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8869. *
  8870. * @details
  8871. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8872. * by the host to provide prerequisite info to target for the UMAC hang
  8873. * recovery feature.
  8874. * The info sent in this H2T message are T2H message method, H2T message
  8875. * method, T2H MSI interrupt number and physical start address, size of
  8876. * the shared memory (refers to the shared memory dedicated for messaging
  8877. * between host and target when the DUT is in UMAC hang recovery mode).
  8878. * This H2T message is expected to be only sent if the WMI service bit
  8879. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8880. *
  8881. * |31 16|15 12|11 8|7 0|
  8882. * |-------------------------------+--------------+--------------+------------|
  8883. * | reserved |h2t msg method|t2h msg method| msg_type |
  8884. * |--------------------------------------------------------------------------|
  8885. * | t2h msi interrupt number |
  8886. * |--------------------------------------------------------------------------|
  8887. * | shared memory area size |
  8888. * |--------------------------------------------------------------------------|
  8889. * | shared memory area physical address low |
  8890. * |--------------------------------------------------------------------------|
  8891. * | shared memory area physical address high |
  8892. * |--------------------------------------------------------------------------|
  8893. *
  8894. * The message is interpreted as follows:
  8895. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8896. * b'8:11 - t2h_msg_method: indicates method to be used for
  8897. * T2H communication in UMAC hang recovery mode.
  8898. * Value zero indicates MSI interrupt (default method).
  8899. * Refer to htt_umac_hang_recovery_msg_method enum.
  8900. * b'12:15 - h2t_msg_method: indicates method to be used for
  8901. * H2T communication in UMAC hang recovery mode.
  8902. * Value zero indicates polling by target for this h2t msg
  8903. * during UMAC hang recovery mode.
  8904. * Refer to htt_umac_hang_recovery_msg_method enum.
  8905. * b'16:31 - reserved.
  8906. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8907. * T2H communication in UMAC hang recovery mode.
  8908. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8909. * only when in UMAC hang recovery mode.
  8910. * This refers to size in bytes.
  8911. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8912. * of the shared memory dedicated for messaging only when
  8913. * in UMAC hang recovery mode.
  8914. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8915. * of the shared memory dedicated for messaging only when
  8916. * in UMAC hang recovery mode.
  8917. */
  8918. /* t2h_msg_method and h2t_msg_method */
  8919. enum htt_umac_hang_recovery_msg_method {
  8920. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8921. };
  8922. PREPACK typedef struct {
  8923. A_UINT32 msg_type : 8,
  8924. t2h_msg_method : 4,
  8925. h2t_msg_method : 4,
  8926. reserved : 16;
  8927. A_UINT32 t2h_msi_data;
  8928. /* size bytes and physical address of shared memory. */
  8929. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8930. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8931. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8932. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8933. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8934. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8935. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8936. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8937. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8938. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8939. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8940. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8941. do { \
  8942. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8943. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8944. } while (0)
  8945. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8946. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8947. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8948. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8949. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8950. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8953. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8954. } while (0)
  8955. /*=== target -> host messages ===============================================*/
  8956. enum htt_t2h_msg_type {
  8957. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8958. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8959. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8960. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8961. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8962. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8963. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8964. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8965. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8966. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8967. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8968. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8969. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8970. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8971. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8972. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8973. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8974. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8975. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8976. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8977. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8978. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8979. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8980. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8981. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8982. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8983. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8984. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8985. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8986. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8987. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8988. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8989. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8990. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8991. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8992. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8993. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8994. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8995. /* TX_OFFLOAD_DELIVER_IND:
  8996. * Forward the target's locally-generated packets to the host,
  8997. * to provide to the monitor mode interface.
  8998. */
  8999. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  9000. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  9001. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  9002. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9003. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9004. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9005. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9006. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9007. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9008. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9009. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9010. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9011. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9012. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9013. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9014. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9015. HTT_T2H_MSG_TYPE_TEST,
  9016. /* keep this last */
  9017. HTT_T2H_NUM_MSGS
  9018. };
  9019. /*
  9020. * HTT target to host message type -
  9021. * stored in bits 7:0 of the first word of the message
  9022. */
  9023. #define HTT_T2H_MSG_TYPE_M 0xff
  9024. #define HTT_T2H_MSG_TYPE_S 0
  9025. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9026. do { \
  9027. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9028. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9029. } while (0)
  9030. #define HTT_T2H_MSG_TYPE_GET(word) \
  9031. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9032. /**
  9033. * @brief target -> host version number confirmation message definition
  9034. *
  9035. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9036. *
  9037. * |31 24|23 16|15 8|7 0|
  9038. * |----------------+----------------+----------------+----------------|
  9039. * | reserved | major number | minor number | msg type |
  9040. * |-------------------------------------------------------------------|
  9041. * : option request TLV (optional) |
  9042. * :...................................................................:
  9043. *
  9044. * The VER_CONF message may consist of a single 4-byte word, or may be
  9045. * extended with TLVs that specify HTT options selected by the target.
  9046. * The following option TLVs may be appended to the VER_CONF message:
  9047. * - LL_BUS_ADDR_SIZE
  9048. * - HL_SUPPRESS_TX_COMPL_IND
  9049. * - MAX_TX_QUEUE_GROUPS
  9050. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9051. * may be appended to the VER_CONF message (but only one TLV of each type).
  9052. *
  9053. * Header fields:
  9054. * - MSG_TYPE
  9055. * Bits 7:0
  9056. * Purpose: identifies this as a version number confirmation message
  9057. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9058. * - VER_MINOR
  9059. * Bits 15:8
  9060. * Purpose: Specify the minor number of the HTT message library version
  9061. * in use by the target firmware.
  9062. * The minor number specifies the specific revision within a range
  9063. * of fundamentally compatible HTT message definition revisions.
  9064. * Compatible revisions involve adding new messages or perhaps
  9065. * adding new fields to existing messages, in a backwards-compatible
  9066. * manner.
  9067. * Incompatible revisions involve changing the message type values,
  9068. * or redefining existing messages.
  9069. * Value: minor number
  9070. * - VER_MAJOR
  9071. * Bits 15:8
  9072. * Purpose: Specify the major number of the HTT message library version
  9073. * in use by the target firmware.
  9074. * The major number specifies the family of minor revisions that are
  9075. * fundamentally compatible with each other, but not with prior or
  9076. * later families.
  9077. * Value: major number
  9078. */
  9079. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9080. #define HTT_VER_CONF_MINOR_S 8
  9081. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9082. #define HTT_VER_CONF_MAJOR_S 16
  9083. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9084. do { \
  9085. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9086. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9087. } while (0)
  9088. #define HTT_VER_CONF_MINOR_GET(word) \
  9089. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9090. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9091. do { \
  9092. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9093. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9094. } while (0)
  9095. #define HTT_VER_CONF_MAJOR_GET(word) \
  9096. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9097. #define HTT_VER_CONF_BYTES 4
  9098. /**
  9099. * @brief - target -> host HTT Rx In order indication message
  9100. *
  9101. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9102. *
  9103. * @details
  9104. *
  9105. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9106. * |----------------+-------------------+---------------------+---------------|
  9107. * | peer ID | P| F| O| ext TID | msg type |
  9108. * |--------------------------------------------------------------------------|
  9109. * | MSDU count | Reserved | vdev id |
  9110. * |--------------------------------------------------------------------------|
  9111. * | MSDU 0 bus address (bits 31:0) |
  9112. #if HTT_PADDR64
  9113. * | MSDU 0 bus address (bits 63:32) |
  9114. #endif
  9115. * |--------------------------------------------------------------------------|
  9116. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9117. * |--------------------------------------------------------------------------|
  9118. * | MSDU 1 bus address (bits 31:0) |
  9119. #if HTT_PADDR64
  9120. * | MSDU 1 bus address (bits 63:32) |
  9121. #endif
  9122. * |--------------------------------------------------------------------------|
  9123. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9124. * |--------------------------------------------------------------------------|
  9125. */
  9126. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9127. *
  9128. * @details
  9129. * bits
  9130. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9131. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9132. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9133. * | | frag | | | | fail |chksum fail|
  9134. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9135. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9136. */
  9137. struct htt_rx_in_ord_paddr_ind_hdr_t
  9138. {
  9139. A_UINT32 /* word 0 */
  9140. msg_type: 8,
  9141. ext_tid: 5,
  9142. offload: 1,
  9143. frag: 1,
  9144. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9145. peer_id: 16;
  9146. A_UINT32 /* word 1 */
  9147. vap_id: 8,
  9148. /* NOTE:
  9149. * This reserved_1 field is not truly reserved - certain targets use
  9150. * this field internally to store debug information, and do not zero
  9151. * out the contents of the field before uploading the message to the
  9152. * host. Thus, any host-target communication supported by this field
  9153. * is limited to using values that are never used by the debug
  9154. * information stored by certain targets in the reserved_1 field.
  9155. * In particular, the targets in question don't use the value 0x3
  9156. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9157. * so this previously-unused value within these bits is available to
  9158. * use as the host / target PKT_CAPTURE_MODE flag.
  9159. */
  9160. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9161. /* if pkt_capture_mode == 0x3, host should
  9162. * send rx frames to monitor mode interface
  9163. */
  9164. msdu_cnt: 16;
  9165. };
  9166. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9167. {
  9168. A_UINT32 dma_addr;
  9169. A_UINT32
  9170. length: 16,
  9171. fw_desc: 8,
  9172. msdu_info:8;
  9173. };
  9174. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9175. {
  9176. A_UINT32 dma_addr_lo;
  9177. A_UINT32 dma_addr_hi;
  9178. A_UINT32
  9179. length: 16,
  9180. fw_desc: 8,
  9181. msdu_info:8;
  9182. };
  9183. #if HTT_PADDR64
  9184. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9185. #else
  9186. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9187. #endif
  9188. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9189. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9190. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9191. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9192. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9193. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9195. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9196. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9197. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9198. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9199. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9200. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9201. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9202. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9203. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9204. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9205. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9206. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9207. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9208. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9209. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9210. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9211. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9212. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9213. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9214. /* for systems using 64-bit format for bus addresses */
  9215. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9216. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9217. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9218. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9219. /* for systems using 32-bit format for bus addresses */
  9220. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9221. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9222. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9223. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9224. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9225. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9226. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9227. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9228. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9231. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9232. } while (0)
  9233. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9234. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9235. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9236. do { \
  9237. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9238. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9239. } while (0)
  9240. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9241. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9242. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9243. do { \
  9244. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9245. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9246. } while (0)
  9247. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9248. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9249. /*
  9250. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9251. * deliver the rx frames to the monitor mode interface.
  9252. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9253. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9254. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9255. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9256. */
  9257. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9258. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9259. do { \
  9260. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9261. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9262. } while (0)
  9263. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9264. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9265. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9266. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9267. do { \
  9268. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9269. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9270. } while (0)
  9271. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9272. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9273. /* for systems using 64-bit format for bus addresses */
  9274. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9275. do { \
  9276. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9277. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9278. } while (0)
  9279. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9280. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9281. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9282. do { \
  9283. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9284. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9285. } while (0)
  9286. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9287. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9288. /* for systems using 32-bit format for bus addresses */
  9289. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9290. do { \
  9291. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9292. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9293. } while (0)
  9294. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9295. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9296. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9297. do { \
  9298. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9299. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9300. } while (0)
  9301. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9302. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9303. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9304. do { \
  9305. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9306. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9307. } while (0)
  9308. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9309. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9310. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9311. do { \
  9312. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9313. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9314. } while (0)
  9315. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9316. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9317. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9318. do { \
  9319. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9320. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9321. } while (0)
  9322. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9323. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9324. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9325. do { \
  9326. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9327. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9328. } while (0)
  9329. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9330. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9331. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9332. do { \
  9333. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9334. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9335. } while (0)
  9336. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9337. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9338. /* definitions used within target -> host rx indication message */
  9339. PREPACK struct htt_rx_ind_hdr_prefix_t
  9340. {
  9341. A_UINT32 /* word 0 */
  9342. msg_type: 8,
  9343. ext_tid: 5,
  9344. release_valid: 1,
  9345. flush_valid: 1,
  9346. reserved0: 1,
  9347. peer_id: 16;
  9348. A_UINT32 /* word 1 */
  9349. flush_start_seq_num: 6,
  9350. flush_end_seq_num: 6,
  9351. release_start_seq_num: 6,
  9352. release_end_seq_num: 6,
  9353. num_mpdu_ranges: 8;
  9354. } POSTPACK;
  9355. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9356. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9357. #define HTT_TGT_RSSI_INVALID 0x80
  9358. PREPACK struct htt_rx_ppdu_desc_t
  9359. {
  9360. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9361. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9362. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9363. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9364. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9365. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9366. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9367. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9368. A_UINT32 /* word 0 */
  9369. rssi_cmb: 8,
  9370. timestamp_submicrosec: 8,
  9371. phy_err_code: 8,
  9372. phy_err: 1,
  9373. legacy_rate: 4,
  9374. legacy_rate_sel: 1,
  9375. end_valid: 1,
  9376. start_valid: 1;
  9377. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9378. union {
  9379. A_UINT32 /* word 1 */
  9380. rssi0_pri20: 8,
  9381. rssi0_ext20: 8,
  9382. rssi0_ext40: 8,
  9383. rssi0_ext80: 8;
  9384. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9385. } u0;
  9386. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9387. union {
  9388. A_UINT32 /* word 2 */
  9389. rssi1_pri20: 8,
  9390. rssi1_ext20: 8,
  9391. rssi1_ext40: 8,
  9392. rssi1_ext80: 8;
  9393. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9394. } u1;
  9395. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9396. union {
  9397. A_UINT32 /* word 3 */
  9398. rssi2_pri20: 8,
  9399. rssi2_ext20: 8,
  9400. rssi2_ext40: 8,
  9401. rssi2_ext80: 8;
  9402. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9403. } u2;
  9404. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9405. union {
  9406. A_UINT32 /* word 4 */
  9407. rssi3_pri20: 8,
  9408. rssi3_ext20: 8,
  9409. rssi3_ext40: 8,
  9410. rssi3_ext80: 8;
  9411. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9412. } u3;
  9413. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9414. A_UINT32 tsf32; /* word 5 */
  9415. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9416. A_UINT32 timestamp_microsec; /* word 6 */
  9417. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9418. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9419. A_UINT32 /* word 7 */
  9420. vht_sig_a1: 24,
  9421. preamble_type: 8;
  9422. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9423. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9424. A_UINT32 /* word 8 */
  9425. vht_sig_a2: 24,
  9426. /* sa_ant_matrix
  9427. * For cases where a single rx chain has options to be connected to
  9428. * different rx antennas, show which rx antennas were in use during
  9429. * receipt of a given PPDU.
  9430. * This sa_ant_matrix provides a bitmask of the antennas used while
  9431. * receiving this frame.
  9432. */
  9433. sa_ant_matrix: 8;
  9434. } POSTPACK;
  9435. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9436. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9437. PREPACK struct htt_rx_ind_hdr_suffix_t
  9438. {
  9439. A_UINT32 /* word 0 */
  9440. fw_rx_desc_bytes: 16,
  9441. reserved0: 16;
  9442. } POSTPACK;
  9443. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9444. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9445. PREPACK struct htt_rx_ind_hdr_t
  9446. {
  9447. struct htt_rx_ind_hdr_prefix_t prefix;
  9448. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9449. struct htt_rx_ind_hdr_suffix_t suffix;
  9450. } POSTPACK;
  9451. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9452. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9453. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9454. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9455. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9456. /*
  9457. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9458. * the offset into the HTT rx indication message at which the
  9459. * FW rx PPDU descriptor resides
  9460. */
  9461. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9462. /*
  9463. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9464. * the offset into the HTT rx indication message at which the
  9465. * header suffix (FW rx MSDU byte count) resides
  9466. */
  9467. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9468. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9469. /*
  9470. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9471. * the offset into the HTT rx indication message at which the per-MSDU
  9472. * information starts
  9473. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9474. * per-MSDU information portion of the message. The per-MSDU info itself
  9475. * starts at byte 12.
  9476. */
  9477. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9478. /**
  9479. * @brief target -> host rx indication message definition
  9480. *
  9481. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9482. *
  9483. * @details
  9484. * The following field definitions describe the format of the rx indication
  9485. * message sent from the target to the host.
  9486. * The message consists of three major sections:
  9487. * 1. a fixed-length header
  9488. * 2. a variable-length list of firmware rx MSDU descriptors
  9489. * 3. one or more 4-octet MPDU range information elements
  9490. * The fixed length header itself has two sub-sections
  9491. * 1. the message meta-information, including identification of the
  9492. * sender and type of the received data, and a 4-octet flush/release IE
  9493. * 2. the firmware rx PPDU descriptor
  9494. *
  9495. * The format of the message is depicted below.
  9496. * in this depiction, the following abbreviations are used for information
  9497. * elements within the message:
  9498. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9499. * elements associated with the PPDU start are valid.
  9500. * Specifically, the following fields are valid only if SV is set:
  9501. * RSSI (all variants), L, legacy rate, preamble type, service,
  9502. * VHT-SIG-A
  9503. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9504. * elements associated with the PPDU end are valid.
  9505. * Specifically, the following fields are valid only if EV is set:
  9506. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9507. * - L - Legacy rate selector - if legacy rates are used, this flag
  9508. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9509. * (L == 0) PHY.
  9510. * - P - PHY error flag - boolean indication of whether the rx frame had
  9511. * a PHY error
  9512. *
  9513. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9514. * |----------------+-------------------+---------------------+---------------|
  9515. * | peer ID | |RV|FV| ext TID | msg type |
  9516. * |--------------------------------------------------------------------------|
  9517. * | num | release | release | flush | flush |
  9518. * | MPDU | end | start | end | start |
  9519. * | ranges | seq num | seq num | seq num | seq num |
  9520. * |==========================================================================|
  9521. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9522. * |V|V| | rate | | | timestamp | RSSI |
  9523. * |--------------------------------------------------------------------------|
  9524. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9525. * |--------------------------------------------------------------------------|
  9526. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9527. * |--------------------------------------------------------------------------|
  9528. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9529. * |--------------------------------------------------------------------------|
  9530. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9531. * |--------------------------------------------------------------------------|
  9532. * | TSF LSBs |
  9533. * |--------------------------------------------------------------------------|
  9534. * | microsec timestamp |
  9535. * |--------------------------------------------------------------------------|
  9536. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9537. * |--------------------------------------------------------------------------|
  9538. * | service | HT-SIG / VHT-SIG-A2 |
  9539. * |==========================================================================|
  9540. * | reserved | FW rx desc bytes |
  9541. * |--------------------------------------------------------------------------|
  9542. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9543. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9544. * |--------------------------------------------------------------------------|
  9545. * : : :
  9546. * |--------------------------------------------------------------------------|
  9547. * | alignment | MSDU Rx |
  9548. * | padding | desc Bn |
  9549. * |--------------------------------------------------------------------------|
  9550. * | reserved | MPDU range status | MPDU count |
  9551. * |--------------------------------------------------------------------------|
  9552. * : reserved : MPDU range status : MPDU count :
  9553. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9554. *
  9555. * Header fields:
  9556. * - MSG_TYPE
  9557. * Bits 7:0
  9558. * Purpose: identifies this as an rx indication message
  9559. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9560. * - EXT_TID
  9561. * Bits 12:8
  9562. * Purpose: identify the traffic ID of the rx data, including
  9563. * special "extended" TID values for multicast, broadcast, and
  9564. * non-QoS data frames
  9565. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9566. * - FLUSH_VALID (FV)
  9567. * Bit 13
  9568. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9569. * is valid
  9570. * Value:
  9571. * 1 -> flush IE is valid and needs to be processed
  9572. * 0 -> flush IE is not valid and should be ignored
  9573. * - REL_VALID (RV)
  9574. * Bit 13
  9575. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9576. * is valid
  9577. * Value:
  9578. * 1 -> release IE is valid and needs to be processed
  9579. * 0 -> release IE is not valid and should be ignored
  9580. * - PEER_ID
  9581. * Bits 31:16
  9582. * Purpose: Identify, by ID, which peer sent the rx data
  9583. * Value: ID of the peer who sent the rx data
  9584. * - FLUSH_SEQ_NUM_START
  9585. * Bits 5:0
  9586. * Purpose: Indicate the start of a series of MPDUs to flush
  9587. * Not all MPDUs within this series are necessarily valid - the host
  9588. * must check each sequence number within this range to see if the
  9589. * corresponding MPDU is actually present.
  9590. * This field is only valid if the FV bit is set.
  9591. * Value:
  9592. * The sequence number for the first MPDUs to check to flush.
  9593. * The sequence number is masked by 0x3f.
  9594. * - FLUSH_SEQ_NUM_END
  9595. * Bits 11:6
  9596. * Purpose: Indicate the end of a series of MPDUs to flush
  9597. * Value:
  9598. * The sequence number one larger than the sequence number of the
  9599. * last MPDU to check to flush.
  9600. * The sequence number is masked by 0x3f.
  9601. * Not all MPDUs within this series are necessarily valid - the host
  9602. * must check each sequence number within this range to see if the
  9603. * corresponding MPDU is actually present.
  9604. * This field is only valid if the FV bit is set.
  9605. * - REL_SEQ_NUM_START
  9606. * Bits 17:12
  9607. * Purpose: Indicate the start of a series of MPDUs to release.
  9608. * All MPDUs within this series are present and valid - the host
  9609. * need not check each sequence number within this range to see if
  9610. * the corresponding MPDU is actually present.
  9611. * This field is only valid if the RV bit is set.
  9612. * Value:
  9613. * The sequence number for the first MPDUs to check to release.
  9614. * The sequence number is masked by 0x3f.
  9615. * - REL_SEQ_NUM_END
  9616. * Bits 23:18
  9617. * Purpose: Indicate the end of a series of MPDUs to release.
  9618. * Value:
  9619. * The sequence number one larger than the sequence number of the
  9620. * last MPDU to check to release.
  9621. * The sequence number is masked by 0x3f.
  9622. * All MPDUs within this series are present and valid - the host
  9623. * need not check each sequence number within this range to see if
  9624. * the corresponding MPDU is actually present.
  9625. * This field is only valid if the RV bit is set.
  9626. * - NUM_MPDU_RANGES
  9627. * Bits 31:24
  9628. * Purpose: Indicate how many ranges of MPDUs are present.
  9629. * Each MPDU range consists of a series of contiguous MPDUs within the
  9630. * rx frame sequence which all have the same MPDU status.
  9631. * Value: 1-63 (typically a small number, like 1-3)
  9632. *
  9633. * Rx PPDU descriptor fields:
  9634. * - RSSI_CMB
  9635. * Bits 7:0
  9636. * Purpose: Combined RSSI from all active rx chains, across the active
  9637. * bandwidth.
  9638. * Value: RSSI dB units w.r.t. noise floor
  9639. * - TIMESTAMP_SUBMICROSEC
  9640. * Bits 15:8
  9641. * Purpose: high-resolution timestamp
  9642. * Value:
  9643. * Sub-microsecond time of PPDU reception.
  9644. * This timestamp ranges from [0,MAC clock MHz).
  9645. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9646. * to form a high-resolution, large range rx timestamp.
  9647. * - PHY_ERR_CODE
  9648. * Bits 23:16
  9649. * Purpose:
  9650. * If the rx frame processing resulted in a PHY error, indicate what
  9651. * type of rx PHY error occurred.
  9652. * Value:
  9653. * This field is valid if the "P" (PHY_ERR) flag is set.
  9654. * TBD: document/specify the values for this field
  9655. * - PHY_ERR
  9656. * Bit 24
  9657. * Purpose: indicate whether the rx PPDU had a PHY error
  9658. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9659. * - LEGACY_RATE
  9660. * Bits 28:25
  9661. * Purpose:
  9662. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9663. * specify which rate was used.
  9664. * Value:
  9665. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9666. * flag.
  9667. * If LEGACY_RATE_SEL is 0:
  9668. * 0x8: OFDM 48 Mbps
  9669. * 0x9: OFDM 24 Mbps
  9670. * 0xA: OFDM 12 Mbps
  9671. * 0xB: OFDM 6 Mbps
  9672. * 0xC: OFDM 54 Mbps
  9673. * 0xD: OFDM 36 Mbps
  9674. * 0xE: OFDM 18 Mbps
  9675. * 0xF: OFDM 9 Mbps
  9676. * If LEGACY_RATE_SEL is 1:
  9677. * 0x8: CCK 11 Mbps long preamble
  9678. * 0x9: CCK 5.5 Mbps long preamble
  9679. * 0xA: CCK 2 Mbps long preamble
  9680. * 0xB: CCK 1 Mbps long preamble
  9681. * 0xC: CCK 11 Mbps short preamble
  9682. * 0xD: CCK 5.5 Mbps short preamble
  9683. * 0xE: CCK 2 Mbps short preamble
  9684. * - LEGACY_RATE_SEL
  9685. * Bit 29
  9686. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9687. * Value:
  9688. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9689. * used a legacy rate.
  9690. * 0 -> OFDM, 1 -> CCK
  9691. * - END_VALID
  9692. * Bit 30
  9693. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9694. * the start of the PPDU are valid. Specifically, the following
  9695. * fields are only valid if END_VALID is set:
  9696. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9697. * TIMESTAMP_SUBMICROSEC
  9698. * Value:
  9699. * 0 -> rx PPDU desc end fields are not valid
  9700. * 1 -> rx PPDU desc end fields are valid
  9701. * - START_VALID
  9702. * Bit 31
  9703. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9704. * the end of the PPDU are valid. Specifically, the following
  9705. * fields are only valid if START_VALID is set:
  9706. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9707. * VHT-SIG-A
  9708. * Value:
  9709. * 0 -> rx PPDU desc start fields are not valid
  9710. * 1 -> rx PPDU desc start fields are valid
  9711. * - RSSI0_PRI20
  9712. * Bits 7:0
  9713. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9714. * Value: RSSI dB units w.r.t. noise floor
  9715. *
  9716. * - RSSI0_EXT20
  9717. * Bits 7:0
  9718. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9719. * (if the rx bandwidth was >= 40 MHz)
  9720. * Value: RSSI dB units w.r.t. noise floor
  9721. * - RSSI0_EXT40
  9722. * Bits 7:0
  9723. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9724. * (if the rx bandwidth was >= 80 MHz)
  9725. * Value: RSSI dB units w.r.t. noise floor
  9726. * - RSSI0_EXT80
  9727. * Bits 7:0
  9728. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9729. * (if the rx bandwidth was >= 160 MHz)
  9730. * Value: RSSI dB units w.r.t. noise floor
  9731. *
  9732. * - RSSI1_PRI20
  9733. * Bits 7:0
  9734. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9735. * Value: RSSI dB units w.r.t. noise floor
  9736. * - RSSI1_EXT20
  9737. * Bits 7:0
  9738. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9739. * (if the rx bandwidth was >= 40 MHz)
  9740. * Value: RSSI dB units w.r.t. noise floor
  9741. * - RSSI1_EXT40
  9742. * Bits 7:0
  9743. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9744. * (if the rx bandwidth was >= 80 MHz)
  9745. * Value: RSSI dB units w.r.t. noise floor
  9746. * - RSSI1_EXT80
  9747. * Bits 7:0
  9748. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9749. * (if the rx bandwidth was >= 160 MHz)
  9750. * Value: RSSI dB units w.r.t. noise floor
  9751. *
  9752. * - RSSI2_PRI20
  9753. * Bits 7:0
  9754. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9755. * Value: RSSI dB units w.r.t. noise floor
  9756. * - RSSI2_EXT20
  9757. * Bits 7:0
  9758. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9759. * (if the rx bandwidth was >= 40 MHz)
  9760. * Value: RSSI dB units w.r.t. noise floor
  9761. * - RSSI2_EXT40
  9762. * Bits 7:0
  9763. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9764. * (if the rx bandwidth was >= 80 MHz)
  9765. * Value: RSSI dB units w.r.t. noise floor
  9766. * - RSSI2_EXT80
  9767. * Bits 7:0
  9768. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9769. * (if the rx bandwidth was >= 160 MHz)
  9770. * Value: RSSI dB units w.r.t. noise floor
  9771. *
  9772. * - RSSI3_PRI20
  9773. * Bits 7:0
  9774. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9775. * Value: RSSI dB units w.r.t. noise floor
  9776. * - RSSI3_EXT20
  9777. * Bits 7:0
  9778. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9779. * (if the rx bandwidth was >= 40 MHz)
  9780. * Value: RSSI dB units w.r.t. noise floor
  9781. * - RSSI3_EXT40
  9782. * Bits 7:0
  9783. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9784. * (if the rx bandwidth was >= 80 MHz)
  9785. * Value: RSSI dB units w.r.t. noise floor
  9786. * - RSSI3_EXT80
  9787. * Bits 7:0
  9788. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9789. * (if the rx bandwidth was >= 160 MHz)
  9790. * Value: RSSI dB units w.r.t. noise floor
  9791. *
  9792. * - TSF32
  9793. * Bits 31:0
  9794. * Purpose: specify the time the rx PPDU was received, in TSF units
  9795. * Value: 32 LSBs of the TSF
  9796. * - TIMESTAMP_MICROSEC
  9797. * Bits 31:0
  9798. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9799. * Value: PPDU rx time, in microseconds
  9800. * - VHT_SIG_A1
  9801. * Bits 23:0
  9802. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9803. * from the rx PPDU
  9804. * Value:
  9805. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9806. * VHT-SIG-A1 data.
  9807. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9808. * first 24 bits of the HT-SIG data.
  9809. * Otherwise, this field is invalid.
  9810. * Refer to the the 802.11 protocol for the definition of the
  9811. * HT-SIG and VHT-SIG-A1 fields
  9812. * - VHT_SIG_A2
  9813. * Bits 23:0
  9814. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9815. * from the rx PPDU
  9816. * Value:
  9817. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9818. * VHT-SIG-A2 data.
  9819. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9820. * last 24 bits of the HT-SIG data.
  9821. * Otherwise, this field is invalid.
  9822. * Refer to the the 802.11 protocol for the definition of the
  9823. * HT-SIG and VHT-SIG-A2 fields
  9824. * - PREAMBLE_TYPE
  9825. * Bits 31:24
  9826. * Purpose: indicate the PHY format of the received burst
  9827. * Value:
  9828. * 0x4: Legacy (OFDM/CCK)
  9829. * 0x8: HT
  9830. * 0x9: HT with TxBF
  9831. * 0xC: VHT
  9832. * 0xD: VHT with TxBF
  9833. * - SERVICE
  9834. * Bits 31:24
  9835. * Purpose: TBD
  9836. * Value: TBD
  9837. *
  9838. * Rx MSDU descriptor fields:
  9839. * - FW_RX_DESC_BYTES
  9840. * Bits 15:0
  9841. * Purpose: Indicate how many bytes in the Rx indication are used for
  9842. * FW Rx descriptors
  9843. *
  9844. * Payload fields:
  9845. * - MPDU_COUNT
  9846. * Bits 7:0
  9847. * Purpose: Indicate how many sequential MPDUs share the same status.
  9848. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9849. * - MPDU_STATUS
  9850. * Bits 15:8
  9851. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9852. * received successfully.
  9853. * Value:
  9854. * 0x1: success
  9855. * 0x2: FCS error
  9856. * 0x3: duplicate error
  9857. * 0x4: replay error
  9858. * 0x5: invalid peer
  9859. */
  9860. /* header fields */
  9861. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9862. #define HTT_RX_IND_EXT_TID_S 8
  9863. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9864. #define HTT_RX_IND_FLUSH_VALID_S 13
  9865. #define HTT_RX_IND_REL_VALID_M 0x4000
  9866. #define HTT_RX_IND_REL_VALID_S 14
  9867. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9868. #define HTT_RX_IND_PEER_ID_S 16
  9869. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9870. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9871. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9872. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9873. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9874. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9875. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9876. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9877. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9878. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9879. /* rx PPDU descriptor fields */
  9880. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9881. #define HTT_RX_IND_RSSI_CMB_S 0
  9882. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9883. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9884. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9885. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9886. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9887. #define HTT_RX_IND_PHY_ERR_S 24
  9888. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9889. #define HTT_RX_IND_LEGACY_RATE_S 25
  9890. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9891. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9892. #define HTT_RX_IND_END_VALID_M 0x40000000
  9893. #define HTT_RX_IND_END_VALID_S 30
  9894. #define HTT_RX_IND_START_VALID_M 0x80000000
  9895. #define HTT_RX_IND_START_VALID_S 31
  9896. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9897. #define HTT_RX_IND_RSSI_PRI20_S 0
  9898. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9899. #define HTT_RX_IND_RSSI_EXT20_S 8
  9900. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9901. #define HTT_RX_IND_RSSI_EXT40_S 16
  9902. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9903. #define HTT_RX_IND_RSSI_EXT80_S 24
  9904. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9905. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9906. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9907. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9908. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9909. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9910. #define HTT_RX_IND_SERVICE_M 0xff000000
  9911. #define HTT_RX_IND_SERVICE_S 24
  9912. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9913. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9914. /* rx MSDU descriptor fields */
  9915. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9916. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9917. /* payload fields */
  9918. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9919. #define HTT_RX_IND_MPDU_COUNT_S 0
  9920. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9921. #define HTT_RX_IND_MPDU_STATUS_S 8
  9922. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9925. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9926. } while (0)
  9927. #define HTT_RX_IND_EXT_TID_GET(word) \
  9928. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9929. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9930. do { \
  9931. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9932. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9933. } while (0)
  9934. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9935. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9936. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9937. do { \
  9938. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9939. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9940. } while (0)
  9941. #define HTT_RX_IND_REL_VALID_GET(word) \
  9942. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9943. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9946. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9947. } while (0)
  9948. #define HTT_RX_IND_PEER_ID_GET(word) \
  9949. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9950. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9953. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9954. } while (0)
  9955. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9956. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9957. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9958. do { \
  9959. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9960. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9961. } while (0)
  9962. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9963. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9964. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9965. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9966. do { \
  9967. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9968. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9969. } while (0)
  9970. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9971. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9972. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9973. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9974. do { \
  9975. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9976. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9977. } while (0)
  9978. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9979. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9980. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9981. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9982. do { \
  9983. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9984. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9985. } while (0)
  9986. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9987. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9988. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9989. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9990. do { \
  9991. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9992. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9993. } while (0)
  9994. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9995. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9996. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9997. /* FW rx PPDU descriptor fields */
  9998. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9999. do { \
  10000. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  10001. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  10002. } while (0)
  10003. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10004. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10005. HTT_RX_IND_RSSI_CMB_S)
  10006. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10007. do { \
  10008. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10009. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10010. } while (0)
  10011. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10012. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10013. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10014. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10017. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10018. } while (0)
  10019. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10020. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10021. HTT_RX_IND_PHY_ERR_CODE_S)
  10022. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10023. do { \
  10024. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10025. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10026. } while (0)
  10027. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10028. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10029. HTT_RX_IND_PHY_ERR_S)
  10030. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10031. do { \
  10032. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10033. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10034. } while (0)
  10035. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10036. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10037. HTT_RX_IND_LEGACY_RATE_S)
  10038. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10039. do { \
  10040. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10041. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10042. } while (0)
  10043. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10044. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10045. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10046. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10047. do { \
  10048. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10049. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10050. } while (0)
  10051. #define HTT_RX_IND_END_VALID_GET(word) \
  10052. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10053. HTT_RX_IND_END_VALID_S)
  10054. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10055. do { \
  10056. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10057. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10058. } while (0)
  10059. #define HTT_RX_IND_START_VALID_GET(word) \
  10060. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10061. HTT_RX_IND_START_VALID_S)
  10062. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10063. do { \
  10064. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10065. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10066. } while (0)
  10067. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10068. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10069. HTT_RX_IND_RSSI_PRI20_S)
  10070. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10071. do { \
  10072. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10073. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10074. } while (0)
  10075. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10076. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10077. HTT_RX_IND_RSSI_EXT20_S)
  10078. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10079. do { \
  10080. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10081. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10082. } while (0)
  10083. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10084. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10085. HTT_RX_IND_RSSI_EXT40_S)
  10086. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10087. do { \
  10088. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10089. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10090. } while (0)
  10091. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10092. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10093. HTT_RX_IND_RSSI_EXT80_S)
  10094. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10095. do { \
  10096. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10097. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10098. } while (0)
  10099. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10100. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10101. HTT_RX_IND_VHT_SIG_A1_S)
  10102. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10103. do { \
  10104. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10105. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10106. } while (0)
  10107. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10108. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10109. HTT_RX_IND_VHT_SIG_A2_S)
  10110. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10111. do { \
  10112. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10113. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10114. } while (0)
  10115. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10116. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10117. HTT_RX_IND_PREAMBLE_TYPE_S)
  10118. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10119. do { \
  10120. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10121. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10122. } while (0)
  10123. #define HTT_RX_IND_SERVICE_GET(word) \
  10124. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10125. HTT_RX_IND_SERVICE_S)
  10126. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10127. do { \
  10128. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10129. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10130. } while (0)
  10131. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10132. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10133. HTT_RX_IND_SA_ANT_MATRIX_S)
  10134. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10135. do { \
  10136. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10137. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10138. } while (0)
  10139. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10140. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10141. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10142. do { \
  10143. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10144. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10145. } while (0)
  10146. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10147. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10148. #define HTT_RX_IND_HL_BYTES \
  10149. (HTT_RX_IND_HDR_BYTES + \
  10150. 4 /* single FW rx MSDU descriptor */ + \
  10151. 4 /* single MPDU range information element */)
  10152. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10153. /* Could we use one macro entry? */
  10154. #define HTT_WORD_SET(word, field, value) \
  10155. do { \
  10156. HTT_CHECK_SET_VAL(field, value); \
  10157. (word) |= ((value) << field ## _S); \
  10158. } while (0)
  10159. #define HTT_WORD_GET(word, field) \
  10160. (((word) & field ## _M) >> field ## _S)
  10161. PREPACK struct hl_htt_rx_ind_base {
  10162. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10163. } POSTPACK;
  10164. /*
  10165. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10166. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10167. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10168. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10169. * htt_rx_ind_hl_rx_desc_t.
  10170. */
  10171. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10172. struct htt_rx_ind_hl_rx_desc_t {
  10173. A_UINT8 ver;
  10174. A_UINT8 len;
  10175. struct {
  10176. A_UINT8
  10177. first_msdu: 1,
  10178. last_msdu: 1,
  10179. c3_failed: 1,
  10180. c4_failed: 1,
  10181. ipv6: 1,
  10182. tcp: 1,
  10183. udp: 1,
  10184. reserved: 1;
  10185. } flags;
  10186. /* NOTE: no reserved space - don't append any new fields here */
  10187. };
  10188. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10189. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10190. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10191. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10192. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10193. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10194. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10195. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10196. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10197. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10198. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10199. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10200. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10201. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10202. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10203. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10204. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10205. /* This structure is used in HL, the basic descriptor information
  10206. * used by host. the structure is translated by FW from HW desc
  10207. * or generated by FW. But in HL monitor mode, the host would use
  10208. * the same structure with LL.
  10209. */
  10210. PREPACK struct hl_htt_rx_desc_base {
  10211. A_UINT32
  10212. seq_num:12,
  10213. encrypted:1,
  10214. chan_info_present:1,
  10215. resv0:2,
  10216. mcast_bcast:1,
  10217. fragment:1,
  10218. key_id_oct:8,
  10219. resv1:6;
  10220. A_UINT32
  10221. pn_31_0;
  10222. union {
  10223. struct {
  10224. A_UINT16 pn_47_32;
  10225. A_UINT16 pn_63_48;
  10226. } pn16;
  10227. A_UINT32 pn_63_32;
  10228. } u0;
  10229. A_UINT32
  10230. pn_95_64;
  10231. A_UINT32
  10232. pn_127_96;
  10233. } POSTPACK;
  10234. /*
  10235. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10236. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10237. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10238. * Please see htt_chan_change_t for description of the fields.
  10239. */
  10240. PREPACK struct htt_chan_info_t
  10241. {
  10242. A_UINT32 primary_chan_center_freq_mhz: 16,
  10243. contig_chan1_center_freq_mhz: 16;
  10244. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10245. phy_mode: 8,
  10246. reserved: 8;
  10247. } POSTPACK;
  10248. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10249. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10250. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10251. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10252. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10253. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10254. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10255. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10256. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10257. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10258. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10259. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10260. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10261. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10262. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10263. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10264. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10265. /* Channel information */
  10266. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10267. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10268. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10269. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10270. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10271. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10272. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10273. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10274. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10275. do { \
  10276. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10277. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10278. } while (0)
  10279. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10280. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10281. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10282. do { \
  10283. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10284. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10285. } while (0)
  10286. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10287. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10288. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10289. do { \
  10290. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10291. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10292. } while (0)
  10293. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10294. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10295. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10296. do { \
  10297. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10298. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10299. } while (0)
  10300. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10301. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10302. /*
  10303. * @brief target -> host message definition for FW offloaded pkts
  10304. *
  10305. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10306. *
  10307. * @details
  10308. * The following field definitions describe the format of the firmware
  10309. * offload deliver message sent from the target to the host.
  10310. *
  10311. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10312. *
  10313. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10314. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10315. * | reserved_1 | msg type |
  10316. * |--------------------------------------------------------------------------|
  10317. * | phy_timestamp_l32 |
  10318. * |--------------------------------------------------------------------------|
  10319. * | WORD2 (see below) |
  10320. * |--------------------------------------------------------------------------|
  10321. * | seqno | framectrl |
  10322. * |--------------------------------------------------------------------------|
  10323. * | reserved_3 | vdev_id | tid_num|
  10324. * |--------------------------------------------------------------------------|
  10325. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10326. * |--------------------------------------------------------------------------|
  10327. *
  10328. * where:
  10329. * STAT = status
  10330. * F = format (802.3 vs. 802.11)
  10331. *
  10332. * definition for word 2
  10333. *
  10334. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10335. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10336. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10337. * |--------------------------------------------------------------------------|
  10338. *
  10339. * where:
  10340. * PR = preamble
  10341. * BF = beamformed
  10342. */
  10343. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10344. {
  10345. A_UINT32 /* word 0 */
  10346. msg_type:8, /* [ 7: 0] */
  10347. reserved_1:24; /* [31: 8] */
  10348. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10349. A_UINT32 /* word 2 */
  10350. /* preamble:
  10351. * 0-OFDM,
  10352. * 1-CCk,
  10353. * 2-HT,
  10354. * 3-VHT
  10355. */
  10356. preamble: 2, /* [1:0] */
  10357. /* mcs:
  10358. * In case of HT preamble interpret
  10359. * MCS along with NSS.
  10360. * Valid values for HT are 0 to 7.
  10361. * HT mcs 0 with NSS 2 is mcs 8.
  10362. * Valid values for VHT are 0 to 9.
  10363. */
  10364. mcs: 4, /* [5:2] */
  10365. /* rate:
  10366. * This is applicable only for
  10367. * CCK and OFDM preamble type
  10368. * rate 0: OFDM 48 Mbps,
  10369. * 1: OFDM 24 Mbps,
  10370. * 2: OFDM 12 Mbps
  10371. * 3: OFDM 6 Mbps
  10372. * 4: OFDM 54 Mbps
  10373. * 5: OFDM 36 Mbps
  10374. * 6: OFDM 18 Mbps
  10375. * 7: OFDM 9 Mbps
  10376. * rate 0: CCK 11 Mbps Long
  10377. * 1: CCK 5.5 Mbps Long
  10378. * 2: CCK 2 Mbps Long
  10379. * 3: CCK 1 Mbps Long
  10380. * 4: CCK 11 Mbps Short
  10381. * 5: CCK 5.5 Mbps Short
  10382. * 6: CCK 2 Mbps Short
  10383. */
  10384. rate : 3, /* [ 8: 6] */
  10385. rssi : 8, /* [16: 9] units=dBm */
  10386. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10387. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10388. stbc : 1, /* [22] */
  10389. sgi : 1, /* [23] */
  10390. ldpc : 1, /* [24] */
  10391. beamformed: 1, /* [25] */
  10392. reserved_2: 6; /* [31:26] */
  10393. A_UINT32 /* word 3 */
  10394. framectrl:16, /* [15: 0] */
  10395. seqno:16; /* [31:16] */
  10396. A_UINT32 /* word 4 */
  10397. tid_num:5, /* [ 4: 0] actual TID number */
  10398. vdev_id:8, /* [12: 5] */
  10399. reserved_3:19; /* [31:13] */
  10400. A_UINT32 /* word 5 */
  10401. /* status:
  10402. * 0: tx_ok
  10403. * 1: retry
  10404. * 2: drop
  10405. * 3: filtered
  10406. * 4: abort
  10407. * 5: tid delete
  10408. * 6: sw abort
  10409. * 7: dropped by peer migration
  10410. */
  10411. status:3, /* [2:0] */
  10412. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10413. tx_mpdu_bytes:16, /* [19:4] */
  10414. /* Indicates retry count of offloaded/local generated Data tx frames */
  10415. tx_retry_cnt:6, /* [25:20] */
  10416. reserved_4:6; /* [31:26] */
  10417. } POSTPACK;
  10418. /* FW offload deliver ind message header fields */
  10419. /* DWORD one */
  10420. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10421. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10422. /* DWORD two */
  10423. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10424. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10425. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10426. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10427. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10428. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10429. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10430. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10431. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10432. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10433. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10434. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10435. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10436. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10437. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10438. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10439. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10440. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10441. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10442. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10443. /* DWORD three*/
  10444. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10445. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10446. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10447. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10448. /* DWORD four */
  10449. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10450. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10451. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10452. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10453. /* DWORD five */
  10454. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10455. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10456. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10457. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10458. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10459. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10460. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10461. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10462. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10463. do { \
  10464. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10465. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10466. } while (0)
  10467. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10468. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10469. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10470. do { \
  10471. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10472. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10473. } while (0)
  10474. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10475. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10476. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10477. do { \
  10478. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10479. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10480. } while (0)
  10481. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10482. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10483. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10484. do { \
  10485. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10486. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10487. } while (0)
  10488. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10489. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10490. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10491. do { \
  10492. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10493. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10494. } while (0)
  10495. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10496. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10497. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10498. do { \
  10499. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10500. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10501. } while (0)
  10502. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10503. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10504. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10505. do { \
  10506. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10507. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10508. } while (0)
  10509. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10510. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10511. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10512. do { \
  10513. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10514. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10515. } while (0)
  10516. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10517. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10518. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10519. do { \
  10520. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10521. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10522. } while (0)
  10523. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10524. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10525. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10526. do { \
  10527. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10528. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10529. } while (0)
  10530. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10531. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10532. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10533. do { \
  10534. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10535. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10536. } while (0)
  10537. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10538. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10539. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10540. do { \
  10541. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10542. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10543. } while (0)
  10544. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10545. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10546. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10547. do { \
  10548. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10549. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10550. } while (0)
  10551. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10552. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10553. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10554. do { \
  10555. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10556. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10557. } while (0)
  10558. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10559. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10560. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10561. do { \
  10562. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10563. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10564. } while (0)
  10565. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10566. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10567. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10568. do { \
  10569. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10570. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10571. } while (0)
  10572. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10573. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10574. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10575. do { \
  10576. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10577. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10578. } while (0)
  10579. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10580. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10581. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10582. do { \
  10583. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10584. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10585. } while (0)
  10586. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10587. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10588. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10589. do { \
  10590. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10591. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10592. } while (0)
  10593. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10594. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10595. /*
  10596. * @brief target -> host rx reorder flush message definition
  10597. *
  10598. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10599. *
  10600. * @details
  10601. * The following field definitions describe the format of the rx flush
  10602. * message sent from the target to the host.
  10603. * The message consists of a 4-octet header, followed by one or more
  10604. * 4-octet payload information elements.
  10605. *
  10606. * |31 24|23 8|7 0|
  10607. * |--------------------------------------------------------------|
  10608. * | TID | peer ID | msg type |
  10609. * |--------------------------------------------------------------|
  10610. * | seq num end | seq num start | MPDU status | reserved |
  10611. * |--------------------------------------------------------------|
  10612. * First DWORD:
  10613. * - MSG_TYPE
  10614. * Bits 7:0
  10615. * Purpose: identifies this as an rx flush message
  10616. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10617. * - PEER_ID
  10618. * Bits 23:8 (only bits 18:8 actually used)
  10619. * Purpose: identify which peer's rx data is being flushed
  10620. * Value: (rx) peer ID
  10621. * - TID
  10622. * Bits 31:24 (only bits 27:24 actually used)
  10623. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10624. * Value: traffic identifier
  10625. * Second DWORD:
  10626. * - MPDU_STATUS
  10627. * Bits 15:8
  10628. * Purpose:
  10629. * Indicate whether the flushed MPDUs should be discarded or processed.
  10630. * Value:
  10631. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10632. * stages of rx processing
  10633. * other: discard the MPDUs
  10634. * It is anticipated that flush messages will always have
  10635. * MPDU status == 1, but the status flag is included for
  10636. * flexibility.
  10637. * - SEQ_NUM_START
  10638. * Bits 23:16
  10639. * Purpose:
  10640. * Indicate the start of a series of consecutive MPDUs being flushed.
  10641. * Not all MPDUs within this range are necessarily valid - the host
  10642. * must check each sequence number within this range to see if the
  10643. * corresponding MPDU is actually present.
  10644. * Value:
  10645. * The sequence number for the first MPDU in the sequence.
  10646. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10647. * - SEQ_NUM_END
  10648. * Bits 30:24
  10649. * Purpose:
  10650. * Indicate the end of a series of consecutive MPDUs being flushed.
  10651. * Value:
  10652. * The sequence number one larger than the sequence number of the
  10653. * last MPDU being flushed.
  10654. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10655. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10656. * are to be released for further rx processing.
  10657. * Not all MPDUs within this range are necessarily valid - the host
  10658. * must check each sequence number within this range to see if the
  10659. * corresponding MPDU is actually present.
  10660. */
  10661. /* first DWORD */
  10662. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10663. #define HTT_RX_FLUSH_PEER_ID_S 8
  10664. #define HTT_RX_FLUSH_TID_M 0xff000000
  10665. #define HTT_RX_FLUSH_TID_S 24
  10666. /* second DWORD */
  10667. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10668. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10669. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10670. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10671. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10672. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10673. #define HTT_RX_FLUSH_BYTES 8
  10674. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10675. do { \
  10676. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10677. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10678. } while (0)
  10679. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10680. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10681. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10682. do { \
  10683. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10684. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10685. } while (0)
  10686. #define HTT_RX_FLUSH_TID_GET(word) \
  10687. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10688. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10689. do { \
  10690. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10691. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10692. } while (0)
  10693. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10694. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10695. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10696. do { \
  10697. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10698. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10699. } while (0)
  10700. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10701. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10702. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10703. do { \
  10704. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10705. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10706. } while (0)
  10707. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10708. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10709. /*
  10710. * @brief target -> host rx pn check indication message
  10711. *
  10712. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10713. *
  10714. * @details
  10715. * The following field definitions describe the format of the Rx PN check
  10716. * indication message sent from the target to the host.
  10717. * The message consists of a 4-octet header, followed by the start and
  10718. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10719. * IE is one octet containing the sequence number that failed the PN
  10720. * check.
  10721. *
  10722. * |31 24|23 8|7 0|
  10723. * |--------------------------------------------------------------|
  10724. * | TID | peer ID | msg type |
  10725. * |--------------------------------------------------------------|
  10726. * | Reserved | PN IE count | seq num end | seq num start|
  10727. * |--------------------------------------------------------------|
  10728. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10729. * |--------------------------------------------------------------|
  10730. * First DWORD:
  10731. * - MSG_TYPE
  10732. * Bits 7:0
  10733. * Purpose: Identifies this as an rx pn check indication message
  10734. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10735. * - PEER_ID
  10736. * Bits 23:8 (only bits 18:8 actually used)
  10737. * Purpose: identify which peer
  10738. * Value: (rx) peer ID
  10739. * - TID
  10740. * Bits 31:24 (only bits 27:24 actually used)
  10741. * Purpose: identify traffic identifier
  10742. * Value: traffic identifier
  10743. * Second DWORD:
  10744. * - SEQ_NUM_START
  10745. * Bits 7:0
  10746. * Purpose:
  10747. * Indicates the starting sequence number of the MPDU in this
  10748. * series of MPDUs that went though PN check.
  10749. * Value:
  10750. * The sequence number for the first MPDU in the sequence.
  10751. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10752. * - SEQ_NUM_END
  10753. * Bits 15:8
  10754. * Purpose:
  10755. * Indicates the ending sequence number of the MPDU in this
  10756. * series of MPDUs that went though PN check.
  10757. * Value:
  10758. * The sequence number one larger then the sequence number of the last
  10759. * MPDU being flushed.
  10760. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10761. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10762. * for invalid PN numbers and are ready to be released for further processing.
  10763. * Not all MPDUs within this range are necessarily valid - the host
  10764. * must check each sequence number within this range to see if the
  10765. * corresponding MPDU is actually present.
  10766. * - PN_IE_COUNT
  10767. * Bits 23:16
  10768. * Purpose:
  10769. * Used to determine the variable number of PN information elements in this
  10770. * message
  10771. *
  10772. * PN information elements:
  10773. * - PN_IE_x-
  10774. * Purpose:
  10775. * Each PN information element contains the sequence number of the MPDU that
  10776. * has failed the target PN check.
  10777. * Value:
  10778. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10779. * that failed the PN check.
  10780. */
  10781. /* first DWORD */
  10782. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10783. #define HTT_RX_PN_IND_PEER_ID_S 8
  10784. #define HTT_RX_PN_IND_TID_M 0xff000000
  10785. #define HTT_RX_PN_IND_TID_S 24
  10786. /* second DWORD */
  10787. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10788. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10789. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10790. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10791. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10792. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10793. #define HTT_RX_PN_IND_BYTES 8
  10794. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10795. do { \
  10796. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10797. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10798. } while (0)
  10799. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10800. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10801. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10802. do { \
  10803. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10804. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10805. } while (0)
  10806. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10807. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10808. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10809. do { \
  10810. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10811. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10812. } while (0)
  10813. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10814. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10815. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10816. do { \
  10817. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10818. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10819. } while (0)
  10820. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10821. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10822. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10823. do { \
  10824. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10825. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10826. } while (0)
  10827. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10828. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10829. /*
  10830. * @brief target -> host rx offload deliver message for LL system
  10831. *
  10832. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10833. *
  10834. * @details
  10835. * In a low latency system this message is sent whenever the offload
  10836. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10837. * The DMA of the actual packets into host memory is done before sending out
  10838. * this message. This message indicates only how many MSDUs to reap. The
  10839. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10840. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10841. * DMA'd by the MAC directly into host memory these packets do not contain
  10842. * the MAC descriptors in the header portion of the packet. Instead they contain
  10843. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10844. * message, the packets are delivered directly to the NW stack without going
  10845. * through the regular reorder buffering and PN checking path since it has
  10846. * already been done in target.
  10847. *
  10848. * |31 24|23 16|15 8|7 0|
  10849. * |-----------------------------------------------------------------------|
  10850. * | Total MSDU count | reserved | msg type |
  10851. * |-----------------------------------------------------------------------|
  10852. *
  10853. * @brief target -> host rx offload deliver message for HL system
  10854. *
  10855. * @details
  10856. * In a high latency system this message is sent whenever the offload manager
  10857. * flushes out the packets it has coalesced in its coalescing buffer. The
  10858. * actual packets are also carried along with this message. When the host
  10859. * receives this message, it is expected to deliver these packets to the NW
  10860. * stack directly instead of routing them through the reorder buffering and
  10861. * PN checking path since it has already been done in target.
  10862. *
  10863. * |31 24|23 16|15 8|7 0|
  10864. * |-----------------------------------------------------------------------|
  10865. * | Total MSDU count | reserved | msg type |
  10866. * |-----------------------------------------------------------------------|
  10867. * | peer ID | MSDU length |
  10868. * |-----------------------------------------------------------------------|
  10869. * | MSDU payload | FW Desc | tid | vdev ID |
  10870. * |-----------------------------------------------------------------------|
  10871. * | MSDU payload contd. |
  10872. * |-----------------------------------------------------------------------|
  10873. * | peer ID | MSDU length |
  10874. * |-----------------------------------------------------------------------|
  10875. * | MSDU payload | FW Desc | tid | vdev ID |
  10876. * |-----------------------------------------------------------------------|
  10877. * | MSDU payload contd. |
  10878. * |-----------------------------------------------------------------------|
  10879. *
  10880. */
  10881. /* first DWORD */
  10882. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10883. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10884. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10885. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10886. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10887. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10888. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10889. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10890. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10891. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10892. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10893. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10894. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10896. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10897. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10898. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10899. do { \
  10900. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10901. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10902. } while (0)
  10903. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10904. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10905. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10906. do { \
  10907. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10908. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10909. } while (0)
  10910. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10911. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10912. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10913. do { \
  10914. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10915. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10916. } while (0)
  10917. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10918. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10919. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10920. do { \
  10921. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10922. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10923. } while (0)
  10924. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10925. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10926. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10927. do { \
  10928. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10929. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10930. } while (0)
  10931. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10932. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10933. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10934. do { \
  10935. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10936. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10937. } while (0)
  10938. /**
  10939. * @brief target -> host rx peer map/unmap message definition
  10940. *
  10941. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10942. *
  10943. * @details
  10944. * The following diagram shows the format of the rx peer map message sent
  10945. * from the target to the host. This layout assumes the target operates
  10946. * as little-endian.
  10947. *
  10948. * This message always contains a SW peer ID. The main purpose of the
  10949. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10950. * with, so that the host can use that peer ID to determine which peer
  10951. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10952. * other purposes, such as identifying during tx completions which peer
  10953. * the tx frames in question were transmitted to.
  10954. *
  10955. * In certain generations of chips, the peer map message also contains
  10956. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10957. * to identify which peer the frame needs to be forwarded to (i.e. the
  10958. * peer associated with the Destination MAC Address within the packet),
  10959. * and particularly which vdev needs to transmit the frame (for cases
  10960. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10961. * meaning as AST_INDEX_0.
  10962. * This DA-based peer ID that is provided for certain rx frames
  10963. * (the rx frames that need to be re-transmitted as tx frames)
  10964. * is the ID that the HW uses for referring to the peer in question,
  10965. * rather than the peer ID that the SW+FW use to refer to the peer.
  10966. *
  10967. *
  10968. * |31 24|23 16|15 8|7 0|
  10969. * |-----------------------------------------------------------------------|
  10970. * | SW peer ID | VDEV ID | msg type |
  10971. * |-----------------------------------------------------------------------|
  10972. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10973. * |-----------------------------------------------------------------------|
  10974. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10975. * |-----------------------------------------------------------------------|
  10976. *
  10977. *
  10978. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10979. *
  10980. * The following diagram shows the format of the rx peer unmap message sent
  10981. * from the target to the host.
  10982. *
  10983. * |31 24|23 16|15 8|7 0|
  10984. * |-----------------------------------------------------------------------|
  10985. * | SW peer ID | VDEV ID | msg type |
  10986. * |-----------------------------------------------------------------------|
  10987. *
  10988. * The following field definitions describe the format of the rx peer map
  10989. * and peer unmap messages sent from the target to the host.
  10990. * - MSG_TYPE
  10991. * Bits 7:0
  10992. * Purpose: identifies this as an rx peer map or peer unmap message
  10993. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10994. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10995. * - VDEV_ID
  10996. * Bits 15:8
  10997. * Purpose: Indicates which virtual device the peer is associated
  10998. * with.
  10999. * Value: vdev ID (used in the host to look up the vdev object)
  11000. * - PEER_ID (a.k.a. SW_PEER_ID)
  11001. * Bits 31:16
  11002. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11003. * freeing (unmap)
  11004. * Value: (rx) peer ID
  11005. * - MAC_ADDR_L32 (peer map only)
  11006. * Bits 31:0
  11007. * Purpose: Identifies which peer node the peer ID is for.
  11008. * Value: lower 4 bytes of peer node's MAC address
  11009. * - MAC_ADDR_U16 (peer map only)
  11010. * Bits 15:0
  11011. * Purpose: Identifies which peer node the peer ID is for.
  11012. * Value: upper 2 bytes of peer node's MAC address
  11013. * - HW_PEER_ID
  11014. * Bits 31:16
  11015. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11016. * address, so for rx frames marked for rx --> tx forwarding, the
  11017. * host can determine from the HW peer ID provided as meta-data with
  11018. * the rx frame which peer the frame is supposed to be forwarded to.
  11019. * Value: ID used by the MAC HW to identify the peer
  11020. */
  11021. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11022. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11023. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11024. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11025. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11026. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11027. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11028. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11029. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11030. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11031. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11032. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11033. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11034. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11037. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11038. } while (0)
  11039. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11040. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11041. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11042. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11045. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11046. } while (0)
  11047. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11048. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11049. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11050. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11051. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11052. do { \
  11053. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11054. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11055. } while (0)
  11056. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11057. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11058. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11059. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11060. #define HTT_RX_PEER_MAP_BYTES 12
  11061. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11062. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11063. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11064. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11065. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11066. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11067. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11068. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11069. #define HTT_RX_PEER_UNMAP_BYTES 4
  11070. /**
  11071. * @brief target -> host rx peer map V2 message definition
  11072. *
  11073. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11074. *
  11075. * @details
  11076. * The following diagram shows the format of the rx peer map v2 message sent
  11077. * from the target to the host. This layout assumes the target operates
  11078. * as little-endian.
  11079. *
  11080. * This message always contains a SW peer ID. The main purpose of the
  11081. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11082. * with, so that the host can use that peer ID to determine which peer
  11083. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11084. * other purposes, such as identifying during tx completions which peer
  11085. * the tx frames in question were transmitted to.
  11086. *
  11087. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11088. * is used during rx --> tx frame forwarding to identify which peer the
  11089. * frame needs to be forwarded to (i.e. the peer associated with the
  11090. * Destination MAC Address within the packet), and particularly which vdev
  11091. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11092. * This DA-based peer ID that is provided for certain rx frames
  11093. * (the rx frames that need to be re-transmitted as tx frames)
  11094. * is the ID that the HW uses for referring to the peer in question,
  11095. * rather than the peer ID that the SW+FW use to refer to the peer.
  11096. *
  11097. * The HW peer id here is the same meaning as AST_INDEX_0.
  11098. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11099. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11100. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11101. * AST is valid.
  11102. *
  11103. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11104. * |-------------------------------------------------------------------------|
  11105. * | SW peer ID | VDEV ID | msg type |
  11106. * |-------------------------------------------------------------------------|
  11107. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11108. * |-------------------------------------------------------------------------|
  11109. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11110. * |-------------------------------------------------------------------------|
  11111. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11112. * |-------------------------------------------------------------------------|
  11113. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11114. * |-------------------------------------------------------------------------|
  11115. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11116. * |-------------------------------------------------------------------------|
  11117. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11118. * |-------------------------------------------------------------------------|
  11119. * | Reserved_2 |
  11120. * |-------------------------------------------------------------------------|
  11121. * Where:
  11122. * NH = Next Hop
  11123. * ASTVM = AST valid mask
  11124. * OA = on-chip AST valid bit
  11125. * ASTFM = AST flow mask
  11126. *
  11127. * The following field definitions describe the format of the rx peer map v2
  11128. * messages sent from the target to the host.
  11129. * - MSG_TYPE
  11130. * Bits 7:0
  11131. * Purpose: identifies this as an rx peer map v2 message
  11132. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11133. * - VDEV_ID
  11134. * Bits 15:8
  11135. * Purpose: Indicates which virtual device the peer is associated with.
  11136. * Value: vdev ID (used in the host to look up the vdev object)
  11137. * - SW_PEER_ID
  11138. * Bits 31:16
  11139. * Purpose: The peer ID (index) that WAL is allocating
  11140. * Value: (rx) peer ID
  11141. * - MAC_ADDR_L32
  11142. * Bits 31:0
  11143. * Purpose: Identifies which peer node the peer ID is for.
  11144. * Value: lower 4 bytes of peer node's MAC address
  11145. * - MAC_ADDR_U16
  11146. * Bits 15:0
  11147. * Purpose: Identifies which peer node the peer ID is for.
  11148. * Value: upper 2 bytes of peer node's MAC address
  11149. * - HW_PEER_ID / AST_INDEX_0
  11150. * Bits 31:16
  11151. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11152. * address, so for rx frames marked for rx --> tx forwarding, the
  11153. * host can determine from the HW peer ID provided as meta-data with
  11154. * the rx frame which peer the frame is supposed to be forwarded to.
  11155. * Value: ID used by the MAC HW to identify the peer
  11156. * - AST_HASH_VALUE
  11157. * Bits 15:0
  11158. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11159. * override feature.
  11160. * - NEXT_HOP
  11161. * Bit 16
  11162. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11163. * (Wireless Distribution System).
  11164. * - AST_VALID_MASK
  11165. * Bits 19:17
  11166. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11167. * - ONCHIP_AST_VALID_FLAG
  11168. * Bit 20
  11169. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11170. * is valid.
  11171. * - AST_INDEX_1
  11172. * Bits 15:0
  11173. * Purpose: indicate the second AST index for this peer
  11174. * - AST_0_FLOW_MASK
  11175. * Bits 19:16
  11176. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11177. * - AST_1_FLOW_MASK
  11178. * Bits 23:20
  11179. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11180. * - AST_2_FLOW_MASK
  11181. * Bits 27:24
  11182. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11183. * - AST_3_FLOW_MASK
  11184. * Bits 31:28
  11185. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11186. * - AST_INDEX_2
  11187. * Bits 15:0
  11188. * Purpose: indicate the third AST index for this peer
  11189. * - TID_VALID_HI_PRI
  11190. * Bits 23:16
  11191. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11192. * - TID_VALID_LOW_PRI
  11193. * Bits 31:24
  11194. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11195. * - AST_INDEX_3
  11196. * Bits 15:0
  11197. * Purpose: indicate the fourth AST index for this peer
  11198. * - ONCHIP_AST_IDX / RESERVED
  11199. * Bits 31:16
  11200. * Purpose: This field is valid only when split AST feature is enabled.
  11201. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11202. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11203. * address, this ast_idx is used for LMAC modules for RXPCU.
  11204. * Value: ID used by the LMAC HW to identify the peer
  11205. */
  11206. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11207. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11208. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11209. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11210. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11211. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11212. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11213. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11214. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11215. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11216. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11217. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11218. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11219. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11220. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11221. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11222. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11223. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11224. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11225. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11226. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11227. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11228. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11229. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11230. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11231. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11232. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11233. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11234. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11235. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11236. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11237. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11238. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11239. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11240. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11241. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11242. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11243. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11244. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11245. do { \
  11246. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11247. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11248. } while (0)
  11249. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11250. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11251. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11252. do { \
  11253. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11254. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11255. } while (0)
  11256. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11257. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11258. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11259. do { \
  11260. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11261. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11262. } while (0)
  11263. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11264. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11265. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11266. do { \
  11267. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11268. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11269. } while (0)
  11270. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11271. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11272. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11273. do { \
  11274. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11275. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11276. } while (0)
  11277. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11278. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11279. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11280. do { \
  11281. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11282. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11283. } while (0)
  11284. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11285. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11286. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11287. do { \
  11288. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11289. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11290. } while (0)
  11291. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11292. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11293. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11294. do { \
  11295. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11296. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11297. } while (0)
  11298. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11299. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11300. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11301. do { \
  11302. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11303. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11304. } while (0)
  11305. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11306. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11307. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11308. do { \
  11309. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11310. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11311. } while (0)
  11312. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11313. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11314. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11315. do { \
  11316. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11317. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11318. } while (0)
  11319. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11320. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11321. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11322. do { \
  11323. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11324. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11325. } while (0)
  11326. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11327. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11328. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11329. do { \
  11330. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11331. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11332. } while (0)
  11333. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11334. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11335. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11336. do { \
  11337. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11338. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11339. } while (0)
  11340. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11341. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11342. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11343. do { \
  11344. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11345. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11346. } while (0)
  11347. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11348. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11349. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11350. do { \
  11351. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11352. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11353. } while (0)
  11354. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11355. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11356. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11357. do { \
  11358. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11359. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11360. } while (0)
  11361. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11362. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11363. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11364. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11365. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11366. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11367. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11368. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11369. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11370. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11371. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11372. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11373. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11374. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11375. /**
  11376. * @brief target -> host rx peer map V3 message definition
  11377. *
  11378. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11379. *
  11380. * @details
  11381. * The following diagram shows the format of the rx peer map v3 message sent
  11382. * from the target to the host.
  11383. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11384. * This layout assumes the target operates as little-endian.
  11385. *
  11386. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11387. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11388. * | SW peer ID | VDEV ID | msg type |
  11389. * |-----------------+--------------------+-----------------+-----------------|
  11390. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11391. * |-----------------+--------------------+-----------------+-----------------|
  11392. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11393. * |-----------------+--------+-----------+-----------------+-----------------|
  11394. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11395. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11396. * | (8bits) | | (4bits) | |
  11397. * |-----------------+--------+--+--+--+--------------------------------------|
  11398. * | RESERVED |E |O | | |
  11399. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11400. * | |V |V | | |
  11401. * |-----------------+--------------------+-----------------------------------|
  11402. * | HTT_MSDU_IDX_ | RESERVED | |
  11403. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11404. * | (8bits) | | |
  11405. * |-----------------+--------------------+-----------------------------------|
  11406. * | Reserved_2 |
  11407. * |--------------------------------------------------------------------------|
  11408. * | Reserved_3 |
  11409. * |--------------------------------------------------------------------------|
  11410. *
  11411. * Where:
  11412. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11413. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11414. * NH = Next Hop
  11415. * The following field definitions describe the format of the rx peer map v3
  11416. * messages sent from the target to the host.
  11417. * - MSG_TYPE
  11418. * Bits 7:0
  11419. * Purpose: identifies this as a peer map v3 message
  11420. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11421. * - VDEV_ID
  11422. * Bits 15:8
  11423. * Purpose: Indicates which virtual device the peer is associated with.
  11424. * - SW_PEER_ID
  11425. * Bits 31:16
  11426. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11427. * - MAC_ADDR_L32
  11428. * Bits 31:0
  11429. * Purpose: Identifies which peer node the peer ID is for.
  11430. * Value: lower 4 bytes of peer node's MAC address
  11431. * - MAC_ADDR_U16
  11432. * Bits 15:0
  11433. * Purpose: Identifies which peer node the peer ID is for.
  11434. * Value: upper 2 bytes of peer node's MAC address
  11435. * - MULTICAST_SW_PEER_ID
  11436. * Bits 31:16
  11437. * Purpose: The multicast peer ID (index)
  11438. * Value: set to HTT_INVALID_PEER if not valid
  11439. * - HW_PEER_ID / AST_INDEX
  11440. * Bits 15:0
  11441. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11442. * address, so for rx frames marked for rx --> tx forwarding, the
  11443. * host can determine from the HW peer ID provided as meta-data with
  11444. * the rx frame which peer the frame is supposed to be forwarded to.
  11445. * - CACHE_SET_NUM
  11446. * Bits 19:16
  11447. * Purpose: Cache Set Number for AST_INDEX
  11448. * Cache set number that should be used to cache the index based
  11449. * search results, for address and flow search.
  11450. * This value should be equal to LSB 4 bits of the hash value
  11451. * of match data, in case of search index points to an entry which
  11452. * may be used in content based search also. The value can be
  11453. * anything when the entry pointed by search index will not be
  11454. * used for content based search.
  11455. * - HTT_MSDU_IDX_VALID_MASK
  11456. * Bits 31:24
  11457. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11458. * - ONCHIP_AST_IDX / RESERVED
  11459. * Bits 15:0
  11460. * Purpose: This field is valid only when split AST feature is enabled.
  11461. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11462. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11463. * address, this ast_idx is used for LMAC modules for RXPCU.
  11464. * - NEXT_HOP
  11465. * Bits 16
  11466. * Purpose: Flag indicates next_hop AST entry used for WDS
  11467. * (Wireless Distribution System).
  11468. * - ONCHIP_AST_VALID
  11469. * Bits 17
  11470. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11471. * - EXT_AST_VALID
  11472. * Bits 18
  11473. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11474. * - EXT_AST_INDEX
  11475. * Bits 15:0
  11476. * Purpose: This field describes Extended AST index
  11477. * Valid if EXT_AST_VALID flag set
  11478. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11479. * Bits 31:24
  11480. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11481. */
  11482. /* dword 0 */
  11483. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11484. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11485. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11486. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11487. /* dword 1 */
  11488. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11489. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11490. /* dword 2 */
  11491. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11492. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11493. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11494. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11495. /* dword 3 */
  11496. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11497. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11498. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11499. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11500. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11501. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11502. /* dword 4 */
  11503. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11504. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11505. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11506. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11507. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11508. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11509. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11510. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11511. /* dword 5 */
  11512. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11513. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11514. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11515. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11516. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11517. do { \
  11518. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11519. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11520. } while (0)
  11521. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11522. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11523. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11524. do { \
  11525. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11526. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11527. } while (0)
  11528. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11529. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11530. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11531. do { \
  11532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11533. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11534. } while (0)
  11535. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11536. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11537. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11538. do { \
  11539. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11540. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11541. } while (0)
  11542. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11543. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11544. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11545. do { \
  11546. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11547. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11548. } while (0)
  11549. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11550. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11551. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11552. do { \
  11553. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11554. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11555. } while (0)
  11556. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11557. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11558. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11559. do { \
  11560. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11561. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11562. } while (0)
  11563. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11564. (((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)
  11565. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11566. do { \
  11567. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11568. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11569. } while (0)
  11570. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11571. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11572. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11573. do { \
  11574. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11575. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11576. } while (0)
  11577. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11578. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11579. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11580. do { \
  11581. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11582. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11583. } while (0)
  11584. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11585. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11586. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11587. do { \
  11588. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11589. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11590. } while (0)
  11591. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11592. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11593. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11594. do { \
  11595. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11596. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11597. } while (0)
  11598. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11599. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11600. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11601. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11602. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11603. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11604. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11605. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11606. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11607. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11608. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11609. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11610. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11611. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11612. /**
  11613. * @brief target -> host rx peer unmap V2 message definition
  11614. *
  11615. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11616. *
  11617. * The following diagram shows the format of the rx peer unmap message sent
  11618. * from the target to the host.
  11619. *
  11620. * |31 24|23 16|15 8|7 0|
  11621. * |-----------------------------------------------------------------------|
  11622. * | SW peer ID | VDEV ID | msg type |
  11623. * |-----------------------------------------------------------------------|
  11624. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11625. * |-----------------------------------------------------------------------|
  11626. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11627. * |-----------------------------------------------------------------------|
  11628. * | Peer Delete Duration |
  11629. * |-----------------------------------------------------------------------|
  11630. * | Reserved_0 | WDS Free Count |
  11631. * |-----------------------------------------------------------------------|
  11632. * | Reserved_1 |
  11633. * |-----------------------------------------------------------------------|
  11634. * | Reserved_2 |
  11635. * |-----------------------------------------------------------------------|
  11636. *
  11637. *
  11638. * The following field definitions describe the format of the rx peer unmap
  11639. * messages sent from the target to the host.
  11640. * - MSG_TYPE
  11641. * Bits 7:0
  11642. * Purpose: identifies this as an rx peer unmap v2 message
  11643. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11644. * - VDEV_ID
  11645. * Bits 15:8
  11646. * Purpose: Indicates which virtual device the peer is associated
  11647. * with.
  11648. * Value: vdev ID (used in the host to look up the vdev object)
  11649. * - SW_PEER_ID
  11650. * Bits 31:16
  11651. * Purpose: The peer ID (index) that WAL is freeing
  11652. * Value: (rx) peer ID
  11653. * - MAC_ADDR_L32
  11654. * Bits 31:0
  11655. * Purpose: Identifies which peer node the peer ID is for.
  11656. * Value: lower 4 bytes of peer node's MAC address
  11657. * - MAC_ADDR_U16
  11658. * Bits 15:0
  11659. * Purpose: Identifies which peer node the peer ID is for.
  11660. * Value: upper 2 bytes of peer node's MAC address
  11661. * - NEXT_HOP
  11662. * Bits 16
  11663. * Purpose: Bit indicates next_hop AST entry used for WDS
  11664. * (Wireless Distribution System).
  11665. * - PEER_DELETE_DURATION
  11666. * Bits 31:0
  11667. * Purpose: Time taken to delete peer, in msec,
  11668. * Used for monitoring / debugging PEER delete response delay
  11669. * - PEER_WDS_FREE_COUNT
  11670. * Bits 15:0
  11671. * Purpose: Count of WDS entries deleted associated to peer deleted
  11672. */
  11673. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11674. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11675. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11676. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11677. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11678. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11679. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11680. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11681. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11682. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11683. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11684. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11685. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11686. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11687. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11688. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11689. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11690. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11691. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11692. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11693. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11694. do { \
  11695. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11696. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11697. } while (0)
  11698. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11699. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11700. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11701. do { \
  11702. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11703. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11704. } while (0)
  11705. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11706. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11707. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11708. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11709. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11710. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11711. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11712. /**
  11713. * @brief target -> host rx peer mlo map message definition
  11714. *
  11715. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11716. *
  11717. * @details
  11718. * The following diagram shows the format of the rx mlo peer map message sent
  11719. * from the target to the host. This layout assumes the target operates
  11720. * as little-endian.
  11721. *
  11722. * MCC:
  11723. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11724. *
  11725. * WIN:
  11726. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11727. * It will be sent on the Assoc Link.
  11728. *
  11729. * This message always contains a MLO peer ID. The main purpose of the
  11730. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11731. * with, so that the host can use that MLO peer ID to determine which peer
  11732. * transmitted the rx frame.
  11733. *
  11734. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11735. * |-------------------------------------------------------------------------|
  11736. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11737. * |-------------------------------------------------------------------------|
  11738. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11739. * |-------------------------------------------------------------------------|
  11740. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11741. * |-------------------------------------------------------------------------|
  11742. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11743. * |-------------------------------------------------------------------------|
  11744. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11745. * |-------------------------------------------------------------------------|
  11746. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11747. * |-------------------------------------------------------------------------|
  11748. * |RSVD |
  11749. * |-------------------------------------------------------------------------|
  11750. * |RSVD |
  11751. * |-------------------------------------------------------------------------|
  11752. * | htt_tlv_hdr_t |
  11753. * |-------------------------------------------------------------------------|
  11754. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11755. * |-------------------------------------------------------------------------|
  11756. * | htt_tlv_hdr_t |
  11757. * |-------------------------------------------------------------------------|
  11758. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11759. * |-------------------------------------------------------------------------|
  11760. * | htt_tlv_hdr_t |
  11761. * |-------------------------------------------------------------------------|
  11762. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11763. * |-------------------------------------------------------------------------|
  11764. *
  11765. * Where:
  11766. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11767. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11768. * V (valid) - 1 Bit Bit17
  11769. * CHIPID - 3 Bits
  11770. * TIDMASK - 8 Bits
  11771. * CACHE_SET_NUM - 8 Bits
  11772. *
  11773. * The following field definitions describe the format of the rx MLO peer map
  11774. * messages sent from the target to the host.
  11775. * - MSG_TYPE
  11776. * Bits 7:0
  11777. * Purpose: identifies this as an rx mlo peer map message
  11778. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11779. *
  11780. * - MLO_PEER_ID
  11781. * Bits 23:8
  11782. * Purpose: The MLO peer ID (index).
  11783. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11784. * Value: MLO peer ID
  11785. *
  11786. * - NUMLINK
  11787. * Bits: 26:24 (3Bits)
  11788. * Purpose: Indicate the max number of logical links supported per client.
  11789. * Value: number of logical links
  11790. *
  11791. * - PRC
  11792. * Bits: 29:27 (3Bits)
  11793. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11794. * if there is migration of the primary chip.
  11795. * Value: Primary REO CHIPID
  11796. *
  11797. * - MAC_ADDR_L32
  11798. * Bits 31:0
  11799. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11800. * Value: lower 4 bytes of peer node's MAC address
  11801. *
  11802. * - MAC_ADDR_U16
  11803. * Bits 15:0
  11804. * Purpose: Identifies which peer node the peer ID is for.
  11805. * Value: upper 2 bytes of peer node's MAC address
  11806. *
  11807. * - PRIMARY_TCL_AST_IDX
  11808. * Bits 15:0
  11809. * Purpose: Primary TCL AST index for this peer.
  11810. *
  11811. * - V
  11812. * 1 Bit Position 16
  11813. * Purpose: If the ast idx is valid.
  11814. *
  11815. * - CHIPID
  11816. * Bits 19:17
  11817. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11818. *
  11819. * - TIDMASK
  11820. * Bits 27:20
  11821. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11822. *
  11823. * - CACHE_SET_NUM
  11824. * Bits 31:28
  11825. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11826. * Cache set number that should be used to cache the index based
  11827. * search results, for address and flow search.
  11828. * This value should be equal to LSB four bits of the hash value
  11829. * of match data, in case of search index points to an entry which
  11830. * may be used in content based search also. The value can be
  11831. * anything when the entry pointed by search index will not be
  11832. * used for content based search.
  11833. *
  11834. * - htt_tlv_hdr_t
  11835. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11836. *
  11837. * Bits 11:0
  11838. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11839. *
  11840. * Bits 23:12
  11841. * Purpose: Length, Length of the value that follows the header
  11842. *
  11843. * Bits 31:28
  11844. * Purpose: Reserved.
  11845. *
  11846. *
  11847. * - SW_PEER_ID
  11848. * Bits 15:0
  11849. * Purpose: The peer ID (index) that WAL is allocating
  11850. * Value: (rx) peer ID
  11851. *
  11852. * - VDEV_ID
  11853. * Bits 23:16
  11854. * Purpose: Indicates which virtual device the peer is associated with.
  11855. * Value: vdev ID (used in the host to look up the vdev object)
  11856. *
  11857. * - CHIPID
  11858. * Bits 26:24
  11859. * Purpose: Indicates which Chip id the peer is associated with.
  11860. * Value: chip ID (Provided by Host as part of QMI exchange)
  11861. */
  11862. typedef enum {
  11863. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11864. } MLO_PEER_MAP_TLV_TAG_ID;
  11865. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11866. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11867. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11868. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11869. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11870. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11871. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11872. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11873. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11874. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11875. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11876. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11877. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11878. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11879. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11880. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11881. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11882. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11883. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11884. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11885. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11886. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11887. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11888. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11889. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11890. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11891. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11892. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11893. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11894. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11895. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11896. do { \
  11897. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11898. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11899. } while (0)
  11900. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11901. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11902. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11903. do { \
  11904. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11905. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11906. } while (0)
  11907. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11908. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11909. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11910. do { \
  11911. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11912. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11913. } while (0)
  11914. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11915. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11916. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11917. do { \
  11918. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11919. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11920. } while (0)
  11921. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11922. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11923. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11924. do { \
  11925. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11926. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11927. } while (0)
  11928. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11929. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11930. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11931. do { \
  11932. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11933. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11934. } while (0)
  11935. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11936. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11937. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11938. do { \
  11939. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11940. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11941. } while (0)
  11942. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11943. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11944. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11945. do { \
  11946. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11947. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11948. } while (0)
  11949. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11950. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11951. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11952. do { \
  11953. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11954. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11955. } while (0)
  11956. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11957. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11958. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11959. do { \
  11960. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11961. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11962. } while (0)
  11963. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11964. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11965. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11966. do { \
  11967. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11968. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11969. } while (0)
  11970. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11971. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11972. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11973. do { \
  11974. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11975. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11976. } while (0)
  11977. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11978. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11979. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11980. do { \
  11981. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11982. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11983. } while (0)
  11984. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11985. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11986. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11987. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11988. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11989. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11990. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11991. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11992. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11993. *
  11994. * The following diagram shows the format of the rx mlo peer unmap message sent
  11995. * from the target to the host.
  11996. *
  11997. * |31 24|23 16|15 8|7 0|
  11998. * |-----------------------------------------------------------------------|
  11999. * | RSVD_24_31 | MLO peer ID | msg type |
  12000. * |-----------------------------------------------------------------------|
  12001. */
  12002. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12003. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12004. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12005. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12006. /**
  12007. * @brief target -> host message specifying security parameters
  12008. *
  12009. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12010. *
  12011. * @details
  12012. * The following diagram shows the format of the security specification
  12013. * message sent from the target to the host.
  12014. * This security specification message tells the host whether a PN check is
  12015. * necessary on rx data frames, and if so, how large the PN counter is.
  12016. * This message also tells the host about the security processing to apply
  12017. * to defragmented rx frames - specifically, whether a Message Integrity
  12018. * Check is required, and the Michael key to use.
  12019. *
  12020. * |31 24|23 16|15|14 8|7 0|
  12021. * |-----------------------------------------------------------------------|
  12022. * | peer ID | U| security type | msg type |
  12023. * |-----------------------------------------------------------------------|
  12024. * | Michael Key K0 |
  12025. * |-----------------------------------------------------------------------|
  12026. * | Michael Key K1 |
  12027. * |-----------------------------------------------------------------------|
  12028. * | WAPI RSC Low0 |
  12029. * |-----------------------------------------------------------------------|
  12030. * | WAPI RSC Low1 |
  12031. * |-----------------------------------------------------------------------|
  12032. * | WAPI RSC Hi0 |
  12033. * |-----------------------------------------------------------------------|
  12034. * | WAPI RSC Hi1 |
  12035. * |-----------------------------------------------------------------------|
  12036. *
  12037. * The following field definitions describe the format of the security
  12038. * indication message sent from the target to the host.
  12039. * - MSG_TYPE
  12040. * Bits 7:0
  12041. * Purpose: identifies this as a security specification message
  12042. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12043. * - SEC_TYPE
  12044. * Bits 14:8
  12045. * Purpose: specifies which type of security applies to the peer
  12046. * Value: htt_sec_type enum value
  12047. * - UNICAST
  12048. * Bit 15
  12049. * Purpose: whether this security is applied to unicast or multicast data
  12050. * Value: 1 -> unicast, 0 -> multicast
  12051. * - PEER_ID
  12052. * Bits 31:16
  12053. * Purpose: The ID number for the peer the security specification is for
  12054. * Value: peer ID
  12055. * - MICHAEL_KEY_K0
  12056. * Bits 31:0
  12057. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12058. * Value: Michael Key K0 (if security type is TKIP)
  12059. * - MICHAEL_KEY_K1
  12060. * Bits 31:0
  12061. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12062. * Value: Michael Key K1 (if security type is TKIP)
  12063. * - WAPI_RSC_LOW0
  12064. * Bits 31:0
  12065. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12066. * Value: WAPI RSC Low0 (if security type is WAPI)
  12067. * - WAPI_RSC_LOW1
  12068. * Bits 31:0
  12069. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12070. * Value: WAPI RSC Low1 (if security type is WAPI)
  12071. * - WAPI_RSC_HI0
  12072. * Bits 31:0
  12073. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12074. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12075. * - WAPI_RSC_HI1
  12076. * Bits 31:0
  12077. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12078. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12079. */
  12080. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12081. #define HTT_SEC_IND_SEC_TYPE_S 8
  12082. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12083. #define HTT_SEC_IND_UNICAST_S 15
  12084. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12085. #define HTT_SEC_IND_PEER_ID_S 16
  12086. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12087. do { \
  12088. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12089. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12090. } while (0)
  12091. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12092. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12093. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12094. do { \
  12095. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12096. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12097. } while (0)
  12098. #define HTT_SEC_IND_UNICAST_GET(word) \
  12099. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12100. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12101. do { \
  12102. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12103. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12104. } while (0)
  12105. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12106. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12107. #define HTT_SEC_IND_BYTES 28
  12108. /**
  12109. * @brief target -> host rx ADDBA / DELBA message definitions
  12110. *
  12111. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12112. *
  12113. * @details
  12114. * The following diagram shows the format of the rx ADDBA message sent
  12115. * from the target to the host:
  12116. *
  12117. * |31 20|19 16|15 8|7 0|
  12118. * |---------------------------------------------------------------------|
  12119. * | peer ID | TID | window size | msg type |
  12120. * |---------------------------------------------------------------------|
  12121. *
  12122. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12123. *
  12124. * The following diagram shows the format of the rx DELBA message sent
  12125. * from the target to the host:
  12126. *
  12127. * |31 20|19 16|15 10|9 8|7 0|
  12128. * |---------------------------------------------------------------------|
  12129. * | peer ID | TID | window size | IR| msg type |
  12130. * |---------------------------------------------------------------------|
  12131. *
  12132. * The following field definitions describe the format of the rx ADDBA
  12133. * and DELBA messages sent from the target to the host.
  12134. * - MSG_TYPE
  12135. * Bits 7:0
  12136. * Purpose: identifies this as an rx ADDBA or DELBA message
  12137. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12138. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12139. * - IR (initiator / recipient)
  12140. * Bits 9:8 (DELBA only)
  12141. * Purpose: specify whether the DELBA handshake was initiated by the
  12142. * local STA/AP, or by the peer STA/AP
  12143. * Value:
  12144. * 0 - unspecified
  12145. * 1 - initiator (a.k.a. originator)
  12146. * 2 - recipient (a.k.a. responder)
  12147. * 3 - unused / reserved
  12148. * - WIN_SIZE
  12149. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12150. * Purpose: Specifies the length of the block ack window (max = 64).
  12151. * Value:
  12152. * block ack window length specified by the received ADDBA/DELBA
  12153. * management message.
  12154. * - TID
  12155. * Bits 19:16
  12156. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12157. * Value:
  12158. * TID specified by the received ADDBA or DELBA management message.
  12159. * - PEER_ID
  12160. * Bits 31:20
  12161. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12162. * Value:
  12163. * ID (hash value) used by the host for fast, direct lookup of
  12164. * host SW peer info, including rx reorder states.
  12165. */
  12166. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12167. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12168. #define HTT_RX_ADDBA_TID_M 0xf0000
  12169. #define HTT_RX_ADDBA_TID_S 16
  12170. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12171. #define HTT_RX_ADDBA_PEER_ID_S 20
  12172. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12173. do { \
  12174. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12175. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12176. } while (0)
  12177. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12178. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12179. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12180. do { \
  12181. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12182. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12183. } while (0)
  12184. #define HTT_RX_ADDBA_TID_GET(word) \
  12185. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12186. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12187. do { \
  12188. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12189. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12190. } while (0)
  12191. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12192. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12193. #define HTT_RX_ADDBA_BYTES 4
  12194. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12195. #define HTT_RX_DELBA_INITIATOR_S 8
  12196. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12197. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12198. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12199. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12200. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12201. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12202. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12203. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12204. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12205. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12206. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12207. do { \
  12208. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12209. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12210. } while (0)
  12211. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12212. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12213. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12214. do { \
  12215. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12216. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12217. } while (0)
  12218. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12219. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12220. #define HTT_RX_DELBA_BYTES 4
  12221. /**
  12222. * @brief target -> host rx ADDBA / DELBA message definitions
  12223. *
  12224. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12225. *
  12226. * @details
  12227. * The following diagram shows the format of the rx ADDBA extn message sent
  12228. * from the target to the host:
  12229. *
  12230. * |31 20|19 16|15 13|12 8|7 0|
  12231. * |---------------------------------------------------------------------|
  12232. * | peer ID | TID | reserved | msg type |
  12233. * |---------------------------------------------------------------------|
  12234. * | reserved | window size |
  12235. * |---------------------------------------------------------------------|
  12236. *
  12237. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12238. *
  12239. * The following diagram shows the format of the rx DELBA message sent
  12240. * from the target to the host:
  12241. *
  12242. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12243. * |---------------------------------------------------------------------|
  12244. * | peer ID | TID | reserved | IR| msg type |
  12245. * |---------------------------------------------------------------------|
  12246. * | reserved | window size |
  12247. * |---------------------------------------------------------------------|
  12248. *
  12249. * The following field definitions describe the format of the rx ADDBA
  12250. * and DELBA messages sent from the target to the host.
  12251. * - MSG_TYPE
  12252. * Bits 7:0
  12253. * Purpose: identifies this as an rx ADDBA or DELBA message
  12254. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12255. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12256. * - IR (initiator / recipient)
  12257. * Bits 9:8 (DELBA only)
  12258. * Purpose: specify whether the DELBA handshake was initiated by the
  12259. * local STA/AP, or by the peer STA/AP
  12260. * Value:
  12261. * 0 - unspecified
  12262. * 1 - initiator (a.k.a. originator)
  12263. * 2 - recipient (a.k.a. responder)
  12264. * 3 - unused / reserved
  12265. * Value:
  12266. * block ack window length specified by the received ADDBA/DELBA
  12267. * management message.
  12268. * - TID
  12269. * Bits 19:16
  12270. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12271. * Value:
  12272. * TID specified by the received ADDBA or DELBA management message.
  12273. * - PEER_ID
  12274. * Bits 31:20
  12275. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12276. * Value:
  12277. * ID (hash value) used by the host for fast, direct lookup of
  12278. * host SW peer info, including rx reorder states.
  12279. * == DWORD 1
  12280. * - WIN_SIZE
  12281. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12282. * Purpose: Specifies the length of the block ack window (max = 8191).
  12283. */
  12284. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12285. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12286. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12287. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12288. /*--- Dword 0 ---*/
  12289. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12290. do { \
  12291. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12292. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12293. } while (0)
  12294. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12295. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12296. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12297. do { \
  12298. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12299. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12300. } while (0)
  12301. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12302. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12303. /*--- Dword 1 ---*/
  12304. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12305. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12306. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12307. do { \
  12308. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12309. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12310. } while (0)
  12311. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12312. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12313. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12314. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12315. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12316. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12317. #define HTT_RX_DELBA_EXTN_TID_S 16
  12318. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12319. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12320. /*--- Dword 0 ---*/
  12321. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12322. do { \
  12323. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12324. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12325. } while (0)
  12326. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12327. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12328. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12329. do { \
  12330. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12331. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12332. } while (0)
  12333. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12334. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12335. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12336. do { \
  12337. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12338. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12339. } while (0)
  12340. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12341. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12342. /*--- Dword 1 ---*/
  12343. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12344. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12345. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12346. do { \
  12347. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12348. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12349. } while (0)
  12350. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12351. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12352. #define HTT_RX_DELBA_EXTN_BYTES 8
  12353. /**
  12354. * @brief tx queue group information element definition
  12355. *
  12356. * @details
  12357. * The following diagram shows the format of the tx queue group
  12358. * information element, which can be included in target --> host
  12359. * messages to specify the number of tx "credits" (tx descriptors
  12360. * for LL, or tx buffers for HL) available to a particular group
  12361. * of host-side tx queues, and which host-side tx queues belong to
  12362. * the group.
  12363. *
  12364. * |31|30 24|23 16|15|14|13 0|
  12365. * |------------------------------------------------------------------------|
  12366. * | X| reserved | tx queue grp ID | A| S| credit count |
  12367. * |------------------------------------------------------------------------|
  12368. * | vdev ID mask | AC mask |
  12369. * |------------------------------------------------------------------------|
  12370. *
  12371. * The following definitions describe the fields within the tx queue group
  12372. * information element:
  12373. * - credit_count
  12374. * Bits 13:1
  12375. * Purpose: specify how many tx credits are available to the tx queue group
  12376. * Value: An absolute or relative, positive or negative credit value
  12377. * The 'A' bit specifies whether the value is absolute or relative.
  12378. * The 'S' bit specifies whether the value is positive or negative.
  12379. * A negative value can only be relative, not absolute.
  12380. * An absolute value replaces any prior credit value the host has for
  12381. * the tx queue group in question.
  12382. * A relative value is added to the prior credit value the host has for
  12383. * the tx queue group in question.
  12384. * - sign
  12385. * Bit 14
  12386. * Purpose: specify whether the credit count is positive or negative
  12387. * Value: 0 -> positive, 1 -> negative
  12388. * - absolute
  12389. * Bit 15
  12390. * Purpose: specify whether the credit count is absolute or relative
  12391. * Value: 0 -> relative, 1 -> absolute
  12392. * - txq_group_id
  12393. * Bits 23:16
  12394. * Purpose: indicate which tx queue group's credit and/or membership are
  12395. * being specified
  12396. * Value: 0 to max_tx_queue_groups-1
  12397. * - reserved
  12398. * Bits 30:16
  12399. * Value: 0x0
  12400. * - eXtension
  12401. * Bit 31
  12402. * Purpose: specify whether another tx queue group info element follows
  12403. * Value: 0 -> no more tx queue group information elements
  12404. * 1 -> another tx queue group information element immediately follows
  12405. * - ac_mask
  12406. * Bits 15:0
  12407. * Purpose: specify which Access Categories belong to the tx queue group
  12408. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12409. * the tx queue group.
  12410. * The AC bit-mask values are obtained by left-shifting by the
  12411. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12412. * - vdev_id_mask
  12413. * Bits 31:16
  12414. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12415. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12416. * belong to the tx queue group.
  12417. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12418. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12419. */
  12420. PREPACK struct htt_txq_group {
  12421. A_UINT32
  12422. credit_count: 14,
  12423. sign: 1,
  12424. absolute: 1,
  12425. tx_queue_group_id: 8,
  12426. reserved0: 7,
  12427. extension: 1;
  12428. A_UINT32
  12429. ac_mask: 16,
  12430. vdev_id_mask: 16;
  12431. } POSTPACK;
  12432. /* first word */
  12433. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12434. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12435. #define HTT_TXQ_GROUP_SIGN_S 14
  12436. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12437. #define HTT_TXQ_GROUP_ABS_S 15
  12438. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12439. #define HTT_TXQ_GROUP_ID_S 16
  12440. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12441. #define HTT_TXQ_GROUP_EXT_S 31
  12442. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12443. /* second word */
  12444. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12445. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12446. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12447. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12448. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12451. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12452. } while (0)
  12453. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12454. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12455. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12458. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12459. } while (0)
  12460. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12461. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12462. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12465. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12466. } while (0)
  12467. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12468. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12469. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12470. do { \
  12471. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12472. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12473. } while (0)
  12474. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12475. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12476. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12477. do { \
  12478. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12479. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12480. } while (0)
  12481. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12482. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12483. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12484. do { \
  12485. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12486. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12487. } while (0)
  12488. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12489. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12490. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12491. do { \
  12492. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12493. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12494. } while (0)
  12495. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12496. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12497. /**
  12498. * @brief target -> host TX completion indication message definition
  12499. *
  12500. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12501. *
  12502. * @details
  12503. * The following diagram shows the format of the TX completion indication sent
  12504. * from the target to the host
  12505. *
  12506. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12507. * |-------------------------------------------------------------------|
  12508. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12509. * |-------------------------------------------------------------------|
  12510. * payload:| MSDU1 ID | MSDU0 ID |
  12511. * |-------------------------------------------------------------------|
  12512. * : MSDU3 ID | MSDU2 ID :
  12513. * |-------------------------------------------------------------------|
  12514. * | struct htt_tx_compl_ind_append_retries |
  12515. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12516. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12517. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12518. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12519. * |-------------------------------------------------------------------|
  12520. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12521. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12522. * | MSDU0 tx_tsf64_low |
  12523. * |-------------------------------------------------------------------|
  12524. * | MSDU0 tx_tsf64_high |
  12525. * |-------------------------------------------------------------------|
  12526. * | MSDU1 tx_tsf64_low |
  12527. * |-------------------------------------------------------------------|
  12528. * | MSDU1 tx_tsf64_high |
  12529. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12530. * | phy_timestamp |
  12531. * |-------------------------------------------------------------------|
  12532. * | rate specs (see below) |
  12533. * |-------------------------------------------------------------------|
  12534. * | seqctrl | framectrl |
  12535. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12536. * Where:
  12537. * A0 = append (a.k.a. append0)
  12538. * A1 = append1
  12539. * TP = MSDU tx power presence
  12540. * A2 = append2
  12541. * A3 = append3
  12542. * A4 = append4
  12543. *
  12544. * The following field definitions describe the format of the TX completion
  12545. * indication sent from the target to the host
  12546. * Header fields:
  12547. * - msg_type
  12548. * Bits 7:0
  12549. * Purpose: identifies this as HTT TX completion indication
  12550. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12551. * - status
  12552. * Bits 10:8
  12553. * Purpose: the TX completion status of payload fragmentations descriptors
  12554. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12555. * - tid
  12556. * Bits 14:11
  12557. * Purpose: the tid associated with those fragmentation descriptors. It is
  12558. * valid or not, depending on the tid_invalid bit.
  12559. * Value: 0 to 15
  12560. * - tid_invalid
  12561. * Bits 15:15
  12562. * Purpose: this bit indicates whether the tid field is valid or not
  12563. * Value: 0 indicates valid; 1 indicates invalid
  12564. * - num
  12565. * Bits 23:16
  12566. * Purpose: the number of payload in this indication
  12567. * Value: 1 to 255
  12568. * - append (a.k.a. append0)
  12569. * Bits 24:24
  12570. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12571. * the number of tx retries for one MSDU at the end of this message
  12572. * Value: 0 indicates no appending; 1 indicates appending
  12573. * - append1
  12574. * Bits 25:25
  12575. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12576. * contains the timestamp info for each TX msdu id in payload.
  12577. * The order of the timestamps matches the order of the MSDU IDs.
  12578. * Note that a big-endian host needs to account for the reordering
  12579. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12580. * conversion) when determining which tx timestamp corresponds to
  12581. * which MSDU ID.
  12582. * Value: 0 indicates no appending; 1 indicates appending
  12583. * - msdu_tx_power_presence
  12584. * Bits 26:26
  12585. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12586. * for each MSDU referenced by the TX_COMPL_IND message.
  12587. * The tx power is reported in 0.5 dBm units.
  12588. * The order of the per-MSDU tx power reports matches the order
  12589. * of the MSDU IDs.
  12590. * Note that a big-endian host needs to account for the reordering
  12591. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12592. * conversion) when determining which Tx Power corresponds to
  12593. * which MSDU ID.
  12594. * Value: 0 indicates MSDU tx power reports are not appended,
  12595. * 1 indicates MSDU tx power reports are appended
  12596. * - append2
  12597. * Bits 27:27
  12598. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12599. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12600. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12601. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  12602. * for each MSDU, for convenience.
  12603. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12604. * this append2 bit is set).
  12605. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12606. * dB above the noise floor.
  12607. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12608. * 1 indicates MSDU ACK RSSI values are appended.
  12609. * - append3
  12610. * Bits 28:28
  12611. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12612. * contains the tx tsf info based on wlan global TSF for
  12613. * each TX msdu id in payload.
  12614. * The order of the tx tsf matches the order of the MSDU IDs.
  12615. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12616. * values to indicate the the lower 32 bits and higher 32 bits of
  12617. * the tx tsf.
  12618. * The tx_tsf64 here represents the time MSDU was acked and the
  12619. * tx_tsf64 has microseconds units.
  12620. * Value: 0 indicates no appending; 1 indicates appending
  12621. * - append4
  12622. * Bits 29:29
  12623. * Purpose: Indicate whether data frame control fields and fields required
  12624. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12625. * message. The order of the this message matches the order of
  12626. * the MSDU IDs.
  12627. * Value: 0 indicates frame control fields and fields required for
  12628. * radio tap header values are not appended,
  12629. * 1 indicates frame control fields and fields required for
  12630. * radio tap header values are appended.
  12631. * Payload fields:
  12632. * - hmsdu_id
  12633. * Bits 15:0
  12634. * Purpose: this ID is used to track the Tx buffer in host
  12635. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12636. */
  12637. PREPACK struct htt_tx_data_hdr_information {
  12638. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12639. A_UINT32 /* word 1 */
  12640. /* preamble:
  12641. * 0-OFDM,
  12642. * 1-CCk,
  12643. * 2-HT,
  12644. * 3-VHT
  12645. */
  12646. preamble: 2, /* [1:0] */
  12647. /* mcs:
  12648. * In case of HT preamble interpret
  12649. * MCS along with NSS.
  12650. * Valid values for HT are 0 to 7.
  12651. * HT mcs 0 with NSS 2 is mcs 8.
  12652. * Valid values for VHT are 0 to 9.
  12653. */
  12654. mcs: 4, /* [5:2] */
  12655. /* rate:
  12656. * This is applicable only for
  12657. * CCK and OFDM preamble type
  12658. * rate 0: OFDM 48 Mbps,
  12659. * 1: OFDM 24 Mbps,
  12660. * 2: OFDM 12 Mbps
  12661. * 3: OFDM 6 Mbps
  12662. * 4: OFDM 54 Mbps
  12663. * 5: OFDM 36 Mbps
  12664. * 6: OFDM 18 Mbps
  12665. * 7: OFDM 9 Mbps
  12666. * rate 0: CCK 11 Mbps Long
  12667. * 1: CCK 5.5 Mbps Long
  12668. * 2: CCK 2 Mbps Long
  12669. * 3: CCK 1 Mbps Long
  12670. * 4: CCK 11 Mbps Short
  12671. * 5: CCK 5.5 Mbps Short
  12672. * 6: CCK 2 Mbps Short
  12673. */
  12674. rate : 3, /* [ 8: 6] */
  12675. rssi : 8, /* [16: 9] units=dBm */
  12676. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12677. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12678. stbc : 1, /* [22] */
  12679. sgi : 1, /* [23] */
  12680. ldpc : 1, /* [24] */
  12681. beamformed: 1, /* [25] */
  12682. /* tx_retry_cnt:
  12683. * Indicates retry count of data tx frames provided by the host.
  12684. */
  12685. tx_retry_cnt: 6; /* [31:26] */
  12686. A_UINT32 /* word 2 */
  12687. framectrl:16, /* [15: 0] */
  12688. seqno:16; /* [31:16] */
  12689. } POSTPACK;
  12690. #define HTT_TX_COMPL_IND_STATUS_S 8
  12691. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12692. #define HTT_TX_COMPL_IND_TID_S 11
  12693. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12694. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12695. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12696. #define HTT_TX_COMPL_IND_NUM_S 16
  12697. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12698. #define HTT_TX_COMPL_IND_APPEND_S 24
  12699. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12700. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12701. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12702. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12703. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12704. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12705. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12706. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12707. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12708. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12709. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12710. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12711. do { \
  12712. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12713. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12714. } while (0)
  12715. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12716. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12717. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12718. do { \
  12719. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12720. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12721. } while (0)
  12722. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12723. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12724. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12725. do { \
  12726. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12727. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12728. } while (0)
  12729. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12730. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12731. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12732. do { \
  12733. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12734. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12735. } while (0)
  12736. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12737. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12738. HTT_TX_COMPL_IND_TID_INV_S)
  12739. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12740. do { \
  12741. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12742. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12743. } while (0)
  12744. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12745. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12746. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12747. do { \
  12748. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12749. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12750. } while (0)
  12751. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12752. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12753. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12754. do { \
  12755. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12756. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12757. } while (0)
  12758. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12759. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12760. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12761. do { \
  12762. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12763. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12764. } while (0)
  12765. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12766. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12767. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12768. do { \
  12769. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12770. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12771. } while (0)
  12772. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12773. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12774. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12775. do { \
  12776. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12777. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12778. } while (0)
  12779. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12780. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12781. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12782. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12783. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12784. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12785. #define HTT_TX_COMPL_IND_STAT_OK 0
  12786. /* DISCARD:
  12787. * current meaning:
  12788. * MSDUs were queued for transmission but filtered by HW or SW
  12789. * without any over the air attempts
  12790. * legacy meaning (HL Rome):
  12791. * MSDUs were discarded by the target FW without any over the air
  12792. * attempts due to lack of space
  12793. */
  12794. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12795. /* NO_ACK:
  12796. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12797. */
  12798. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12799. /* POSTPONE:
  12800. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12801. * be downloaded again later (in the appropriate order), when they are
  12802. * deliverable.
  12803. */
  12804. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12805. /*
  12806. * The PEER_DEL tx completion status is used for HL cases
  12807. * where the peer the frame is for has been deleted.
  12808. * The host has already discarded its copy of the frame, but
  12809. * it still needs the tx completion to restore its credit.
  12810. */
  12811. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12812. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12813. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12814. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12815. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12816. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12817. PREPACK struct htt_tx_compl_ind_base {
  12818. A_UINT32 hdr;
  12819. A_UINT16 payload[1/*or more*/];
  12820. } POSTPACK;
  12821. PREPACK struct htt_tx_compl_ind_append_retries {
  12822. A_UINT16 msdu_id;
  12823. A_UINT8 tx_retries;
  12824. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12825. 0: this is the last append_retries struct */
  12826. } POSTPACK;
  12827. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12828. A_UINT32 timestamp[1/*or more*/];
  12829. } POSTPACK;
  12830. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12831. A_UINT32 tx_tsf64_low;
  12832. A_UINT32 tx_tsf64_high;
  12833. } POSTPACK;
  12834. /* htt_tx_data_hdr_information payload extension fields: */
  12835. /* DWORD zero */
  12836. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12837. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12838. /* DWORD one */
  12839. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12840. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12841. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12842. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12843. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12844. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12845. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12846. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12847. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12848. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12849. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12850. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12851. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12852. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12853. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12854. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12855. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12856. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12857. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12858. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12859. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12860. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12861. /* DWORD two */
  12862. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12863. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12864. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12865. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12866. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12867. do { \
  12868. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12869. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12870. } while (0)
  12871. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12872. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12873. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12874. do { \
  12875. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12876. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12877. } while (0)
  12878. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12879. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12880. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12881. do { \
  12882. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12883. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12884. } while (0)
  12885. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12886. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12887. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12888. do { \
  12889. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12890. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12891. } while (0)
  12892. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12893. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12894. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12895. do { \
  12896. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12897. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12898. } while (0)
  12899. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12900. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12901. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12902. do { \
  12903. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12904. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12905. } while (0)
  12906. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12907. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12908. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12909. do { \
  12910. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12911. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12912. } while (0)
  12913. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12914. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12915. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12916. do { \
  12917. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12918. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12919. } while (0)
  12920. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12921. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12922. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12923. do { \
  12924. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12925. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12926. } while (0)
  12927. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12928. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12929. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12930. do { \
  12931. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12932. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12933. } while (0)
  12934. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12935. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12936. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12937. do { \
  12938. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12939. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12940. } while (0)
  12941. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12942. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12943. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12944. do { \
  12945. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12946. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12947. } while (0)
  12948. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12949. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12950. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12951. do { \
  12952. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12953. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12954. } while (0)
  12955. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12956. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12957. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12958. do { \
  12959. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12960. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12961. } while (0)
  12962. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12963. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12964. /**
  12965. * @brief target -> host rate-control update indication message
  12966. *
  12967. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12968. *
  12969. * @details
  12970. * The following diagram shows the format of the RC Update message
  12971. * sent from the target to the host, while processing the tx-completion
  12972. * of a transmitted PPDU.
  12973. *
  12974. * |31 24|23 16|15 8|7 0|
  12975. * |-------------------------------------------------------------|
  12976. * | peer ID | vdev ID | msg_type |
  12977. * |-------------------------------------------------------------|
  12978. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12979. * |-------------------------------------------------------------|
  12980. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12981. * |-------------------------------------------------------------|
  12982. * | : |
  12983. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12984. * | : |
  12985. * |-------------------------------------------------------------|
  12986. * | : |
  12987. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12988. * | : |
  12989. * |-------------------------------------------------------------|
  12990. * : :
  12991. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12992. *
  12993. */
  12994. typedef struct {
  12995. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12996. A_UINT32 rate_code_flags;
  12997. A_UINT32 flags; /* Encodes information such as excessive
  12998. retransmission, aggregate, some info
  12999. from .11 frame control,
  13000. STBC, LDPC, (SGI and Tx Chain Mask
  13001. are encoded in ptx_rc->flags field),
  13002. AMPDU truncation (BT/time based etc.),
  13003. RTS/CTS attempt */
  13004. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13005. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13006. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13007. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13008. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13009. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13010. } HTT_RC_TX_DONE_PARAMS;
  13011. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13012. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13013. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13014. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13015. #define HTT_RC_UPDATE_VDEVID_S 8
  13016. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13017. #define HTT_RC_UPDATE_PEERID_S 16
  13018. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13019. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13020. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13021. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13022. do { \
  13023. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13024. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13025. } while (0)
  13026. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13027. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13028. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13029. do { \
  13030. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13031. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13032. } while (0)
  13033. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13034. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13035. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13036. do { \
  13037. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13038. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13039. } while (0)
  13040. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13041. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13042. /**
  13043. * @brief target -> host rx fragment indication message definition
  13044. *
  13045. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13046. *
  13047. * @details
  13048. * The following field definitions describe the format of the rx fragment
  13049. * indication message sent from the target to the host.
  13050. * The rx fragment indication message shares the format of the
  13051. * rx indication message, but not all fields from the rx indication message
  13052. * are relevant to the rx fragment indication message.
  13053. *
  13054. *
  13055. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13056. * |-----------+-------------------+---------------------+-------------|
  13057. * | peer ID | |FV| ext TID | msg type |
  13058. * |-------------------------------------------------------------------|
  13059. * | | flush | flush |
  13060. * | | end | start |
  13061. * | | seq num | seq num |
  13062. * |-------------------------------------------------------------------|
  13063. * | reserved | FW rx desc bytes |
  13064. * |-------------------------------------------------------------------|
  13065. * | | FW MSDU Rx |
  13066. * | | desc B0 |
  13067. * |-------------------------------------------------------------------|
  13068. * Header fields:
  13069. * - MSG_TYPE
  13070. * Bits 7:0
  13071. * Purpose: identifies this as an rx fragment indication message
  13072. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13073. * - EXT_TID
  13074. * Bits 12:8
  13075. * Purpose: identify the traffic ID of the rx data, including
  13076. * special "extended" TID values for multicast, broadcast, and
  13077. * non-QoS data frames
  13078. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13079. * - FLUSH_VALID (FV)
  13080. * Bit 13
  13081. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13082. * is valid
  13083. * Value:
  13084. * 1 -> flush IE is valid and needs to be processed
  13085. * 0 -> flush IE is not valid and should be ignored
  13086. * - PEER_ID
  13087. * Bits 31:16
  13088. * Purpose: Identify, by ID, which peer sent the rx data
  13089. * Value: ID of the peer who sent the rx data
  13090. * - FLUSH_SEQ_NUM_START
  13091. * Bits 5:0
  13092. * Purpose: Indicate the start of a series of MPDUs to flush
  13093. * Not all MPDUs within this series are necessarily valid - the host
  13094. * must check each sequence number within this range to see if the
  13095. * corresponding MPDU is actually present.
  13096. * This field is only valid if the FV bit is set.
  13097. * Value:
  13098. * The sequence number for the first MPDUs to check to flush.
  13099. * The sequence number is masked by 0x3f.
  13100. * - FLUSH_SEQ_NUM_END
  13101. * Bits 11:6
  13102. * Purpose: Indicate the end of a series of MPDUs to flush
  13103. * Value:
  13104. * The sequence number one larger than the sequence number of the
  13105. * last MPDU to check to flush.
  13106. * The sequence number is masked by 0x3f.
  13107. * Not all MPDUs within this series are necessarily valid - the host
  13108. * must check each sequence number within this range to see if the
  13109. * corresponding MPDU is actually present.
  13110. * This field is only valid if the FV bit is set.
  13111. * Rx descriptor fields:
  13112. * - FW_RX_DESC_BYTES
  13113. * Bits 15:0
  13114. * Purpose: Indicate how many bytes in the Rx indication are used for
  13115. * FW Rx descriptors
  13116. * Value: 1
  13117. */
  13118. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13119. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13120. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13121. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13122. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13123. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13124. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13125. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13126. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13127. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13128. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13129. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13130. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13131. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13132. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13133. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13134. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13135. #define HTT_RX_FRAG_IND_BYTES \
  13136. (4 /* msg hdr */ + \
  13137. 4 /* flush spec */ + \
  13138. 4 /* (unused) FW rx desc bytes spec */ + \
  13139. 4 /* FW rx desc */)
  13140. /**
  13141. * @brief target -> host test message definition
  13142. *
  13143. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13144. *
  13145. * @details
  13146. * The following field definitions describe the format of the test
  13147. * message sent from the target to the host.
  13148. * The message consists of a 4-octet header, followed by a variable
  13149. * number of 32-bit integer values, followed by a variable number
  13150. * of 8-bit character values.
  13151. *
  13152. * |31 16|15 8|7 0|
  13153. * |-----------------------------------------------------------|
  13154. * | num chars | num ints | msg type |
  13155. * |-----------------------------------------------------------|
  13156. * | int 0 |
  13157. * |-----------------------------------------------------------|
  13158. * | int 1 |
  13159. * |-----------------------------------------------------------|
  13160. * | ... |
  13161. * |-----------------------------------------------------------|
  13162. * | char 3 | char 2 | char 1 | char 0 |
  13163. * |-----------------------------------------------------------|
  13164. * | | | ... | char 4 |
  13165. * |-----------------------------------------------------------|
  13166. * - MSG_TYPE
  13167. * Bits 7:0
  13168. * Purpose: identifies this as a test message
  13169. * Value: HTT_MSG_TYPE_TEST
  13170. * - NUM_INTS
  13171. * Bits 15:8
  13172. * Purpose: indicate how many 32-bit integers follow the message header
  13173. * - NUM_CHARS
  13174. * Bits 31:16
  13175. * Purpose: indicate how many 8-bit characters follow the series of integers
  13176. */
  13177. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13178. #define HTT_RX_TEST_NUM_INTS_S 8
  13179. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13180. #define HTT_RX_TEST_NUM_CHARS_S 16
  13181. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13182. do { \
  13183. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13184. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13185. } while (0)
  13186. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13187. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13188. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13189. do { \
  13190. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13191. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13192. } while (0)
  13193. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13194. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13195. /**
  13196. * @brief target -> host packet log message
  13197. *
  13198. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13199. *
  13200. * @details
  13201. * The following field definitions describe the format of the packet log
  13202. * message sent from the target to the host.
  13203. * The message consists of a 4-octet header,followed by a variable number
  13204. * of 32-bit character values.
  13205. *
  13206. * |31 16|15 12|11 10|9 8|7 0|
  13207. * |------------------------------------------------------------------|
  13208. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13209. * |------------------------------------------------------------------|
  13210. * | payload |
  13211. * |------------------------------------------------------------------|
  13212. * - MSG_TYPE
  13213. * Bits 7:0
  13214. * Purpose: identifies this as a pktlog message
  13215. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13216. * - mac_id
  13217. * Bits 9:8
  13218. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13219. * Value: 0-3
  13220. * - pdev_id
  13221. * Bits 11:10
  13222. * Purpose: pdev_id
  13223. * Value: 0-3
  13224. * 0 (for rings at SOC level),
  13225. * 1/2/3 PDEV -> 0/1/2
  13226. * - payload_size
  13227. * Bits 31:16
  13228. * Purpose: explicitly specify the payload size
  13229. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13230. */
  13231. PREPACK struct htt_pktlog_msg {
  13232. A_UINT32 header;
  13233. A_UINT32 payload[1/* or more */];
  13234. } POSTPACK;
  13235. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13236. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13237. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13238. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13239. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13240. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13241. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13242. do { \
  13243. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13244. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13245. } while (0)
  13246. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13247. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13248. HTT_T2H_PKTLOG_MAC_ID_S)
  13249. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13250. do { \
  13251. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13252. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13253. } while (0)
  13254. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13255. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13256. HTT_T2H_PKTLOG_PDEV_ID_S)
  13257. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13258. do { \
  13259. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13260. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13261. } while (0)
  13262. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13263. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13264. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13265. /*
  13266. * Rx reorder statistics
  13267. * NB: all the fields must be defined in 4 octets size.
  13268. */
  13269. struct rx_reorder_stats {
  13270. /* Non QoS MPDUs received */
  13271. A_UINT32 deliver_non_qos;
  13272. /* MPDUs received in-order */
  13273. A_UINT32 deliver_in_order;
  13274. /* Flush due to reorder timer expired */
  13275. A_UINT32 deliver_flush_timeout;
  13276. /* Flush due to move out of window */
  13277. A_UINT32 deliver_flush_oow;
  13278. /* Flush due to DELBA */
  13279. A_UINT32 deliver_flush_delba;
  13280. /* MPDUs dropped due to FCS error */
  13281. A_UINT32 fcs_error;
  13282. /* MPDUs dropped due to monitor mode non-data packet */
  13283. A_UINT32 mgmt_ctrl;
  13284. /* Unicast-data MPDUs dropped due to invalid peer */
  13285. A_UINT32 invalid_peer;
  13286. /* MPDUs dropped due to duplication (non aggregation) */
  13287. A_UINT32 dup_non_aggr;
  13288. /* MPDUs dropped due to processed before */
  13289. A_UINT32 dup_past;
  13290. /* MPDUs dropped due to duplicate in reorder queue */
  13291. A_UINT32 dup_in_reorder;
  13292. /* Reorder timeout happened */
  13293. A_UINT32 reorder_timeout;
  13294. /* invalid bar ssn */
  13295. A_UINT32 invalid_bar_ssn;
  13296. /* reorder reset due to bar ssn */
  13297. A_UINT32 ssn_reset;
  13298. /* Flush due to delete peer */
  13299. A_UINT32 deliver_flush_delpeer;
  13300. /* Flush due to offload*/
  13301. A_UINT32 deliver_flush_offload;
  13302. /* Flush due to out of buffer*/
  13303. A_UINT32 deliver_flush_oob;
  13304. /* MPDUs dropped due to PN check fail */
  13305. A_UINT32 pn_fail;
  13306. /* MPDUs dropped due to unable to allocate memory */
  13307. A_UINT32 store_fail;
  13308. /* Number of times the tid pool alloc succeeded */
  13309. A_UINT32 tid_pool_alloc_succ;
  13310. /* Number of times the MPDU pool alloc succeeded */
  13311. A_UINT32 mpdu_pool_alloc_succ;
  13312. /* Number of times the MSDU pool alloc succeeded */
  13313. A_UINT32 msdu_pool_alloc_succ;
  13314. /* Number of times the tid pool alloc failed */
  13315. A_UINT32 tid_pool_alloc_fail;
  13316. /* Number of times the MPDU pool alloc failed */
  13317. A_UINT32 mpdu_pool_alloc_fail;
  13318. /* Number of times the MSDU pool alloc failed */
  13319. A_UINT32 msdu_pool_alloc_fail;
  13320. /* Number of times the tid pool freed */
  13321. A_UINT32 tid_pool_free;
  13322. /* Number of times the MPDU pool freed */
  13323. A_UINT32 mpdu_pool_free;
  13324. /* Number of times the MSDU pool freed */
  13325. A_UINT32 msdu_pool_free;
  13326. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13327. A_UINT32 msdu_queued;
  13328. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13329. A_UINT32 msdu_recycled;
  13330. /* Number of MPDUs with invalid peer but A2 found in AST */
  13331. A_UINT32 invalid_peer_a2_in_ast;
  13332. /* Number of MPDUs with invalid peer but A3 found in AST */
  13333. A_UINT32 invalid_peer_a3_in_ast;
  13334. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13335. A_UINT32 invalid_peer_bmc_mpdus;
  13336. /* Number of MSDUs with err attention word */
  13337. A_UINT32 rxdesc_err_att;
  13338. /* Number of MSDUs with flag of peer_idx_invalid */
  13339. A_UINT32 rxdesc_err_peer_idx_inv;
  13340. /* Number of MSDUs with flag of peer_idx_timeout */
  13341. A_UINT32 rxdesc_err_peer_idx_to;
  13342. /* Number of MSDUs with flag of overflow */
  13343. A_UINT32 rxdesc_err_ov;
  13344. /* Number of MSDUs with flag of msdu_length_err */
  13345. A_UINT32 rxdesc_err_msdu_len;
  13346. /* Number of MSDUs with flag of mpdu_length_err */
  13347. A_UINT32 rxdesc_err_mpdu_len;
  13348. /* Number of MSDUs with flag of tkip_mic_err */
  13349. A_UINT32 rxdesc_err_tkip_mic;
  13350. /* Number of MSDUs with flag of decrypt_err */
  13351. A_UINT32 rxdesc_err_decrypt;
  13352. /* Number of MSDUs with flag of fcs_err */
  13353. A_UINT32 rxdesc_err_fcs;
  13354. /* Number of Unicast (bc_mc bit is not set in attention word)
  13355. * frames with invalid peer handler
  13356. */
  13357. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13358. /* Number of unicast frame directly (direct bit is set in attention word)
  13359. * to DUT with invalid peer handler
  13360. */
  13361. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13362. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13363. * frames with invalid peer handler
  13364. */
  13365. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13366. /* Number of MSDUs dropped due to no first MSDU flag */
  13367. A_UINT32 rxdesc_no_1st_msdu;
  13368. /* Number of MSDUs dropped due to ring overflow */
  13369. A_UINT32 msdu_drop_ring_ov;
  13370. /* Number of MSDUs dropped due to FC mismatch */
  13371. A_UINT32 msdu_drop_fc_mismatch;
  13372. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13373. A_UINT32 msdu_drop_mgmt_remote_ring;
  13374. /* Number of MSDUs dropped due to errors not reported in attention word */
  13375. A_UINT32 msdu_drop_misc;
  13376. /* Number of MSDUs go to offload before reorder */
  13377. A_UINT32 offload_msdu_wal;
  13378. /* Number of data frame dropped by offload after reorder */
  13379. A_UINT32 offload_msdu_reorder;
  13380. /* Number of MPDUs with sequence number in the past and within the BA window */
  13381. A_UINT32 dup_past_within_window;
  13382. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13383. A_UINT32 dup_past_outside_window;
  13384. /* Number of MSDUs with decrypt/MIC error */
  13385. A_UINT32 rxdesc_err_decrypt_mic;
  13386. /* Number of data MSDUs received on both local and remote rings */
  13387. A_UINT32 data_msdus_on_both_rings;
  13388. /* MPDUs never filled */
  13389. A_UINT32 holes_not_filled;
  13390. };
  13391. /*
  13392. * Rx Remote buffer statistics
  13393. * NB: all the fields must be defined in 4 octets size.
  13394. */
  13395. struct rx_remote_buffer_mgmt_stats {
  13396. /* Total number of MSDUs reaped for Rx processing */
  13397. A_UINT32 remote_reaped;
  13398. /* MSDUs recycled within firmware */
  13399. A_UINT32 remote_recycled;
  13400. /* MSDUs stored by Data Rx */
  13401. A_UINT32 data_rx_msdus_stored;
  13402. /* Number of HTT indications from WAL Rx MSDU */
  13403. A_UINT32 wal_rx_ind;
  13404. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13405. A_UINT32 wal_rx_ind_unconsumed;
  13406. /* Number of HTT indications from Data Rx MSDU */
  13407. A_UINT32 data_rx_ind;
  13408. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13409. A_UINT32 data_rx_ind_unconsumed;
  13410. /* Number of HTT indications from ATHBUF */
  13411. A_UINT32 athbuf_rx_ind;
  13412. /* Number of remote buffers requested for refill */
  13413. A_UINT32 refill_buf_req;
  13414. /* Number of remote buffers filled by the host */
  13415. A_UINT32 refill_buf_rsp;
  13416. /* Number of times MAC hw_index = f/w write_index */
  13417. A_INT32 mac_no_bufs;
  13418. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13419. A_INT32 fw_indices_equal;
  13420. /* Number of times f/w finds no buffers to post */
  13421. A_INT32 host_no_bufs;
  13422. };
  13423. /*
  13424. * TXBF MU/SU packets and NDPA statistics
  13425. * NB: all the fields must be defined in 4 octets size.
  13426. */
  13427. struct rx_txbf_musu_ndpa_pkts_stats {
  13428. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13429. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13430. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13431. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13432. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13433. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13434. };
  13435. /*
  13436. * htt_dbg_stats_status -
  13437. * present - The requested stats have been delivered in full.
  13438. * This indicates that either the stats information was contained
  13439. * in its entirety within this message, or else this message
  13440. * completes the delivery of the requested stats info that was
  13441. * partially delivered through earlier STATS_CONF messages.
  13442. * partial - The requested stats have been delivered in part.
  13443. * One or more subsequent STATS_CONF messages with the same
  13444. * cookie value will be sent to deliver the remainder of the
  13445. * information.
  13446. * error - The requested stats could not be delivered, for example due
  13447. * to a shortage of memory to construct a message holding the
  13448. * requested stats.
  13449. * invalid - The requested stat type is either not recognized, or the
  13450. * target is configured to not gather the stats type in question.
  13451. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13452. * series_done - This special value indicates that no further stats info
  13453. * elements are present within a series of stats info elems
  13454. * (within a stats upload confirmation message).
  13455. */
  13456. enum htt_dbg_stats_status {
  13457. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13458. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13459. HTT_DBG_STATS_STATUS_ERROR = 2,
  13460. HTT_DBG_STATS_STATUS_INVALID = 3,
  13461. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13462. };
  13463. /**
  13464. * @brief target -> host statistics upload
  13465. *
  13466. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13467. *
  13468. * @details
  13469. * The following field definitions describe the format of the HTT target
  13470. * to host stats upload confirmation message.
  13471. * The message contains a cookie echoed from the HTT host->target stats
  13472. * upload request, which identifies which request the confirmation is
  13473. * for, and a series of tag-length-value stats information elements.
  13474. * The tag-length header for each stats info element also includes a
  13475. * status field, to indicate whether the request for the stat type in
  13476. * question was fully met, partially met, unable to be met, or invalid
  13477. * (if the stat type in question is disabled in the target).
  13478. * A special value of all 1's in this status field is used to indicate
  13479. * the end of the series of stats info elements.
  13480. *
  13481. *
  13482. * |31 16|15 8|7 5|4 0|
  13483. * |------------------------------------------------------------|
  13484. * | reserved | msg type |
  13485. * |------------------------------------------------------------|
  13486. * | cookie LSBs |
  13487. * |------------------------------------------------------------|
  13488. * | cookie MSBs |
  13489. * |------------------------------------------------------------|
  13490. * | stats entry length | reserved | S |stat type|
  13491. * |------------------------------------------------------------|
  13492. * | |
  13493. * | type-specific stats info |
  13494. * | |
  13495. * |------------------------------------------------------------|
  13496. * | stats entry length | reserved | S |stat type|
  13497. * |------------------------------------------------------------|
  13498. * | |
  13499. * | type-specific stats info |
  13500. * | |
  13501. * |------------------------------------------------------------|
  13502. * | n/a | reserved | 111 | n/a |
  13503. * |------------------------------------------------------------|
  13504. * Header fields:
  13505. * - MSG_TYPE
  13506. * Bits 7:0
  13507. * Purpose: identifies this is a statistics upload confirmation message
  13508. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13509. * - COOKIE_LSBS
  13510. * Bits 31:0
  13511. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13512. * message with its preceding host->target stats request message.
  13513. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13514. * - COOKIE_MSBS
  13515. * Bits 31:0
  13516. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13517. * message with its preceding host->target stats request message.
  13518. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13519. *
  13520. * Stats Information Element tag-length header fields:
  13521. * - STAT_TYPE
  13522. * Bits 4:0
  13523. * Purpose: identifies the type of statistics info held in the
  13524. * following information element
  13525. * Value: htt_dbg_stats_type
  13526. * - STATUS
  13527. * Bits 7:5
  13528. * Purpose: indicate whether the requested stats are present
  13529. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13530. * the completion of the stats entry series
  13531. * - LENGTH
  13532. * Bits 31:16
  13533. * Purpose: indicate the stats information size
  13534. * Value: This field specifies the number of bytes of stats information
  13535. * that follows the element tag-length header.
  13536. * It is expected but not required that this length is a multiple of
  13537. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13538. * subsequent stats entry header will begin on a 4-byte aligned
  13539. * boundary.
  13540. */
  13541. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13542. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13543. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13544. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13545. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13546. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13547. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13548. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13549. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13550. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13551. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13552. do { \
  13553. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13554. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13555. } while (0)
  13556. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13557. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13558. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13559. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13560. do { \
  13561. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13562. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13563. } while (0)
  13564. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13565. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13566. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13567. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13568. do { \
  13569. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13570. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13571. } while (0)
  13572. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13573. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13574. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13575. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13576. #define HTT_MAX_AGGR 64
  13577. #define HTT_HL_MAX_AGGR 18
  13578. /**
  13579. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13580. *
  13581. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13582. *
  13583. * @details
  13584. * The following field definitions describe the format of the HTT host
  13585. * to target frag_desc/msdu_ext bank configuration message.
  13586. * The message contains the based address and the min and max id of the
  13587. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13588. * MSDU_EXT/FRAG_DESC.
  13589. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13590. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13591. * the hardware does the mapping/translation.
  13592. *
  13593. * Total banks that can be configured is configured to 16.
  13594. *
  13595. * This should be called before any TX has be initiated by the HTT
  13596. *
  13597. * |31 16|15 8|7 5|4 0|
  13598. * |------------------------------------------------------------|
  13599. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13600. * |------------------------------------------------------------|
  13601. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13602. #if HTT_PADDR64
  13603. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13604. #endif
  13605. * |------------------------------------------------------------|
  13606. * | ... |
  13607. * |------------------------------------------------------------|
  13608. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13609. #if HTT_PADDR64
  13610. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13611. #endif
  13612. * |------------------------------------------------------------|
  13613. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13614. * |------------------------------------------------------------|
  13615. * | ... |
  13616. * |------------------------------------------------------------|
  13617. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13618. * |------------------------------------------------------------|
  13619. * Header fields:
  13620. * - MSG_TYPE
  13621. * Bits 7:0
  13622. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13623. * for systems with 64-bit format for bus addresses:
  13624. * - BANKx_BASE_ADDRESS_LO
  13625. * Bits 31:0
  13626. * Purpose: Provide a mechanism to specify the base address of the
  13627. * MSDU_EXT bank physical/bus address.
  13628. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13629. * - BANKx_BASE_ADDRESS_HI
  13630. * Bits 31:0
  13631. * Purpose: Provide a mechanism to specify the base address of the
  13632. * MSDU_EXT bank physical/bus address.
  13633. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13634. * for systems with 32-bit format for bus addresses:
  13635. * - BANKx_BASE_ADDRESS
  13636. * Bits 31:0
  13637. * Purpose: Provide a mechanism to specify the base address of the
  13638. * MSDU_EXT bank physical/bus address.
  13639. * Value: MSDU_EXT bank physical / bus address
  13640. * - BANKx_MIN_ID
  13641. * Bits 15:0
  13642. * Purpose: Provide a mechanism to specify the min index that needs to
  13643. * mapped.
  13644. * - BANKx_MAX_ID
  13645. * Bits 31:16
  13646. * Purpose: Provide a mechanism to specify the max index that needs to
  13647. * mapped.
  13648. *
  13649. */
  13650. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13651. * safe value.
  13652. * @note MAX supported banks is 16.
  13653. */
  13654. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13655. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13656. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13657. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13658. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13659. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13660. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13661. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13662. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13663. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13664. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13665. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13666. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13667. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13668. do { \
  13669. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13670. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13671. } while (0)
  13672. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13673. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13674. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13675. do { \
  13676. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13677. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13678. } while (0)
  13679. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13680. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13681. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13682. do { \
  13683. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13684. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13685. } while (0)
  13686. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13687. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13688. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13689. do { \
  13690. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13691. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13692. } while (0)
  13693. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13694. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13695. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13696. do { \
  13697. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13698. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13699. } while (0)
  13700. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13701. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13702. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13703. do { \
  13704. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13705. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13706. } while (0)
  13707. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13708. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13709. /*
  13710. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13711. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13712. * addresses are stored in a XXX-bit field.
  13713. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13714. * htt_tx_frag_desc64_bank_cfg_t structs.
  13715. */
  13716. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13717. _paddr_bits_, \
  13718. _paddr__bank_base_address_) \
  13719. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13720. /** word 0 \
  13721. * msg_type: 8, \
  13722. * pdev_id: 2, \
  13723. * swap: 1, \
  13724. * reserved0: 5, \
  13725. * num_banks: 8, \
  13726. * desc_size: 8; \
  13727. */ \
  13728. A_UINT32 word0; \
  13729. /* \
  13730. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13731. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13732. * the second A_UINT32). \
  13733. */ \
  13734. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13735. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13736. } POSTPACK
  13737. /* define htt_tx_frag_desc32_bank_cfg_t */
  13738. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13739. /* define htt_tx_frag_desc64_bank_cfg_t */
  13740. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13741. /*
  13742. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13743. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13744. */
  13745. #if HTT_PADDR64
  13746. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13747. #else
  13748. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13749. #endif
  13750. /**
  13751. * @brief target -> host HTT TX Credit total count update message definition
  13752. *
  13753. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13754. *
  13755. *|31 16|15|14 9| 8 |7 0 |
  13756. *|---------------------+--+----------+-------+----------|
  13757. *|cur htt credit delta | Q| reserved | sign | msg type |
  13758. *|------------------------------------------------------|
  13759. *
  13760. * Header fields:
  13761. * - MSG_TYPE
  13762. * Bits 7:0
  13763. * Purpose: identifies this as a htt tx credit delta update message
  13764. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13765. * - SIGN
  13766. * Bits 8
  13767. * identifies whether credit delta is positive or negative
  13768. * Value:
  13769. * - 0x0: credit delta is positive, rebalance in some buffers
  13770. * - 0x1: credit delta is negative, rebalance out some buffers
  13771. * - reserved
  13772. * Bits 14:9
  13773. * Value: 0x0
  13774. * - TXQ_GRP
  13775. * Bit 15
  13776. * Purpose: indicates whether any tx queue group information elements
  13777. * are appended to the tx credit update message
  13778. * Value: 0 -> no tx queue group information element is present
  13779. * 1 -> a tx queue group information element immediately follows
  13780. * - DELTA_COUNT
  13781. * Bits 31:16
  13782. * Purpose: Specify current htt credit delta absolute count
  13783. */
  13784. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13785. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13786. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13787. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13788. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13789. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13790. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13791. do { \
  13792. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13793. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13794. } while (0)
  13795. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13796. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13797. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13798. do { \
  13799. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13800. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13801. } while (0)
  13802. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13803. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13804. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13805. do { \
  13806. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13807. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13808. } while (0)
  13809. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13810. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13811. #define HTT_TX_CREDIT_MSG_BYTES 4
  13812. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13813. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13814. /**
  13815. * @brief HTT WDI_IPA Operation Response Message
  13816. *
  13817. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13818. *
  13819. * @details
  13820. * HTT WDI_IPA Operation Response message is sent by target
  13821. * to host confirming suspend or resume operation.
  13822. * |31 24|23 16|15 8|7 0|
  13823. * |----------------+----------------+----------------+----------------|
  13824. * | op_code | Rsvd | msg_type |
  13825. * |-------------------------------------------------------------------|
  13826. * | Rsvd | Response len |
  13827. * |-------------------------------------------------------------------|
  13828. * | |
  13829. * | Response-type specific info |
  13830. * | |
  13831. * | |
  13832. * |-------------------------------------------------------------------|
  13833. * Header fields:
  13834. * - MSG_TYPE
  13835. * Bits 7:0
  13836. * Purpose: Identifies this as WDI_IPA Operation Response message
  13837. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13838. * - OP_CODE
  13839. * Bits 31:16
  13840. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13841. * value: = enum htt_wdi_ipa_op_code
  13842. * - RSP_LEN
  13843. * Bits 16:0
  13844. * Purpose: length for the response-type specific info
  13845. * value: = length in bytes for response-type specific info
  13846. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13847. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13848. */
  13849. PREPACK struct htt_wdi_ipa_op_response_t
  13850. {
  13851. /* DWORD 0: flags and meta-data */
  13852. A_UINT32
  13853. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13854. reserved1: 8,
  13855. op_code: 16;
  13856. A_UINT32
  13857. rsp_len: 16,
  13858. reserved2: 16;
  13859. } POSTPACK;
  13860. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13861. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13862. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13863. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13864. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13865. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13866. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13867. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13868. do { \
  13869. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13870. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13871. } while (0)
  13872. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13873. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13874. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13875. do { \
  13876. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13877. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13878. } while (0)
  13879. enum htt_phy_mode {
  13880. htt_phy_mode_11a = 0,
  13881. htt_phy_mode_11g = 1,
  13882. htt_phy_mode_11b = 2,
  13883. htt_phy_mode_11g_only = 3,
  13884. htt_phy_mode_11na_ht20 = 4,
  13885. htt_phy_mode_11ng_ht20 = 5,
  13886. htt_phy_mode_11na_ht40 = 6,
  13887. htt_phy_mode_11ng_ht40 = 7,
  13888. htt_phy_mode_11ac_vht20 = 8,
  13889. htt_phy_mode_11ac_vht40 = 9,
  13890. htt_phy_mode_11ac_vht80 = 10,
  13891. htt_phy_mode_11ac_vht20_2g = 11,
  13892. htt_phy_mode_11ac_vht40_2g = 12,
  13893. htt_phy_mode_11ac_vht80_2g = 13,
  13894. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13895. htt_phy_mode_11ac_vht160 = 15,
  13896. htt_phy_mode_max,
  13897. };
  13898. /**
  13899. * @brief target -> host HTT channel change indication
  13900. *
  13901. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13902. *
  13903. * @details
  13904. * Specify when a channel change occurs.
  13905. * This allows the host to precisely determine which rx frames arrived
  13906. * on the old channel and which rx frames arrived on the new channel.
  13907. *
  13908. *|31 |7 0 |
  13909. *|-------------------------------------------+----------|
  13910. *| reserved | msg type |
  13911. *|------------------------------------------------------|
  13912. *| primary_chan_center_freq_mhz |
  13913. *|------------------------------------------------------|
  13914. *| contiguous_chan1_center_freq_mhz |
  13915. *|------------------------------------------------------|
  13916. *| contiguous_chan2_center_freq_mhz |
  13917. *|------------------------------------------------------|
  13918. *| phy_mode |
  13919. *|------------------------------------------------------|
  13920. *
  13921. * Header fields:
  13922. * - MSG_TYPE
  13923. * Bits 7:0
  13924. * Purpose: identifies this as a htt channel change indication message
  13925. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13926. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13927. * Bits 31:0
  13928. * Purpose: identify the (center of the) new 20 MHz primary channel
  13929. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13930. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13931. * Bits 31:0
  13932. * Purpose: identify the (center of the) contiguous frequency range
  13933. * comprising the new channel.
  13934. * For example, if the new channel is a 80 MHz channel extending
  13935. * 60 MHz beyond the primary channel, this field would be 30 larger
  13936. * than the primary channel center frequency field.
  13937. * Value: center frequency of the contiguous frequency range comprising
  13938. * the full channel in MHz units
  13939. * (80+80 channels also use the CONTIG_CHAN2 field)
  13940. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13941. * Bits 31:0
  13942. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13943. * within a VHT 80+80 channel.
  13944. * This field is only relevant for VHT 80+80 channels.
  13945. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13946. * channel (arbitrary value for cases besides VHT 80+80)
  13947. * - PHY_MODE
  13948. * Bits 31:0
  13949. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13950. * and band
  13951. * Value: htt_phy_mode enum value
  13952. */
  13953. PREPACK struct htt_chan_change_t
  13954. {
  13955. /* DWORD 0: flags and meta-data */
  13956. A_UINT32
  13957. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13958. reserved1: 24;
  13959. A_UINT32 primary_chan_center_freq_mhz;
  13960. A_UINT32 contig_chan1_center_freq_mhz;
  13961. A_UINT32 contig_chan2_center_freq_mhz;
  13962. A_UINT32 phy_mode;
  13963. } POSTPACK;
  13964. /*
  13965. * Due to historical / backwards-compatibility reasons, maintain the
  13966. * below htt_chan_change_msg struct definition, which needs to be
  13967. * consistent with the above htt_chan_change_t struct definition
  13968. * (aside from the htt_chan_change_t definition including the msg_type
  13969. * dword within the message, and the htt_chan_change_msg only containing
  13970. * the payload of the message that follows the msg_type dword).
  13971. */
  13972. PREPACK struct htt_chan_change_msg {
  13973. A_UINT32 chan_mhz; /* frequency in mhz */
  13974. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13975. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13976. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13977. } POSTPACK;
  13978. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13979. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13980. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13981. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13982. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13983. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13984. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13985. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13986. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13987. do { \
  13988. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13989. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13990. } while (0)
  13991. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13992. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13993. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13994. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13995. do { \
  13996. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13997. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13998. } while (0)
  13999. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  14000. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  14001. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  14002. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14003. do { \
  14004. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14005. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14006. } while (0)
  14007. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14008. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14009. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14010. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14011. do { \
  14012. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14013. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14014. } while (0)
  14015. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14016. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14017. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14018. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14019. /**
  14020. * @brief rx offload packet error message
  14021. *
  14022. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14023. *
  14024. * @details
  14025. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14026. * of target payload like mic err.
  14027. *
  14028. * |31 24|23 16|15 8|7 0|
  14029. * |----------------+----------------+----------------+----------------|
  14030. * | tid | vdev_id | msg_sub_type | msg_type |
  14031. * |-------------------------------------------------------------------|
  14032. * : (sub-type dependent content) :
  14033. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14034. * Header fields:
  14035. * - msg_type
  14036. * Bits 7:0
  14037. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14038. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14039. * - msg_sub_type
  14040. * Bits 15:8
  14041. * Purpose: Identifies which type of rx error is reported by this message
  14042. * value: htt_rx_ofld_pkt_err_type
  14043. * - vdev_id
  14044. * Bits 23:16
  14045. * Purpose: Identifies which vdev received the erroneous rx frame
  14046. * value:
  14047. * - tid
  14048. * Bits 31:24
  14049. * Purpose: Identifies the traffic type of the rx frame
  14050. * value:
  14051. *
  14052. * - The payload fields used if the sub-type == MIC error are shown below.
  14053. * Note - MIC err is per MSDU, while PN is per MPDU.
  14054. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14055. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14056. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14057. * instead of sending separate HTT messages for each wrong MSDU within
  14058. * the MPDU.
  14059. *
  14060. * |31 24|23 16|15 8|7 0|
  14061. * |----------------+----------------+----------------+----------------|
  14062. * | Rsvd | key_id | peer_id |
  14063. * |-------------------------------------------------------------------|
  14064. * | receiver MAC addr 31:0 |
  14065. * |-------------------------------------------------------------------|
  14066. * | Rsvd | receiver MAC addr 47:32 |
  14067. * |-------------------------------------------------------------------|
  14068. * | transmitter MAC addr 31:0 |
  14069. * |-------------------------------------------------------------------|
  14070. * | Rsvd | transmitter MAC addr 47:32 |
  14071. * |-------------------------------------------------------------------|
  14072. * | PN 31:0 |
  14073. * |-------------------------------------------------------------------|
  14074. * | Rsvd | PN 47:32 |
  14075. * |-------------------------------------------------------------------|
  14076. * - peer_id
  14077. * Bits 15:0
  14078. * Purpose: identifies which peer is frame is from
  14079. * value:
  14080. * - key_id
  14081. * Bits 23:16
  14082. * Purpose: identifies key_id of rx frame
  14083. * value:
  14084. * - RA_31_0 (receiver MAC addr 31:0)
  14085. * Bits 31:0
  14086. * Purpose: identifies by MAC address which vdev received the frame
  14087. * value: MAC address lower 4 bytes
  14088. * - RA_47_32 (receiver MAC addr 47:32)
  14089. * Bits 15:0
  14090. * Purpose: identifies by MAC address which vdev received the frame
  14091. * value: MAC address upper 2 bytes
  14092. * - TA_31_0 (transmitter MAC addr 31:0)
  14093. * Bits 31:0
  14094. * Purpose: identifies by MAC address which peer transmitted the frame
  14095. * value: MAC address lower 4 bytes
  14096. * - TA_47_32 (transmitter MAC addr 47:32)
  14097. * Bits 15:0
  14098. * Purpose: identifies by MAC address which peer transmitted the frame
  14099. * value: MAC address upper 2 bytes
  14100. * - PN_31_0
  14101. * Bits 31:0
  14102. * Purpose: Identifies pn of rx frame
  14103. * value: PN lower 4 bytes
  14104. * - PN_47_32
  14105. * Bits 15:0
  14106. * Purpose: Identifies pn of rx frame
  14107. * value:
  14108. * TKIP or CCMP: PN upper 2 bytes
  14109. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14110. */
  14111. enum htt_rx_ofld_pkt_err_type {
  14112. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14113. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14114. };
  14115. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14116. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14117. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14118. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14119. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14120. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14121. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14122. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14123. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14124. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14125. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14126. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14127. do { \
  14128. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14129. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14130. } while (0)
  14131. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14132. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14133. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14134. do { \
  14135. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14136. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14137. } while (0)
  14138. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14139. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14140. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14141. do { \
  14142. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14143. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14144. } while (0)
  14145. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14146. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14147. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14148. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14149. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14150. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14151. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14152. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14153. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14154. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14155. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14156. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14157. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14158. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14159. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14160. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14161. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14162. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14163. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14164. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14165. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14166. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14167. do { \
  14168. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14169. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14170. } while (0)
  14171. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14172. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14173. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14174. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14175. do { \
  14176. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14177. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14178. } while (0)
  14179. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14180. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14181. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14182. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14183. do { \
  14184. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14185. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14186. } while (0)
  14187. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14188. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14189. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14190. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14191. do { \
  14192. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14193. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14194. } while (0)
  14195. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14196. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14197. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14198. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14199. do { \
  14200. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14201. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14202. } while (0)
  14203. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14204. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14205. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14206. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14207. do { \
  14208. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14209. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14210. } while (0)
  14211. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14212. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14213. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14214. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14215. do { \
  14216. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14217. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14218. } while (0)
  14219. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14220. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14221. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14222. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14223. do { \
  14224. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14225. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14226. } while (0)
  14227. /**
  14228. * @brief target -> host peer rate report message
  14229. *
  14230. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14231. *
  14232. * @details
  14233. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14234. * justified rate of all the peers.
  14235. *
  14236. * |31 24|23 16|15 8|7 0|
  14237. * |----------------+----------------+----------------+----------------|
  14238. * | peer_count | | msg_type |
  14239. * |-------------------------------------------------------------------|
  14240. * : Payload (variant number of peer rate report) :
  14241. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14242. * Header fields:
  14243. * - msg_type
  14244. * Bits 7:0
  14245. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14246. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14247. * - reserved
  14248. * Bits 15:8
  14249. * Purpose:
  14250. * value:
  14251. * - peer_count
  14252. * Bits 31:16
  14253. * Purpose: Specify how many peer rate report elements are present in the payload.
  14254. * value:
  14255. *
  14256. * Payload:
  14257. * There are variant number of peer rate report follow the first 32 bits.
  14258. * The peer rate report is defined as follows.
  14259. *
  14260. * |31 20|19 16|15 0|
  14261. * |-----------------------+---------+---------------------------------|-
  14262. * | reserved | phy | peer_id | \
  14263. * |-------------------------------------------------------------------| -> report #0
  14264. * | rate | /
  14265. * |-----------------------+---------+---------------------------------|-
  14266. * | reserved | phy | peer_id | \
  14267. * |-------------------------------------------------------------------| -> report #1
  14268. * | rate | /
  14269. * |-----------------------+---------+---------------------------------|-
  14270. * | reserved | phy | peer_id | \
  14271. * |-------------------------------------------------------------------| -> report #2
  14272. * | rate | /
  14273. * |-------------------------------------------------------------------|-
  14274. * : :
  14275. * : :
  14276. * : :
  14277. * :-------------------------------------------------------------------:
  14278. *
  14279. * - peer_id
  14280. * Bits 15:0
  14281. * Purpose: identify the peer
  14282. * value:
  14283. * - phy
  14284. * Bits 19:16
  14285. * Purpose: identify which phy is in use
  14286. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14287. * Please see enum htt_peer_report_phy_type for detail.
  14288. * - reserved
  14289. * Bits 31:20
  14290. * Purpose:
  14291. * value:
  14292. * - rate
  14293. * Bits 31:0
  14294. * Purpose: represent the justified rate of the peer specified by peer_id
  14295. * value:
  14296. */
  14297. enum htt_peer_rate_report_phy_type {
  14298. HTT_PEER_RATE_REPORT_11B = 0,
  14299. HTT_PEER_RATE_REPORT_11A_G,
  14300. HTT_PEER_RATE_REPORT_11N,
  14301. HTT_PEER_RATE_REPORT_11AC,
  14302. };
  14303. #define HTT_PEER_RATE_REPORT_SIZE 8
  14304. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14305. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14306. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14307. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14308. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14309. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14310. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14311. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14312. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14313. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14314. do { \
  14315. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14316. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14317. } while (0)
  14318. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14319. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14320. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14321. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14322. do { \
  14323. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14324. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14325. } while (0)
  14326. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14327. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14328. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14329. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14330. do { \
  14331. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14332. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14333. } while (0)
  14334. /**
  14335. * @brief target -> host flow pool map message
  14336. *
  14337. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14338. *
  14339. * @details
  14340. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14341. * a flow of descriptors.
  14342. *
  14343. * This message is in TLV format and indicates the parameters to be setup a
  14344. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14345. * receive descriptors from a specified pool.
  14346. *
  14347. * The message would appear as follows:
  14348. *
  14349. * |31 24|23 16|15 8|7 0|
  14350. * |----------------+----------------+----------------+----------------|
  14351. * header | reserved | num_flows | msg_type |
  14352. * |-------------------------------------------------------------------|
  14353. * | |
  14354. * : payload :
  14355. * | |
  14356. * |-------------------------------------------------------------------|
  14357. *
  14358. * The header field is one DWORD long and is interpreted as follows:
  14359. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14360. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14361. * this message
  14362. * b'16-31 - reserved: These bits are reserved for future use
  14363. *
  14364. * Payload:
  14365. * The payload would contain multiple objects of the following structure. Each
  14366. * object represents a flow.
  14367. *
  14368. * |31 24|23 16|15 8|7 0|
  14369. * |----------------+----------------+----------------+----------------|
  14370. * header | reserved | num_flows | msg_type |
  14371. * |-------------------------------------------------------------------|
  14372. * payload0| flow_type |
  14373. * |-------------------------------------------------------------------|
  14374. * | flow_id |
  14375. * |-------------------------------------------------------------------|
  14376. * | reserved0 | flow_pool_id |
  14377. * |-------------------------------------------------------------------|
  14378. * | reserved1 | flow_pool_size |
  14379. * |-------------------------------------------------------------------|
  14380. * | reserved2 |
  14381. * |-------------------------------------------------------------------|
  14382. * payload1| flow_type |
  14383. * |-------------------------------------------------------------------|
  14384. * | flow_id |
  14385. * |-------------------------------------------------------------------|
  14386. * | reserved0 | flow_pool_id |
  14387. * |-------------------------------------------------------------------|
  14388. * | reserved1 | flow_pool_size |
  14389. * |-------------------------------------------------------------------|
  14390. * | reserved2 |
  14391. * |-------------------------------------------------------------------|
  14392. * | . |
  14393. * | . |
  14394. * | . |
  14395. * |-------------------------------------------------------------------|
  14396. *
  14397. * Each payload is 5 DWORDS long and is interpreted as follows:
  14398. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14399. * this flow is associated. It can be VDEV, peer,
  14400. * or tid (AC). Based on enum htt_flow_type.
  14401. *
  14402. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14403. * object. For flow_type vdev it is set to the
  14404. * vdevid, for peer it is peerid and for tid, it is
  14405. * tid_num.
  14406. *
  14407. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14408. * in the host for this flow
  14409. * b'16:31 - reserved0: This field in reserved for the future. In case
  14410. * we have a hierarchical implementation (HCM) of
  14411. * pools, it can be used to indicate the ID of the
  14412. * parent-pool.
  14413. *
  14414. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14415. * Descriptors for this flow will be
  14416. * allocated from this pool in the host.
  14417. * b'16:31 - reserved1: This field in reserved for the future. In case
  14418. * we have a hierarchical implementation of pools,
  14419. * it can be used to indicate the max number of
  14420. * descriptors in the pool. The b'0:15 can be used
  14421. * to indicate min number of descriptors in the
  14422. * HCM scheme.
  14423. *
  14424. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14425. * we have a hierarchical implementation of pools,
  14426. * b'0:15 can be used to indicate the
  14427. * priority-based borrowing (PBB) threshold of
  14428. * the flow's pool. The b'16:31 are still left
  14429. * reserved.
  14430. */
  14431. enum htt_flow_type {
  14432. FLOW_TYPE_VDEV = 0,
  14433. /* Insert new flow types above this line */
  14434. };
  14435. PREPACK struct htt_flow_pool_map_payload_t {
  14436. A_UINT32 flow_type;
  14437. A_UINT32 flow_id;
  14438. A_UINT32 flow_pool_id:16,
  14439. reserved0:16;
  14440. A_UINT32 flow_pool_size:16,
  14441. reserved1:16;
  14442. A_UINT32 reserved2;
  14443. } POSTPACK;
  14444. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14445. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14446. (sizeof(struct htt_flow_pool_map_payload_t))
  14447. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14448. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14449. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14450. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14451. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14452. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14453. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14454. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14455. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14456. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14457. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14458. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14459. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14460. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14461. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14462. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14463. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14464. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14465. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14466. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14467. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14468. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14469. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14470. do { \
  14471. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14472. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14473. } while (0)
  14474. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14475. do { \
  14476. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14477. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14478. } while (0)
  14479. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14480. do { \
  14481. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14482. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14483. } while (0)
  14484. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14485. do { \
  14486. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14487. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14488. } while (0)
  14489. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14490. do { \
  14491. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14492. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14493. } while (0)
  14494. /**
  14495. * @brief target -> host flow pool unmap message
  14496. *
  14497. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14498. *
  14499. * @details
  14500. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14501. * down a flow of descriptors.
  14502. * This message indicates that for the flow (whose ID is provided) is wanting
  14503. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14504. * pool of descriptors from where descriptors are being allocated for this
  14505. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14506. * be unmapped by the host.
  14507. *
  14508. * The message would appear as follows:
  14509. *
  14510. * |31 24|23 16|15 8|7 0|
  14511. * |----------------+----------------+----------------+----------------|
  14512. * | reserved0 | msg_type |
  14513. * |-------------------------------------------------------------------|
  14514. * | flow_type |
  14515. * |-------------------------------------------------------------------|
  14516. * | flow_id |
  14517. * |-------------------------------------------------------------------|
  14518. * | reserved1 | flow_pool_id |
  14519. * |-------------------------------------------------------------------|
  14520. *
  14521. * The message is interpreted as follows:
  14522. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14523. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14524. * b'8:31 - reserved0: Reserved for future use
  14525. *
  14526. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14527. * this flow is associated. It can be VDEV, peer,
  14528. * or tid (AC). Based on enum htt_flow_type.
  14529. *
  14530. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14531. * object. For flow_type vdev it is set to the
  14532. * vdevid, for peer it is peerid and for tid, it is
  14533. * tid_num.
  14534. *
  14535. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14536. * used in the host for this flow
  14537. * b'16:31 - reserved0: This field in reserved for the future.
  14538. *
  14539. */
  14540. PREPACK struct htt_flow_pool_unmap_t {
  14541. A_UINT32 msg_type:8,
  14542. reserved0:24;
  14543. A_UINT32 flow_type;
  14544. A_UINT32 flow_id;
  14545. A_UINT32 flow_pool_id:16,
  14546. reserved1:16;
  14547. } POSTPACK;
  14548. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14549. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14550. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14551. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14552. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14553. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14554. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14555. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14556. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14557. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14558. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14559. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14560. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14561. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14562. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14563. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14564. do { \
  14565. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14566. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14567. } while (0)
  14568. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14569. do { \
  14570. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14571. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14572. } while (0)
  14573. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14574. do { \
  14575. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14576. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14577. } while (0)
  14578. /**
  14579. * @brief target -> host SRING setup done message
  14580. *
  14581. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14582. *
  14583. * @details
  14584. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14585. * SRNG ring setup is done
  14586. *
  14587. * This message indicates whether the last setup operation is successful.
  14588. * It will be sent to host when host set respose_required bit in
  14589. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14590. * The message would appear as follows:
  14591. *
  14592. * |31 24|23 16|15 8|7 0|
  14593. * |--------------- +----------------+----------------+----------------|
  14594. * | setup_status | ring_id | pdev_id | msg_type |
  14595. * |-------------------------------------------------------------------|
  14596. *
  14597. * The message is interpreted as follows:
  14598. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14599. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14600. * b'8:15 - pdev_id:
  14601. * 0 (for rings at SOC/UMAC level),
  14602. * 1/2/3 mac id (for rings at LMAC level)
  14603. * b'16:23 - ring_id: Identify the ring which is set up
  14604. * More details can be got from enum htt_srng_ring_id
  14605. * b'24:31 - setup_status: Indicate status of setup operation
  14606. * Refer to htt_ring_setup_status
  14607. */
  14608. PREPACK struct htt_sring_setup_done_t {
  14609. A_UINT32 msg_type: 8,
  14610. pdev_id: 8,
  14611. ring_id: 8,
  14612. setup_status: 8;
  14613. } POSTPACK;
  14614. enum htt_ring_setup_status {
  14615. htt_ring_setup_status_ok = 0,
  14616. htt_ring_setup_status_error,
  14617. };
  14618. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14619. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14620. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14621. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14622. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14623. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14624. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14625. do { \
  14626. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14627. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14628. } while (0)
  14629. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14630. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14631. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14632. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14633. HTT_SRING_SETUP_DONE_RING_ID_S)
  14634. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14635. do { \
  14636. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14637. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14638. } while (0)
  14639. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14640. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14641. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14642. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14643. HTT_SRING_SETUP_DONE_STATUS_S)
  14644. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14645. do { \
  14646. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14647. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14648. } while (0)
  14649. /**
  14650. * @brief target -> flow map flow info
  14651. *
  14652. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14653. *
  14654. * @details
  14655. * HTT TX map flow entry with tqm flow pointer
  14656. * Sent from firmware to host to add tqm flow pointer in corresponding
  14657. * flow search entry. Flow metadata is replayed back to host as part of this
  14658. * struct to enable host to find the specific flow search entry
  14659. *
  14660. * The message would appear as follows:
  14661. *
  14662. * |31 28|27 18|17 14|13 8|7 0|
  14663. * |-------+------------------------------------------+----------------|
  14664. * | rsvd0 | fse_hsh_idx | msg_type |
  14665. * |-------------------------------------------------------------------|
  14666. * | rsvd1 | tid | peer_id |
  14667. * |-------------------------------------------------------------------|
  14668. * | tqm_flow_pntr_lo |
  14669. * |-------------------------------------------------------------------|
  14670. * | tqm_flow_pntr_hi |
  14671. * |-------------------------------------------------------------------|
  14672. * | fse_meta_data |
  14673. * |-------------------------------------------------------------------|
  14674. *
  14675. * The message is interpreted as follows:
  14676. *
  14677. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14678. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14679. *
  14680. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14681. * for this flow entry
  14682. *
  14683. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14684. *
  14685. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14686. *
  14687. * dword1 - b'14:17 - tid
  14688. *
  14689. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14690. *
  14691. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14692. *
  14693. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14694. *
  14695. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14696. * given by host
  14697. */
  14698. PREPACK struct htt_tx_map_flow_info {
  14699. A_UINT32
  14700. msg_type: 8,
  14701. fse_hsh_idx: 20,
  14702. rsvd0: 4;
  14703. A_UINT32
  14704. peer_id: 14,
  14705. tid: 4,
  14706. rsvd1: 14;
  14707. A_UINT32 tqm_flow_pntr_lo;
  14708. A_UINT32 tqm_flow_pntr_hi;
  14709. struct htt_tx_flow_metadata fse_meta_data;
  14710. } POSTPACK;
  14711. /* DWORD 0 */
  14712. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14713. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14714. /* DWORD 1 */
  14715. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14716. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14717. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14718. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14719. /* DWORD 0 */
  14720. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14721. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14722. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14723. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14724. do { \
  14725. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14726. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14727. } while (0)
  14728. /* DWORD 1 */
  14729. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14730. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14731. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14732. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14733. do { \
  14734. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14735. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14736. } while (0)
  14737. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14738. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14739. HTT_TX_MAP_FLOW_INFO_TID_S)
  14740. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14741. do { \
  14742. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14743. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14744. } while (0)
  14745. /*
  14746. * htt_dbg_ext_stats_status -
  14747. * present - The requested stats have been delivered in full.
  14748. * This indicates that either the stats information was contained
  14749. * in its entirety within this message, or else this message
  14750. * completes the delivery of the requested stats info that was
  14751. * partially delivered through earlier STATS_CONF messages.
  14752. * partial - The requested stats have been delivered in part.
  14753. * One or more subsequent STATS_CONF messages with the same
  14754. * cookie value will be sent to deliver the remainder of the
  14755. * information.
  14756. * error - The requested stats could not be delivered, for example due
  14757. * to a shortage of memory to construct a message holding the
  14758. * requested stats.
  14759. * invalid - The requested stat type is either not recognized, or the
  14760. * target is configured to not gather the stats type in question.
  14761. */
  14762. enum htt_dbg_ext_stats_status {
  14763. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14764. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14765. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14766. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14767. };
  14768. /**
  14769. * @brief target -> host ppdu stats upload
  14770. *
  14771. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14772. *
  14773. * @details
  14774. * The following field definitions describe the format of the HTT target
  14775. * to host ppdu stats indication message.
  14776. *
  14777. *
  14778. * |31 16|15 12|11 10|9 8|7 0 |
  14779. * |----------------------------------------------------------------------|
  14780. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14781. * |----------------------------------------------------------------------|
  14782. * | ppdu_id |
  14783. * |----------------------------------------------------------------------|
  14784. * | Timestamp in us |
  14785. * |----------------------------------------------------------------------|
  14786. * | reserved |
  14787. * |----------------------------------------------------------------------|
  14788. * | type-specific stats info |
  14789. * | (see htt_ppdu_stats.h) |
  14790. * |----------------------------------------------------------------------|
  14791. * Header fields:
  14792. * - MSG_TYPE
  14793. * Bits 7:0
  14794. * Purpose: Identifies this is a PPDU STATS indication
  14795. * message.
  14796. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14797. * - mac_id
  14798. * Bits 9:8
  14799. * Purpose: mac_id of this ppdu_id
  14800. * Value: 0-3
  14801. * - pdev_id
  14802. * Bits 11:10
  14803. * Purpose: pdev_id of this ppdu_id
  14804. * Value: 0-3
  14805. * 0 (for rings at SOC level),
  14806. * 1/2/3 PDEV -> 0/1/2
  14807. * - payload_size
  14808. * Bits 31:16
  14809. * Purpose: total tlv size
  14810. * Value: payload_size in bytes
  14811. */
  14812. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14813. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14814. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14815. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14816. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14817. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14818. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14819. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14820. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14821. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14822. do { \
  14823. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14824. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14825. } while (0)
  14826. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14827. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14828. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14829. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14830. do { \
  14831. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14832. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14833. } while (0)
  14834. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14835. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14836. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14837. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14838. do { \
  14839. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14840. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14841. } while (0)
  14842. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14843. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14844. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14845. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14846. do { \
  14847. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14848. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14849. } while (0)
  14850. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14851. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14852. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14853. /* htt_t2h_ppdu_stats_ind_hdr_t
  14854. * This struct contains the fields within the header of the
  14855. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14856. * stats info.
  14857. * This struct assumes little-endian layout, and thus is only
  14858. * suitable for use within processors known to be little-endian
  14859. * (such as the target).
  14860. * In contrast, the above macros provide endian-portable methods
  14861. * to get and set the bitfields within this PPDU_STATS_IND header.
  14862. */
  14863. typedef struct {
  14864. A_UINT32 msg_type: 8, /* bits 7:0 */
  14865. mac_id: 2, /* bits 9:8 */
  14866. pdev_id: 2, /* bits 11:10 */
  14867. reserved1: 4, /* bits 15:12 */
  14868. payload_size: 16; /* bits 31:16 */
  14869. A_UINT32 ppdu_id;
  14870. A_UINT32 timestamp_us;
  14871. A_UINT32 reserved2;
  14872. } htt_t2h_ppdu_stats_ind_hdr_t;
  14873. /**
  14874. * @brief target -> host extended statistics upload
  14875. *
  14876. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14877. *
  14878. * @details
  14879. * The following field definitions describe the format of the HTT target
  14880. * to host stats upload confirmation message.
  14881. * The message contains a cookie echoed from the HTT host->target stats
  14882. * upload request, which identifies which request the confirmation is
  14883. * for, and a single stats can span over multiple HTT stats indication
  14884. * due to the HTT message size limitation so every HTT ext stats indication
  14885. * will have tag-length-value stats information elements.
  14886. * The tag-length header for each HTT stats IND message also includes a
  14887. * status field, to indicate whether the request for the stat type in
  14888. * question was fully met, partially met, unable to be met, or invalid
  14889. * (if the stat type in question is disabled in the target).
  14890. * A Done bit 1's indicate the end of the of stats info elements.
  14891. *
  14892. *
  14893. * |31 16|15 12|11|10 8|7 5|4 0|
  14894. * |--------------------------------------------------------------|
  14895. * | reserved | msg type |
  14896. * |--------------------------------------------------------------|
  14897. * | cookie LSBs |
  14898. * |--------------------------------------------------------------|
  14899. * | cookie MSBs |
  14900. * |--------------------------------------------------------------|
  14901. * | stats entry length | rsvd | D| S | stat type |
  14902. * |--------------------------------------------------------------|
  14903. * | type-specific stats info |
  14904. * | (see htt_stats.h) |
  14905. * |--------------------------------------------------------------|
  14906. * Header fields:
  14907. * - MSG_TYPE
  14908. * Bits 7:0
  14909. * Purpose: Identifies this is a extended statistics upload confirmation
  14910. * message.
  14911. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14912. * - COOKIE_LSBS
  14913. * Bits 31:0
  14914. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14915. * message with its preceding host->target stats request message.
  14916. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14917. * - COOKIE_MSBS
  14918. * Bits 31:0
  14919. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14920. * message with its preceding host->target stats request message.
  14921. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14922. *
  14923. * Stats Information Element tag-length header fields:
  14924. * - STAT_TYPE
  14925. * Bits 7:0
  14926. * Purpose: identifies the type of statistics info held in the
  14927. * following information element
  14928. * Value: htt_dbg_ext_stats_type
  14929. * - STATUS
  14930. * Bits 10:8
  14931. * Purpose: indicate whether the requested stats are present
  14932. * Value: htt_dbg_ext_stats_status
  14933. * - DONE
  14934. * Bits 11
  14935. * Purpose:
  14936. * Indicates the completion of the stats entry, this will be the last
  14937. * stats conf HTT segment for the requested stats type.
  14938. * Value:
  14939. * 0 -> the stats retrieval is ongoing
  14940. * 1 -> the stats retrieval is complete
  14941. * - LENGTH
  14942. * Bits 31:16
  14943. * Purpose: indicate the stats information size
  14944. * Value: This field specifies the number of bytes of stats information
  14945. * that follows the element tag-length header.
  14946. * It is expected but not required that this length is a multiple of
  14947. * 4 bytes.
  14948. */
  14949. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14950. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14951. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14952. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14953. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14954. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14955. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14956. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14957. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14958. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14959. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14960. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14961. do { \
  14962. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14963. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14964. } while (0)
  14965. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14966. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14967. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14968. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14969. do { \
  14970. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14971. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14972. } while (0)
  14973. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14974. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14975. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14976. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14977. do { \
  14978. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14979. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14980. } while (0)
  14981. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14982. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14983. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14984. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14985. do { \
  14986. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14987. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14988. } while (0)
  14989. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14990. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14991. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14992. /**
  14993. * @brief target -> host streaming statistics upload
  14994. *
  14995. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14996. *
  14997. * @details
  14998. * The following field definitions describe the format of the HTT target
  14999. * to host streaming stats upload indication message.
  15000. * The host can use a STREAMING_STATS_REQ message to enable the target to
  15001. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  15002. * use the STREAMING_STATS_REQ message to halt the target's production of
  15003. * STREAMING_STATS_IND messages.
  15004. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15005. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15006. *
  15007. * |31 8|7 0|
  15008. * |--------------------------------------------------------------|
  15009. * | reserved | msg type |
  15010. * |--------------------------------------------------------------|
  15011. * | type-specific stats info |
  15012. * | (see htt_stats.h) |
  15013. * |--------------------------------------------------------------|
  15014. * Header fields:
  15015. * - MSG_TYPE
  15016. * Bits 7:0
  15017. * Purpose: Identifies this as a streaming statistics upload indication
  15018. * message.
  15019. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15020. */
  15021. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15022. typedef enum {
  15023. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15024. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15025. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15026. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15027. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15028. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15029. /* Reserved from 128 - 255 for target internal use.*/
  15030. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15031. } HTT_PEER_TYPE;
  15032. /** macro to convert MAC address from char array to HTT word format */
  15033. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15034. (phtt_mac_addr)->mac_addr31to0 = \
  15035. (((c_macaddr)[0] << 0) | \
  15036. ((c_macaddr)[1] << 8) | \
  15037. ((c_macaddr)[2] << 16) | \
  15038. ((c_macaddr)[3] << 24)); \
  15039. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15040. } while (0)
  15041. /**
  15042. * @brief target -> host monitor mac header indication message
  15043. *
  15044. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15045. *
  15046. * @details
  15047. * The following diagram shows the format of the monitor mac header message
  15048. * sent from the target to the host.
  15049. * This message is primarily sent when promiscuous rx mode is enabled.
  15050. * One message is sent per rx PPDU.
  15051. *
  15052. * |31 24|23 16|15 8|7 0|
  15053. * |-------------------------------------------------------------|
  15054. * | peer_id | reserved0 | msg_type |
  15055. * |-------------------------------------------------------------|
  15056. * | reserved1 | num_mpdu |
  15057. * |-------------------------------------------------------------|
  15058. * | struct hw_rx_desc |
  15059. * | (see wal_rx_desc.h) |
  15060. * |-------------------------------------------------------------|
  15061. * | struct ieee80211_frame_addr4 |
  15062. * | (see ieee80211_defs.h) |
  15063. * |-------------------------------------------------------------|
  15064. * | struct ieee80211_frame_addr4 |
  15065. * | (see ieee80211_defs.h) |
  15066. * |-------------------------------------------------------------|
  15067. * | ...... |
  15068. * |-------------------------------------------------------------|
  15069. *
  15070. * Header fields:
  15071. * - msg_type
  15072. * Bits 7:0
  15073. * Purpose: Identifies this is a monitor mac header indication message.
  15074. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15075. * - peer_id
  15076. * Bits 31:16
  15077. * Purpose: Software peer id given by host during association,
  15078. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15079. * for rx PPDUs received from unassociated peers.
  15080. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15081. * - num_mpdu
  15082. * Bits 15:0
  15083. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15084. * delivered within the message.
  15085. * Value: 1 to 32
  15086. * num_mpdu is limited to a maximum value of 32, due to buffer
  15087. * size limits. For PPDUs with more than 32 MPDUs, only the
  15088. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15089. * the PPDU will be provided.
  15090. */
  15091. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15092. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15093. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15094. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15095. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15096. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15097. do { \
  15098. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15099. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15100. } while (0)
  15101. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15102. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15103. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15104. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15105. do { \
  15106. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15107. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15108. } while (0)
  15109. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15110. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15111. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15112. /**
  15113. * @brief target -> host flow pool resize Message
  15114. *
  15115. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15116. *
  15117. * @details
  15118. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15119. * the flow pool associated with the specified ID is resized
  15120. *
  15121. * The message would appear as follows:
  15122. *
  15123. * |31 16|15 8|7 0|
  15124. * |---------------------------------+----------------+----------------|
  15125. * | reserved0 | Msg type |
  15126. * |-------------------------------------------------------------------|
  15127. * | flow pool new size | flow pool ID |
  15128. * |-------------------------------------------------------------------|
  15129. *
  15130. * The message is interpreted as follows:
  15131. * b'0:7 - msg_type: This will be set to 0x21
  15132. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15133. *
  15134. * b'0:15 - flow pool ID: Existing flow pool ID
  15135. *
  15136. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15137. *
  15138. */
  15139. PREPACK struct htt_flow_pool_resize_t {
  15140. A_UINT32 msg_type:8,
  15141. reserved0:24;
  15142. A_UINT32 flow_pool_id:16,
  15143. flow_pool_new_size:16;
  15144. } POSTPACK;
  15145. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15146. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15147. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15148. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15149. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15150. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15151. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15152. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15153. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15154. do { \
  15155. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15156. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15157. } while (0)
  15158. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15159. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15160. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15161. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15162. do { \
  15163. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15164. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15165. } while (0)
  15166. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15167. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15168. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15169. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15170. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15171. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15172. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15173. /*
  15174. * The read and write indices point to the data within the host buffer.
  15175. * Because the first 4 bytes of the host buffer is used for the read index and
  15176. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15177. * The read index and write index are the byte offsets from the base of the
  15178. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15179. * Refer the ASCII text picture below.
  15180. */
  15181. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15182. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15183. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15184. /*
  15185. ***************************************************************************
  15186. *
  15187. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15188. *
  15189. ***************************************************************************
  15190. *
  15191. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15192. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15193. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15194. * written into the Host memory region mentioned below.
  15195. *
  15196. * Read index is updated by the Host. At any point of time, the read index will
  15197. * indicate the index that will next be read by the Host. The read index is
  15198. * in units of bytes offset from the base of the meta-data buffer.
  15199. *
  15200. * Write index is updated by the FW. At any point of time, the write index will
  15201. * indicate from where the FW can start writing any new data. The write index is
  15202. * in units of bytes offset from the base of the meta-data buffer.
  15203. *
  15204. * If the Host is not fast enough in reading the CFR data, any new capture data
  15205. * would be dropped if there is no space left to write the new captures.
  15206. *
  15207. * The last 4 bytes of the memory region will have the magic pattern
  15208. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15209. * not overrun the host buffer.
  15210. *
  15211. * ,--------------------. read and write indices store the
  15212. * | | byte offset from the base of the
  15213. * | ,--------+--------. meta-data buffer to the next
  15214. * | | | | location within the data buffer
  15215. * | | v v that will be read / written
  15216. * ************************************************************************
  15217. * * Read * Write * * Magic *
  15218. * * index * index * CFR data1 ...... CFR data N * pattern *
  15219. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15220. * ************************************************************************
  15221. * |<---------- data buffer ---------->|
  15222. *
  15223. * |<----------------- meta-data buffer allocated in Host ----------------|
  15224. *
  15225. * Note:
  15226. * - Considering the 4 bytes needed to store the Read index (R) and the
  15227. * Write index (W), the initial value is as follows:
  15228. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15229. * - Buffer empty condition:
  15230. * R = W
  15231. *
  15232. * Regarding CFR data format:
  15233. * --------------------------
  15234. *
  15235. * Each CFR tone is stored in HW as 16-bits with the following format:
  15236. * {bits[15:12], bits[11:6], bits[5:0]} =
  15237. * {unsigned exponent (4 bits),
  15238. * signed mantissa_real (6 bits),
  15239. * signed mantissa_imag (6 bits)}
  15240. *
  15241. * CFR_real = mantissa_real * 2^(exponent-5)
  15242. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15243. *
  15244. *
  15245. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15246. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15247. *
  15248. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15249. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15250. * .
  15251. * .
  15252. * .
  15253. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15254. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15255. */
  15256. /* Bandwidth of peer CFR captures */
  15257. typedef enum {
  15258. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15259. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15260. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15261. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15262. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15263. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15264. } HTT_PEER_CFR_CAPTURE_BW;
  15265. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15266. * was captured
  15267. */
  15268. typedef enum {
  15269. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15270. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15271. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15272. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15273. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15274. } HTT_PEER_CFR_CAPTURE_MODE;
  15275. typedef enum {
  15276. /* This message type is currently used for the below purpose:
  15277. *
  15278. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15279. * wmi_peer_cfr_capture_cmd.
  15280. * If payload_present bit is set to 0 then the associated memory region
  15281. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15282. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15283. * message; the CFR dump will be present at the end of the message,
  15284. * after the chan_phy_mode.
  15285. */
  15286. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15287. /* Always keep this last */
  15288. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15289. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15290. /**
  15291. * @brief target -> host CFR dump completion indication message definition
  15292. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15293. *
  15294. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15295. *
  15296. * @details
  15297. * The following diagram shows the format of the Channel Frequency Response
  15298. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15299. * the channel capture of a peer is copied by Firmware into the Host memory
  15300. *
  15301. * **************************************************************************
  15302. *
  15303. * Message format when the CFR capture message type is
  15304. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15305. *
  15306. * **************************************************************************
  15307. *
  15308. * |31 16|15 |8|7 0|
  15309. * |----------------------------------------------------------------|
  15310. * header: | reserved |P| msg_type |
  15311. * word 0 | | | |
  15312. * |----------------------------------------------------------------|
  15313. * payload: | cfr_capture_msg_type |
  15314. * word 1 | |
  15315. * |----------------------------------------------------------------|
  15316. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15317. * word 2 | | | | | | | | |
  15318. * |----------------------------------------------------------------|
  15319. * | mac_addr31to0 |
  15320. * word 3 | |
  15321. * |----------------------------------------------------------------|
  15322. * | unused / reserved | mac_addr47to32 |
  15323. * word 4 | | |
  15324. * |----------------------------------------------------------------|
  15325. * | index |
  15326. * word 5 | |
  15327. * |----------------------------------------------------------------|
  15328. * | length |
  15329. * word 6 | |
  15330. * |----------------------------------------------------------------|
  15331. * | timestamp |
  15332. * word 7 | |
  15333. * |----------------------------------------------------------------|
  15334. * | counter |
  15335. * word 8 | |
  15336. * |----------------------------------------------------------------|
  15337. * | chan_mhz |
  15338. * word 9 | |
  15339. * |----------------------------------------------------------------|
  15340. * | band_center_freq1 |
  15341. * word 10 | |
  15342. * |----------------------------------------------------------------|
  15343. * | band_center_freq2 |
  15344. * word 11 | |
  15345. * |----------------------------------------------------------------|
  15346. * | chan_phy_mode |
  15347. * word 12 | |
  15348. * |----------------------------------------------------------------|
  15349. * where,
  15350. * P - payload present bit (payload_present explained below)
  15351. * req_id - memory request id (mem_req_id explained below)
  15352. * S - status field (status explained below)
  15353. * capbw - capture bandwidth (capture_bw explained below)
  15354. * mode - mode of capture (mode explained below)
  15355. * sts - space time streams (sts_count explained below)
  15356. * chbw - channel bandwidth (channel_bw explained below)
  15357. * captype - capture type (cap_type explained below)
  15358. *
  15359. * The following field definitions describe the format of the CFR dump
  15360. * completion indication sent from the target to the host
  15361. *
  15362. * Header fields:
  15363. *
  15364. * Word 0
  15365. * - msg_type
  15366. * Bits 7:0
  15367. * Purpose: Identifies this as CFR TX completion indication
  15368. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15369. * - payload_present
  15370. * Bit 8
  15371. * Purpose: Identifies how CFR data is sent to host
  15372. * Value: 0 - If CFR Payload is written to host memory
  15373. * 1 - If CFR Payload is sent as part of HTT message
  15374. * (This is the requirement for SDIO/USB where it is
  15375. * not possible to write CFR data to host memory)
  15376. * - reserved
  15377. * Bits 31:9
  15378. * Purpose: Reserved
  15379. * Value: 0
  15380. *
  15381. * Payload fields:
  15382. *
  15383. * Word 1
  15384. * - cfr_capture_msg_type
  15385. * Bits 31:0
  15386. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15387. * to specify the format used for the remainder of the message
  15388. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15389. * (currently only MSG_TYPE_1 is defined)
  15390. *
  15391. * Word 2
  15392. * - mem_req_id
  15393. * Bits 6:0
  15394. * Purpose: Contain the mem request id of the region where the CFR capture
  15395. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15396. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15397. this value is invalid)
  15398. * - status
  15399. * Bit 7
  15400. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15401. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15402. * - capture_bw
  15403. * Bits 10:8
  15404. * Purpose: Carry the bandwidth of the CFR capture
  15405. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15406. * - mode
  15407. * Bits 13:11
  15408. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15409. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15410. * - sts_count
  15411. * Bits 16:14
  15412. * Purpose: Carry the number of space time streams
  15413. * Value: Number of space time streams
  15414. * - channel_bw
  15415. * Bits 19:17
  15416. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15417. * measurement
  15418. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15419. * - cap_type
  15420. * Bits 23:20
  15421. * Purpose: Carry the type of the capture
  15422. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15423. * - vdev_id
  15424. * Bits 31:24
  15425. * Purpose: Carry the virtual device id
  15426. * Value: vdev ID
  15427. *
  15428. * Word 3
  15429. * - mac_addr31to0
  15430. * Bits 31:0
  15431. * Purpose: Contain the bits 31:0 of the peer MAC address
  15432. * Value: Bits 31:0 of the peer MAC address
  15433. *
  15434. * Word 4
  15435. * - mac_addr47to32
  15436. * Bits 15:0
  15437. * Purpose: Contain the bits 47:32 of the peer MAC address
  15438. * Value: Bits 47:32 of the peer MAC address
  15439. *
  15440. * Word 5
  15441. * - index
  15442. * Bits 31:0
  15443. * Purpose: Contain the index at which this CFR dump was written in the Host
  15444. * allocated memory. This index is the number of bytes from the base address.
  15445. * Value: Index position
  15446. *
  15447. * Word 6
  15448. * - length
  15449. * Bits 31:0
  15450. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15451. * Value: Length of the CFR capture of the peer
  15452. *
  15453. * Word 7
  15454. * - timestamp
  15455. * Bits 31:0
  15456. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15457. * clock used for this timestamp is private to the target and not visible to
  15458. * the host i.e., Host can interpret only the relative timestamp deltas from
  15459. * one message to the next, but can't interpret the absolute timestamp from a
  15460. * single message.
  15461. * Value: Timestamp in microseconds
  15462. *
  15463. * Word 8
  15464. * - counter
  15465. * Bits 31:0
  15466. * Purpose: Carry the count of the current CFR capture from FW. This is
  15467. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15468. * in host memory)
  15469. * Value: Count of the current CFR capture
  15470. *
  15471. * Word 9
  15472. * - chan_mhz
  15473. * Bits 31:0
  15474. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15475. * Value: Primary 20 channel frequency
  15476. *
  15477. * Word 10
  15478. * - band_center_freq1
  15479. * Bits 31:0
  15480. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15481. * Value: Center frequency 1 in MHz
  15482. *
  15483. * Word 11
  15484. * - band_center_freq2
  15485. * Bits 31:0
  15486. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15487. * the VDEV
  15488. * 80plus80 mode
  15489. * Value: Center frequency 2 in MHz
  15490. *
  15491. * Word 12
  15492. * - chan_phy_mode
  15493. * Bits 31:0
  15494. * Purpose: Carry the phy mode of the channel, of the VDEV
  15495. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15496. */
  15497. PREPACK struct htt_cfr_dump_ind_type_1 {
  15498. A_UINT32 mem_req_id:7,
  15499. status:1,
  15500. capture_bw:3,
  15501. mode:3,
  15502. sts_count:3,
  15503. channel_bw:3,
  15504. cap_type:4,
  15505. vdev_id:8;
  15506. htt_mac_addr addr;
  15507. A_UINT32 index;
  15508. A_UINT32 length;
  15509. A_UINT32 timestamp;
  15510. A_UINT32 counter;
  15511. struct htt_chan_change_msg chan;
  15512. } POSTPACK;
  15513. PREPACK struct htt_cfr_dump_compl_ind {
  15514. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15515. union {
  15516. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15517. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15518. /* If there is a need to change the memory layout and its associated
  15519. * HTT indication format, a new CFR capture message type can be
  15520. * introduced and added into this union.
  15521. */
  15522. };
  15523. } POSTPACK;
  15524. /*
  15525. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15526. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15527. */
  15528. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15529. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15530. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15531. do { \
  15532. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15533. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15534. } while(0)
  15535. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15536. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15537. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15538. /*
  15539. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15540. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15541. */
  15542. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15543. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15544. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15545. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15546. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15547. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15548. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15549. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15550. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15551. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15552. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15553. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15554. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15555. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15556. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15557. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15558. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15559. do { \
  15560. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15561. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15562. } while (0)
  15563. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15564. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15565. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15566. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15567. do { \
  15568. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15569. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15570. } while (0)
  15571. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15572. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15573. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15574. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15575. do { \
  15576. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15577. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15578. } while (0)
  15579. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15580. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15581. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15582. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15583. do { \
  15584. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15585. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15586. } while (0)
  15587. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15588. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15589. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15590. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15591. do { \
  15592. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15593. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15594. } while (0)
  15595. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15596. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15597. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15598. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15599. do { \
  15600. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15601. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15602. } while (0)
  15603. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15604. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15605. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15606. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15607. do { \
  15608. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15609. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15610. } while (0)
  15611. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15612. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15613. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15614. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15615. do { \
  15616. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15617. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15618. } while (0)
  15619. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15620. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15621. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15622. /**
  15623. * @brief target -> host peer (PPDU) stats message
  15624. *
  15625. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15626. *
  15627. * @details
  15628. * This message is generated by FW when FW is sending stats to host
  15629. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15630. * This message is sent autonomously by the target rather than upon request
  15631. * by the host.
  15632. * The following field definitions describe the format of the HTT target
  15633. * to host peer stats indication message.
  15634. *
  15635. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15636. * or more PPDU stats records.
  15637. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15638. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15639. * then the message would start with the
  15640. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15641. * below.
  15642. *
  15643. * |31 16|15|14|13 11|10 9|8|7 0|
  15644. * |-------------------------------------------------------------|
  15645. * | reserved |MSG_TYPE |
  15646. * |-------------------------------------------------------------|
  15647. * rec 0 | TLV header |
  15648. * rec 0 |-------------------------------------------------------------|
  15649. * rec 0 | ppdu successful bytes |
  15650. * rec 0 |-------------------------------------------------------------|
  15651. * rec 0 | ppdu retry bytes |
  15652. * rec 0 |-------------------------------------------------------------|
  15653. * rec 0 | ppdu failed bytes |
  15654. * rec 0 |-------------------------------------------------------------|
  15655. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15656. * rec 0 |-------------------------------------------------------------|
  15657. * rec 0 | retried MSDUs | successful MSDUs |
  15658. * rec 0 |-------------------------------------------------------------|
  15659. * rec 0 | TX duration | failed MSDUs |
  15660. * rec 0 |-------------------------------------------------------------|
  15661. * ...
  15662. * |-------------------------------------------------------------|
  15663. * rec N | TLV header |
  15664. * rec N |-------------------------------------------------------------|
  15665. * rec N | ppdu successful bytes |
  15666. * rec N |-------------------------------------------------------------|
  15667. * rec N | ppdu retry bytes |
  15668. * rec N |-------------------------------------------------------------|
  15669. * rec N | ppdu failed bytes |
  15670. * rec N |-------------------------------------------------------------|
  15671. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15672. * rec N |-------------------------------------------------------------|
  15673. * rec N | retried MSDUs | successful MSDUs |
  15674. * rec N |-------------------------------------------------------------|
  15675. * rec N | TX duration | failed MSDUs |
  15676. * rec N |-------------------------------------------------------------|
  15677. *
  15678. * where:
  15679. * A = is A-MPDU flag
  15680. * BA = block-ack failure flags
  15681. * BW = bandwidth spec
  15682. * SG = SGI enabled spec
  15683. * S = skipped rate ctrl
  15684. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15685. *
  15686. * Header
  15687. * ------
  15688. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15689. * dword0 - b'8:31 - reserved : Reserved for future use
  15690. *
  15691. * payload include below peer_stats information
  15692. * --------------------------------------------
  15693. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15694. * @tx_success_bytes : total successful bytes in the PPDU.
  15695. * @tx_retry_bytes : total retried bytes in the PPDU.
  15696. * @tx_failed_bytes : total failed bytes in the PPDU.
  15697. * @tx_ratecode : rate code used for the PPDU.
  15698. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15699. * @ba_ack_failed : BA/ACK failed for this PPDU
  15700. * b00 -> BA received
  15701. * b01 -> BA failed once
  15702. * b10 -> BA failed twice, when HW retry is enabled.
  15703. * @bw : BW
  15704. * b00 -> 20 MHz
  15705. * b01 -> 40 MHz
  15706. * b10 -> 80 MHz
  15707. * b11 -> 160 MHz (or 80+80)
  15708. * @sg : SGI enabled
  15709. * @s : skipped ratectrl
  15710. * @peer_id : peer id
  15711. * @tx_success_msdus : successful MSDUs
  15712. * @tx_retry_msdus : retried MSDUs
  15713. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15714. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15715. */
  15716. /**
  15717. * @brief target -> host backpressure event
  15718. *
  15719. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15720. *
  15721. * @details
  15722. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15723. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15724. * This message will only be sent if the backpressure condition has existed
  15725. * continuously for an initial period (100 ms).
  15726. * Repeat messages with updated information will be sent after each
  15727. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15728. * This message indicates the ring id along with current head and tail index
  15729. * locations (i.e. write and read indices).
  15730. * The backpressure time indicates the time in ms for which continuous
  15731. * backpressure has been observed in the ring.
  15732. *
  15733. * The message format is as follows:
  15734. *
  15735. * |31 24|23 16|15 8|7 0|
  15736. * |----------------+----------------+----------------+----------------|
  15737. * | ring_id | ring_type | pdev_id | msg_type |
  15738. * |-------------------------------------------------------------------|
  15739. * | tail_idx | head_idx |
  15740. * |-------------------------------------------------------------------|
  15741. * | backpressure_time_ms |
  15742. * |-------------------------------------------------------------------|
  15743. *
  15744. * The message is interpreted as follows:
  15745. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15746. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15747. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15748. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15749. * the msg is for LMAC ring.
  15750. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15751. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15752. * htt_backpressure_lmac_ring_id. This represents
  15753. * the ring id for which continuous backpressure
  15754. * is seen
  15755. *
  15756. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15757. * the ring indicated by the ring_id
  15758. *
  15759. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15760. * the ring indicated by the ring id
  15761. *
  15762. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  15763. * backpressure has been seen in the ring
  15764. * indicated by the ring_id.
  15765. * Units = milliseconds
  15766. */
  15767. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15768. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15769. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15770. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15771. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15772. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15773. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15774. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15775. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15776. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15777. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15778. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15779. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15780. do { \
  15781. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15782. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15783. } while (0)
  15784. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15785. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15786. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15787. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15788. do { \
  15789. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15790. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15791. } while (0)
  15792. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15793. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15794. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15795. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15796. do { \
  15797. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15798. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15799. } while (0)
  15800. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15801. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15802. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15803. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15804. do { \
  15805. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15806. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15807. } while (0)
  15808. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15809. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15810. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15811. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15812. do { \
  15813. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15814. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15815. } while (0)
  15816. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15817. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15818. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15819. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15820. do { \
  15821. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15822. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15823. } while (0)
  15824. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15825. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15826. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15827. enum htt_backpressure_ring_type {
  15828. HTT_SW_RING_TYPE_UMAC,
  15829. HTT_SW_RING_TYPE_LMAC,
  15830. HTT_SW_RING_TYPE_MAX,
  15831. };
  15832. /* Ring id for which the message is sent to host */
  15833. enum htt_backpressure_umac_ringid {
  15834. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15835. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15836. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15837. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15838. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15839. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15840. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15841. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15842. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15843. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15844. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15845. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15846. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15847. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15848. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15849. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15850. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15851. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15852. HTT_SW_UMAC_RING_IDX_MAX,
  15853. };
  15854. enum htt_backpressure_lmac_ringid {
  15855. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15856. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15857. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15858. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15859. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15860. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15861. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15862. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15863. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15864. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15865. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15866. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15867. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15868. HTT_SW_LMAC_RING_IDX_MAX,
  15869. };
  15870. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15871. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15872. pdev_id: 8,
  15873. ring_type: 8, /* htt_backpressure_ring_type */
  15874. /*
  15875. * ring_id holds an enum value from either
  15876. * htt_backpressure_umac_ringid or
  15877. * htt_backpressure_lmac_ringid, based on
  15878. * the ring_type setting.
  15879. */
  15880. ring_id: 8;
  15881. A_UINT16 head_idx;
  15882. A_UINT16 tail_idx;
  15883. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15884. } POSTPACK;
  15885. /*
  15886. * Defines two 32 bit words that can be used by the target to indicate a per
  15887. * user RU allocation and rate information.
  15888. *
  15889. * This information is currently provided in the "sw_response_reference_ptr"
  15890. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15891. * "rx_ppdu_end_user_stats" TLV.
  15892. *
  15893. * VALID:
  15894. * The consumer of these words must explicitly check the valid bit,
  15895. * and only attempt interpretation of any of the remaining fields if
  15896. * the valid bit is set to 1.
  15897. *
  15898. * VERSION:
  15899. * The consumer of these words must also explicitly check the version bit,
  15900. * and only use the V0 definition if the VERSION field is set to 0.
  15901. *
  15902. * Version 1 is currently undefined, with the exception of the VALID and
  15903. * VERSION fields.
  15904. *
  15905. * Version 0:
  15906. *
  15907. * The fields below are duplicated per BW.
  15908. *
  15909. * The consumer must determine which BW field to use, based on the UL OFDMA
  15910. * PPDU BW indicated by HW.
  15911. *
  15912. * RU_START: RU26 start index for the user.
  15913. * Note that this is always using the RU26 index, regardless
  15914. * of the actual RU assigned to the user
  15915. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15916. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15917. *
  15918. * For example, 20MHz (the value in the top row is RU_START)
  15919. *
  15920. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15921. * RU Size 1 (52): | | | | | |
  15922. * RU Size 2 (106): | | | |
  15923. * RU Size 3 (242): | |
  15924. *
  15925. * RU_SIZE: Indicates the RU size, as defined by enum
  15926. * htt_ul_ofdma_user_info_ru_size.
  15927. *
  15928. * LDPC: LDPC enabled (if 0, BCC is used)
  15929. *
  15930. * DCM: DCM enabled
  15931. *
  15932. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15933. * |---------------------------------+--------------------------------|
  15934. * |Ver|Valid| FW internal |
  15935. * |---------------------------------+--------------------------------|
  15936. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15937. * |---------------------------------+--------------------------------|
  15938. */
  15939. enum htt_ul_ofdma_user_info_ru_size {
  15940. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15941. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15942. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15943. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15944. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15945. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15946. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15947. };
  15948. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15949. struct htt_ul_ofdma_user_info_v0 {
  15950. A_UINT32 word0;
  15951. A_UINT32 word1;
  15952. };
  15953. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15954. A_UINT32 w0_fw_rsvd:30; \
  15955. A_UINT32 w0_valid:1; \
  15956. A_UINT32 w0_version:1;
  15957. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15958. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15959. };
  15960. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15961. A_UINT32 w1_nss:3; \
  15962. A_UINT32 w1_mcs:4; \
  15963. A_UINT32 w1_ldpc:1; \
  15964. A_UINT32 w1_dcm:1; \
  15965. A_UINT32 w1_ru_start:7; \
  15966. A_UINT32 w1_ru_size:3; \
  15967. A_UINT32 w1_trig_type:4; \
  15968. A_UINT32 w1_unused:9;
  15969. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15970. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15971. };
  15972. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15973. A_UINT32 w0_fw_rsvd:27; \
  15974. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15975. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15976. A_UINT32 w0_version:1; /* set to a value of “1” to indicate picking htt_ul_ofdma_user_info_v1_bitmap (field aligns with V0 definition) */
  15977. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15978. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15979. };
  15980. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15981. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15982. A_UINT32 w1_trig_type:4; \
  15983. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15984. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15985. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15986. };
  15987. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15988. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15989. union {
  15990. A_UINT32 word0;
  15991. struct {
  15992. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15993. };
  15994. };
  15995. union {
  15996. A_UINT32 word1;
  15997. struct {
  15998. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15999. };
  16000. };
  16001. } POSTPACK;
  16002. /*
  16003. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16004. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16005. * this should be picked.
  16006. */
  16007. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16008. union {
  16009. A_UINT32 word0;
  16010. struct {
  16011. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16012. };
  16013. };
  16014. union {
  16015. A_UINT32 word1;
  16016. struct {
  16017. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16018. };
  16019. };
  16020. } POSTPACK;
  16021. enum HTT_UL_OFDMA_TRIG_TYPE {
  16022. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16023. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16024. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16025. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16026. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16027. };
  16028. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16029. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16030. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16031. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16032. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16033. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16034. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16035. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16036. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16037. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16038. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16039. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16040. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16041. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16042. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16043. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16044. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16045. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16046. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16047. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16048. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16049. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16050. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16051. /*--- word 0 ---*/
  16052. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16053. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16054. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16055. do { \
  16056. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16057. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16058. } while (0)
  16059. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16060. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16061. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16062. do { \
  16063. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16064. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16065. } while (0)
  16066. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16067. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16068. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16069. do { \
  16070. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16071. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16072. } while (0)
  16073. /*--- word 1 ---*/
  16074. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16075. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16076. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16077. do { \
  16078. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16079. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16080. } while (0)
  16081. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16082. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16083. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16084. do { \
  16085. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16086. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16087. } while (0)
  16088. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16089. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16090. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16091. do { \
  16092. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16093. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16094. } while (0)
  16095. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16096. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16097. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16098. do { \
  16099. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16100. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16101. } while (0)
  16102. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16103. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16104. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16105. do { \
  16106. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16107. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16108. } while (0)
  16109. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16110. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16111. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16112. do { \
  16113. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16114. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16115. } while (0)
  16116. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16117. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16118. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16119. do { \
  16120. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16121. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16122. } while (0)
  16123. /**
  16124. * @brief target -> host channel calibration data message
  16125. *
  16126. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16127. *
  16128. * @brief host -> target channel calibration data message
  16129. *
  16130. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16131. *
  16132. * @details
  16133. * The following field definitions describe the format of the channel
  16134. * calibration data message sent from the target to the host when
  16135. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16136. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16137. * The message is defined as htt_chan_caldata_msg followed by a variable
  16138. * number of 32-bit character values.
  16139. *
  16140. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16141. * |------------------------------------------------------------------|
  16142. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16143. * |------------------------------------------------------------------|
  16144. * | payload size | mhz |
  16145. * |------------------------------------------------------------------|
  16146. * | center frequency 2 | center frequency 1 |
  16147. * |------------------------------------------------------------------|
  16148. * | check sum |
  16149. * |------------------------------------------------------------------|
  16150. * | payload |
  16151. * |------------------------------------------------------------------|
  16152. * message info field:
  16153. * - MSG_TYPE
  16154. * Bits 7:0
  16155. * Purpose: identifies this as a channel calibration data message
  16156. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16157. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16158. * - SUB_TYPE
  16159. * Bits 11:8
  16160. * Purpose: T2H: indicates whether target is providing chan cal data
  16161. * to the host to store, or requesting that the host
  16162. * download previously-stored data.
  16163. * H2T: indicates whether the host is providing the requested
  16164. * channel cal data, or if it is rejecting the data
  16165. * request because it does not have the requested data.
  16166. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16167. * - CHKSUM_VALID
  16168. * Bit 12
  16169. * Purpose: indicates if the checksum field is valid
  16170. * value:
  16171. * - FRAG
  16172. * Bit 19:16
  16173. * Purpose: indicates the fragment index for message
  16174. * value: 0 for first fragment, 1 for second fragment, ...
  16175. * - APPEND
  16176. * Bit 20
  16177. * Purpose: indicates if this is the last fragment
  16178. * value: 0 = final fragment, 1 = more fragments will be appended
  16179. *
  16180. * channel and payload size field
  16181. * - MHZ
  16182. * Bits 15:0
  16183. * Purpose: indicates the channel primary frequency
  16184. * Value:
  16185. * - PAYLOAD_SIZE
  16186. * Bits 31:16
  16187. * Purpose: indicates the bytes of calibration data in payload
  16188. * Value:
  16189. *
  16190. * center frequency field
  16191. * - CENTER FREQUENCY 1
  16192. * Bits 15:0
  16193. * Purpose: indicates the channel center frequency
  16194. * Value: channel center frequency, in MHz units
  16195. * - CENTER FREQUENCY 2
  16196. * Bits 31:16
  16197. * Purpose: indicates the secondary channel center frequency,
  16198. * only for 11acvht 80plus80 mode
  16199. * Value: secondary channel center frequency, in MHz units, if applicable
  16200. *
  16201. * checksum field
  16202. * - CHECK_SUM
  16203. * Bits 31:0
  16204. * Purpose: check the payload data, it is just for this fragment.
  16205. * This is intended for the target to check that the channel
  16206. * calibration data returned by the host is the unmodified data
  16207. * that was previously provided to the host by the target.
  16208. * value: checksum of fragment payload
  16209. */
  16210. PREPACK struct htt_chan_caldata_msg {
  16211. /* DWORD 0: message info */
  16212. A_UINT32
  16213. msg_type: 8,
  16214. sub_type: 4 ,
  16215. chksum_valid: 1, /** 1:valid, 0:invalid */
  16216. reserved1: 3,
  16217. frag_idx: 4, /** fragment index for calibration data */
  16218. appending: 1, /** 0: no fragment appending,
  16219. * 1: extra fragment appending */
  16220. reserved2: 11;
  16221. /* DWORD 1: channel and payload size */
  16222. A_UINT32
  16223. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16224. payload_size: 16; /** unit: bytes */
  16225. /* DWORD 2: center frequency */
  16226. A_UINT32
  16227. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16228. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16229. * valid only for 11acvht 80plus80 mode */
  16230. /* DWORD 3: check sum */
  16231. A_UINT32 chksum;
  16232. /* variable length for calibration data */
  16233. A_UINT32 payload[1/* or more */];
  16234. } POSTPACK;
  16235. /* T2H SUBTYPE */
  16236. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16237. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16238. /* H2T SUBTYPE */
  16239. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16240. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16241. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16242. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16243. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16244. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16245. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16246. do { \
  16247. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16248. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16249. } while (0)
  16250. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16251. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16252. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16253. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16254. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16255. do { \
  16256. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16257. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16258. } while (0)
  16259. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16260. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16261. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16262. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16263. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16264. do { \
  16265. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16266. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16267. } while (0)
  16268. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16269. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16270. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16271. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16272. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16273. do { \
  16274. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16275. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16276. } while (0)
  16277. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16278. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16279. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16280. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16281. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16282. do { \
  16283. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16284. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16285. } while (0)
  16286. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16287. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16288. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16289. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16290. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16291. do { \
  16292. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16293. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16294. } while (0)
  16295. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16296. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16297. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16298. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16299. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16300. do { \
  16301. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16302. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16303. } while (0)
  16304. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16305. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16306. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16307. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16308. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16309. do { \
  16310. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16311. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16312. } while (0)
  16313. /**
  16314. * @brief target -> host FSE CMEM based send
  16315. *
  16316. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16317. *
  16318. * @details
  16319. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16320. * FSE placement in CMEM is enabled.
  16321. *
  16322. * This message sends the non-secure CMEM base address.
  16323. * It will be sent to host in response to message
  16324. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16325. * The message would appear as follows:
  16326. *
  16327. * |31 24|23 16|15 8|7 0|
  16328. * |----------------+----------------+----------------+----------------|
  16329. * | reserved | num_entries | msg_type |
  16330. * |----------------+----------------+----------------+----------------|
  16331. * | base_address_lo |
  16332. * |----------------+----------------+----------------+----------------|
  16333. * | base_address_hi |
  16334. * |-------------------------------------------------------------------|
  16335. *
  16336. * The message is interpreted as follows:
  16337. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16338. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16339. * b'8:15 - number_entries: Indicated the number of entries
  16340. * programmed.
  16341. * b'16:31 - reserved.
  16342. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16343. * CMEM base address
  16344. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16345. * CMEM base address
  16346. */
  16347. PREPACK struct htt_cmem_base_send_t {
  16348. A_UINT32 msg_type: 8,
  16349. num_entries: 8,
  16350. reserved: 16;
  16351. A_UINT32 base_address_lo;
  16352. A_UINT32 base_address_hi;
  16353. } POSTPACK;
  16354. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16355. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16356. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16357. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16358. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16359. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16360. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16361. do { \
  16362. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16363. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16364. } while (0)
  16365. /**
  16366. * @brief - HTT PPDU ID format
  16367. *
  16368. * @details
  16369. * The following field definitions describe the format of the PPDU ID.
  16370. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16371. *
  16372. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16373. * +--------------------------------------------------------------------------
  16374. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16375. * +--------------------------------------------------------------------------
  16376. *
  16377. * sch id :Schedule command id
  16378. * Bits [11 : 0] : monotonically increasing counter to track the
  16379. * PPDU posted to a specific transmit queue.
  16380. *
  16381. * hwq_id: Hardware Queue ID.
  16382. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16383. *
  16384. * mac_id: MAC ID
  16385. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16386. *
  16387. * seq_idx: Sequence index.
  16388. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16389. * a particular TXOP.
  16390. *
  16391. * tqm_cmd: HWSCH/TQM flag.
  16392. * Bit [23] : Always set to 0.
  16393. *
  16394. * seq_cmd_type: Sequence command type.
  16395. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16396. * Refer to enum HTT_STATS_FTYPE for values.
  16397. */
  16398. PREPACK struct htt_ppdu_id {
  16399. A_UINT32
  16400. sch_id: 12,
  16401. hwq_id: 5,
  16402. mac_id: 2,
  16403. seq_idx: 2,
  16404. reserved1: 2,
  16405. tqm_cmd: 1,
  16406. seq_cmd_type: 6,
  16407. reserved2: 2;
  16408. } POSTPACK;
  16409. #define HTT_PPDU_ID_SCH_ID_S 0
  16410. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16411. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16412. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16413. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16414. do { \
  16415. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16416. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16417. } while (0)
  16418. #define HTT_PPDU_ID_HWQ_ID_S 12
  16419. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16420. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16421. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16422. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16423. do { \
  16424. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16425. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16426. } while (0)
  16427. #define HTT_PPDU_ID_MAC_ID_S 17
  16428. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16429. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16430. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16431. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16432. do { \
  16433. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16434. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16435. } while (0)
  16436. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16437. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16438. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16439. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16440. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16441. do { \
  16442. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16443. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16444. } while (0)
  16445. #define HTT_PPDU_ID_TQM_CMD_S 23
  16446. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16447. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16448. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16449. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16450. do { \
  16451. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16452. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16453. } while (0)
  16454. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16455. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16456. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16457. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16458. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16459. do { \
  16460. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16461. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16462. } while (0)
  16463. /**
  16464. * @brief target -> RX PEER METADATA V0 format
  16465. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16466. * message from target, and will confirm to the target which peer metadata
  16467. * version to use in the wmi_init message.
  16468. *
  16469. * The following diagram shows the format of the RX PEER METADATA.
  16470. *
  16471. * |31 24|23 16|15 8|7 0|
  16472. * |-----------------------------------------------------------------------|
  16473. * | Reserved | VDEV ID | PEER ID |
  16474. * |-----------------------------------------------------------------------|
  16475. */
  16476. PREPACK struct htt_rx_peer_metadata_v0 {
  16477. A_UINT32
  16478. peer_id: 16,
  16479. vdev_id: 8,
  16480. reserved1: 8;
  16481. } POSTPACK;
  16482. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16483. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16484. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16485. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16486. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16487. do { \
  16488. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16489. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16490. } while (0)
  16491. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16492. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16493. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16494. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16495. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16496. do { \
  16497. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16498. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16499. } while (0)
  16500. /**
  16501. * @brief target -> RX PEER METADATA V1 format
  16502. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16503. * message from target, and will confirm to the target which peer metadata
  16504. * version to use in the wmi_init message.
  16505. *
  16506. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16507. *
  16508. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16509. * |---------------------------------------------------------------------------|
  16510. * |Rsvd2|CHIP ID|LMAC ID|VDEV ID|logical_link_id|ML PEER|SW PEER ID/ML PEER ID|
  16511. * |---------------------------------------------------------------------------|
  16512. */
  16513. PREPACK struct htt_rx_peer_metadata_v1 {
  16514. A_UINT32
  16515. peer_id: 13,
  16516. ml_peer_valid: 1,
  16517. logical_link_id: 2,
  16518. vdev_id: 8,
  16519. lmac_id: 2,
  16520. chip_id: 3,
  16521. reserved2: 3;
  16522. } POSTPACK;
  16523. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16524. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16525. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16526. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16527. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16528. do { \
  16529. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16530. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16531. } while (0)
  16532. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16533. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16534. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16535. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16536. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16537. do { \
  16538. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16539. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16540. } while (0)
  16541. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16542. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16543. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16544. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16545. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S 14
  16546. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M 0x0000c000
  16547. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_GET(_var) \
  16548. (((_var) & HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_M) >> HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)
  16549. #define HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_SET(_var, _val) \
  16550. do { \
  16551. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID, _val); \
  16552. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LOGICAL_LINK_ID_S)); \
  16553. } while (0)
  16554. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16555. do { \
  16556. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16557. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16558. } while (0)
  16559. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16560. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16561. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16562. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16563. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16564. do { \
  16565. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16566. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16567. } while (0)
  16568. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16569. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16570. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16571. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16572. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16573. do { \
  16574. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16575. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16576. } while (0)
  16577. /*
  16578. * In some systems, the host SW wants to specify priorities between
  16579. * different MSDU / flow queues within the same peer-TID.
  16580. * The below enums are used for the host to identify to the target
  16581. * which MSDU queue's priority it wants to adjust.
  16582. */
  16583. /*
  16584. * The MSDUQ index describe index of TCL HW, where each index is
  16585. * used for queuing particular types of MSDUs.
  16586. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16587. */
  16588. enum HTT_MSDUQ_INDEX {
  16589. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16590. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16591. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16592. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16593. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16594. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16595. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16596. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16597. HTT_MSDUQ_MAX_INDEX,
  16598. };
  16599. /* MSDU qtype definition */
  16600. enum HTT_MSDU_QTYPE {
  16601. /*
  16602. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16603. * relative priority. Instead, the relative priority of CRIT_0 versus
  16604. * CRIT_1 is controlled by the FW, through the configuration parameters
  16605. * it applies to the queues.
  16606. */
  16607. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16608. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16609. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16610. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16611. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16612. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16613. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16614. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16615. /* New MSDU_QTYPE should be added above this line */
  16616. /*
  16617. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16618. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16619. * any host/target message definitions. The QTYPE_MAX value can
  16620. * only be used internally within the host or within the target.
  16621. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16622. * it must regard the unexpected value as a default qtype value,
  16623. * or ignore it.
  16624. */
  16625. HTT_MSDU_QTYPE_MAX,
  16626. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16627. };
  16628. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16629. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16630. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16631. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16632. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16633. };
  16634. /**
  16635. * @brief target -> host mlo timestamp offset indication
  16636. *
  16637. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16638. *
  16639. * @details
  16640. * The following field definitions describe the format of the HTT target
  16641. * to host mlo timestamp offset indication message.
  16642. *
  16643. *
  16644. * |31 16|15 12|11 10|9 8|7 0 |
  16645. * |----------------------------------------------------------------------|
  16646. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16647. * |----------------------------------------------------------------------|
  16648. * | Sync time stamp lo in us |
  16649. * |----------------------------------------------------------------------|
  16650. * | Sync time stamp hi in us |
  16651. * |----------------------------------------------------------------------|
  16652. * | mlo time stamp offset lo in us |
  16653. * |----------------------------------------------------------------------|
  16654. * | mlo time stamp offset hi in us |
  16655. * |----------------------------------------------------------------------|
  16656. * | mlo time stamp offset clocks in clock ticks |
  16657. * |----------------------------------------------------------------------|
  16658. * |31 26|25 16|15 0 |
  16659. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16660. * | | compensation in clks | |
  16661. * |----------------------------------------------------------------------|
  16662. * |31 22|21 0 |
  16663. * | rsvd 3 | mlo time stamp comp timer period |
  16664. * |----------------------------------------------------------------------|
  16665. * The message is interpreted as follows:
  16666. *
  16667. * dword0 - b'0:7 - msg_type: This will be set to
  16668. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16669. * value: 0x28
  16670. *
  16671. * dword0 - b'9:8 - pdev_id
  16672. *
  16673. * dword0 - b'11:10 - chip_id
  16674. *
  16675. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16676. *
  16677. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16678. *
  16679. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16680. * which last sync interrupt was received
  16681. *
  16682. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16683. * which last sync interrupt was received
  16684. *
  16685. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16686. *
  16687. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16688. *
  16689. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16690. *
  16691. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16692. *
  16693. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16694. * for sub us resolution
  16695. *
  16696. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16697. *
  16698. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16699. * is applied, in us
  16700. *
  16701. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16702. */
  16703. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16704. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16705. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16706. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16707. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16708. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16709. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16710. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16711. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16712. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16713. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16714. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16715. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16716. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16717. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16718. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16719. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16720. do { \
  16721. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16722. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16723. } while (0)
  16724. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16725. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16726. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16727. do { \
  16728. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16729. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16730. } while (0)
  16731. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16732. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16733. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16734. do { \
  16735. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16736. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16737. } while (0)
  16738. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16739. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16740. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16741. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16742. do { \
  16743. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16744. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16745. } while (0)
  16746. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16747. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16748. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16749. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16750. do { \
  16751. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16752. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16753. } while (0)
  16754. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16755. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16756. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16757. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16758. do { \
  16759. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16760. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16761. } while (0)
  16762. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16763. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16764. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16765. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16766. do { \
  16767. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16768. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16769. } while (0)
  16770. typedef struct {
  16771. A_UINT32 msg_type: 8, /* bits 7:0 */
  16772. pdev_id: 2, /* bits 9:8 */
  16773. chip_id: 2, /* bits 11:10 */
  16774. reserved1: 4, /* bits 15:12 */
  16775. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16776. A_UINT32 sync_timestamp_lo_us;
  16777. A_UINT32 sync_timestamp_hi_us;
  16778. A_UINT32 mlo_timestamp_offset_lo_us;
  16779. A_UINT32 mlo_timestamp_offset_hi_us;
  16780. A_UINT32 mlo_timestamp_offset_clks;
  16781. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16782. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16783. reserved2: 6; /* bits 31:26 */
  16784. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16785. reserved3: 10; /* bits 31:22 */
  16786. } htt_t2h_mlo_offset_ind_t;
  16787. /*
  16788. * @brief target -> host VDEV TX RX STATS
  16789. *
  16790. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16791. *
  16792. * @details
  16793. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16794. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16795. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16796. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16797. * periodically by target even in the absence of any further HTT request
  16798. * messages from host.
  16799. *
  16800. * The message is formatted as follows:
  16801. *
  16802. * |31 16|15 8|7 0|
  16803. * |---------------------------------+----------------+----------------|
  16804. * | payload_size | pdev_id | msg_type |
  16805. * |---------------------------------+----------------+----------------|
  16806. * | reserved0 |
  16807. * |-------------------------------------------------------------------|
  16808. * | reserved1 |
  16809. * |-------------------------------------------------------------------|
  16810. * | reserved2 |
  16811. * |-------------------------------------------------------------------|
  16812. * | |
  16813. * | VDEV specific Tx Rx stats info |
  16814. * | |
  16815. * |-------------------------------------------------------------------|
  16816. *
  16817. * The message is interpreted as follows:
  16818. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16819. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16820. * b'8:15 - pdev_id
  16821. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16822. * message header fields (msg_type through reserved2)
  16823. * dword1 - b'0:31 - reserved0.
  16824. * dword2 - b'0:31 - reserved1.
  16825. * dword3 - b'0:31 - reserved2.
  16826. */
  16827. typedef struct {
  16828. A_UINT32 msg_type: 8,
  16829. pdev_id: 8,
  16830. payload_size: 16;
  16831. A_UINT32 reserved0;
  16832. A_UINT32 reserved1;
  16833. A_UINT32 reserved2;
  16834. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16835. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16836. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16837. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16838. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16839. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16840. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16841. do { \
  16842. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16843. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16844. } while (0)
  16845. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16846. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16847. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16848. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16849. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16850. do { \
  16851. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16852. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16853. } while (0)
  16854. /* SOC related stats */
  16855. typedef struct {
  16856. htt_tlv_hdr_t tlv_hdr;
  16857. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16858. * This can be due to either the peer is deleted or deletion is ongoing
  16859. * */
  16860. A_UINT32 inv_peers_msdu_drop_count_lo;
  16861. A_UINT32 inv_peers_msdu_drop_count_hi;
  16862. } htt_t2h_soc_txrx_stats_common_tlv;
  16863. /* VDEV HW Tx/Rx stats */
  16864. typedef struct {
  16865. htt_tlv_hdr_t tlv_hdr;
  16866. A_UINT32 vdev_id;
  16867. /* Rx msdu byte cnt */
  16868. A_UINT32 rx_msdu_byte_cnt_lo;
  16869. A_UINT32 rx_msdu_byte_cnt_hi;
  16870. /* Rx msdu cnt */
  16871. A_UINT32 rx_msdu_cnt_lo;
  16872. A_UINT32 rx_msdu_cnt_hi;
  16873. /* tx msdu byte cnt */
  16874. A_UINT32 tx_msdu_byte_cnt_lo;
  16875. A_UINT32 tx_msdu_byte_cnt_hi;
  16876. /* tx msdu cnt */
  16877. A_UINT32 tx_msdu_cnt_lo;
  16878. A_UINT32 tx_msdu_cnt_hi;
  16879. /* tx excessive retry discarded msdu cnt */
  16880. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16881. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16882. /* TX congestion ctrl msdu drop cnt */
  16883. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16884. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16885. /* discarded tx msdus cnt coz of time to live expiry */
  16886. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16887. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16888. /* tx excessive retry discarded msdu byte cnt */
  16889. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16890. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16891. /* TX congestion ctrl msdu drop byte cnt */
  16892. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16893. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16894. /* discarded tx msdus byte cnt coz of time to live expiry */
  16895. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16896. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16897. /* TQM bypass frame cnt */
  16898. A_UINT32 tqm_bypass_frame_cnt_lo;
  16899. A_UINT32 tqm_bypass_frame_cnt_hi;
  16900. /* TQM bypass byte cnt */
  16901. A_UINT32 tqm_bypass_byte_cnt_lo;
  16902. A_UINT32 tqm_bypass_byte_cnt_hi;
  16903. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16904. /*
  16905. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16906. *
  16907. * @details
  16908. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16909. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16910. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16911. * the default MSDU queues of each of the specified TIDs for the peer
  16912. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16913. * If the default MSDU queues of a given TID within the peer are not linked
  16914. * to a service class, the svc_class_id field for that TID will have a
  16915. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16916. * queues for that TID are not mapped to any service class.
  16917. *
  16918. * |31 16|15 8|7 0|
  16919. * |------------------------------+--------------+--------------|
  16920. * | peer ID | reserved | msg type |
  16921. * |------------------------------+--------------+------+-------|
  16922. * | reserved | svc class ID | TID |
  16923. * |------------------------------------------------------------|
  16924. * ...
  16925. * |------------------------------------------------------------|
  16926. * | reserved | svc class ID | TID |
  16927. * |------------------------------------------------------------|
  16928. * Header fields:
  16929. * dword0 - b'7:0 - msg_type: This will be set to
  16930. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16931. * b'31:16 - peer ID
  16932. * dword1 - b'7:0 - TID
  16933. * b'15:8 - svc class ID
  16934. * (dword2, etc. same format as dword1)
  16935. */
  16936. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16937. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16938. A_UINT32 msg_type :8,
  16939. reserved0 :8,
  16940. peer_id :16;
  16941. struct {
  16942. A_UINT32 tid :8,
  16943. svc_class_id :8,
  16944. reserved1 :16;
  16945. } tid_reports[1/*or more*/];
  16946. } POSTPACK;
  16947. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16948. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16949. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16950. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16951. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16952. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16953. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16954. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16955. do { \
  16956. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16957. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16958. } while (0)
  16959. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16960. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16961. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16962. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16963. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16964. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16965. do { \
  16966. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16967. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16968. } while (0)
  16969. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16970. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16971. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16972. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16973. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16974. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16975. do { \
  16976. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16977. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16978. } while (0)
  16979. /*
  16980. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16981. *
  16982. * @details
  16983. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16984. * flow if the flow is seen the associated service class is conveyed to the
  16985. * target via TCL Data Command. Target on the other hand internally creates the
  16986. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16987. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16988. * the newly created MSDUQ
  16989. *
  16990. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16991. * |------------------------------+------------------------+--------------|
  16992. * | peer ID | HTT qtype | msg type |
  16993. * |---------------------------------+--------------+--+---+-------+------|
  16994. * | reserved |AST list index|FO|WC | HLOS | remap|
  16995. * | | | | | TID | TID |
  16996. * |---------------------+------------------------------------------------|
  16997. * | reserved1 | tgt_opaque_id |
  16998. * |---------------------+------------------------------------------------|
  16999. *
  17000. * Header fields:
  17001. *
  17002. * dword0 - b'7:0 - msg_type: This will be set to
  17003. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  17004. * b'15:8 - HTT qtype
  17005. * b'31:16 - peer ID
  17006. *
  17007. * dword1 - b'3:0 - remap TID, as assigned in firmware
  17008. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  17009. * hlos_tid : Common to Lithium and Beryllium
  17010. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  17011. * TCL Data Command : Beryllium
  17012. * b10 - flow_override (FO), as sent by host in
  17013. * TCL Data Command: Beryllium
  17014. * b11:14 - ast_list_idx
  17015. * Array index into the list of extension AST entries
  17016. * (not the actual AST 16-bit index).
  17017. * The ast_list_idx is one-based, with the following
  17018. * range of values:
  17019. * - legacy targets supporting 16 user-defined
  17020. * MSDU queues: 1-2
  17021. * - legacy targets supporting 48 user-defined
  17022. * MSDU queues: 1-6
  17023. * - new targets: 0 (peer_id is used instead)
  17024. * Note that since ast_list_idx is one-based,
  17025. * the host will need to subtract 1 to use it as an
  17026. * index into a list of extension AST entries.
  17027. * b15:31 - reserved
  17028. *
  17029. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17030. * unique MSDUQ id in firmware
  17031. * b'24:31 - reserved1
  17032. */
  17033. PREPACK struct htt_t2h_sawf_msduq_event {
  17034. A_UINT32 msg_type : 8,
  17035. htt_qtype : 8,
  17036. peer_id :16;
  17037. A_UINT32 remap_tid : 4,
  17038. hlos_tid : 4,
  17039. who_classify_info_sel : 2,
  17040. flow_override : 1,
  17041. ast_list_idx : 4,
  17042. reserved :17;
  17043. A_UINT32 tgt_opaque_id :24,
  17044. reserved1 : 8;
  17045. } POSTPACK;
  17046. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17047. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17048. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17049. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17050. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17051. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17052. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17053. do { \
  17054. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17055. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17056. } while (0)
  17057. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17058. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17059. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17060. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17061. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17062. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17063. do { \
  17064. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17065. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17066. } while (0)
  17067. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17068. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17069. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17070. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17071. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17072. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17073. do { \
  17074. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17075. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17076. } while (0)
  17077. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17078. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17079. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17080. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17081. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17082. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17083. do { \
  17084. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17085. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17086. } while (0)
  17087. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17088. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17089. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17090. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17091. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17092. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17093. do { \
  17094. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17095. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17096. } while (0)
  17097. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17098. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17099. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17100. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17101. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17102. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17103. do { \
  17104. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17105. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17106. } while (0)
  17107. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17108. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17109. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17110. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17111. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17112. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17113. do { \
  17114. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17115. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17116. } while (0)
  17117. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17118. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17119. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17120. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17121. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17122. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17123. do { \
  17124. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17125. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17126. } while (0)
  17127. /**
  17128. * @brief target -> PPDU id format indication
  17129. *
  17130. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17131. *
  17132. * @details
  17133. * The following field definitions describe the format of the HTT target
  17134. * to host PPDU ID format indication message.
  17135. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17136. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17137. * seq_idx :- Sequence control index of this PPDU.
  17138. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17139. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17140. * tqm_cmd:-
  17141. *
  17142. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17143. * |--------------------------------------------------+------------------------|
  17144. * | rsvd0 | msg type |
  17145. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17146. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17147. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17148. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17149. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17150. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17151. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17152. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17153. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17154. * Where: OF = bit offset, NB = number of bits, V = valid
  17155. * The message is interpreted as follows:
  17156. *
  17157. * dword0 - b'7:0 - msg_type: This will be set to
  17158. * HTT_T2H_PPDU_ID_FMT_IND
  17159. * value: 0x30
  17160. *
  17161. * dword0 - b'31:8 - reserved
  17162. *
  17163. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17164. *
  17165. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17166. *
  17167. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17168. *
  17169. * dword1 - b'15:11 - reserved for future use
  17170. *
  17171. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17172. *
  17173. * dword1 - b'21:17 - number of bits in ring_id
  17174. *
  17175. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17176. *
  17177. * dword1 - b'31:27 - reserved for future use
  17178. *
  17179. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17180. *
  17181. * dword2 - b'5:1 - number of bits in sequence index
  17182. *
  17183. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17184. *
  17185. * dword2 - b'15:11 - reserved for future use
  17186. *
  17187. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17188. *
  17189. * dword2 - b'21:17 - number of bits in link_id
  17190. *
  17191. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17192. *
  17193. * dword2 - b'31:27 - reserved for future use
  17194. *
  17195. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17196. *
  17197. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17198. *
  17199. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17200. *
  17201. * dword3 - b'15:11 - reserved for future use
  17202. *
  17203. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17204. *
  17205. * dword3 - b'21:17 - number of bits in tqm_cmd
  17206. *
  17207. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17208. *
  17209. * dword3 - b'31:27 - reserved for future use
  17210. *
  17211. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17212. *
  17213. * dword4 - b'5:1 - number of bits in mac_id
  17214. *
  17215. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17216. *
  17217. * dword4 - b'15:11 - reserved for future use
  17218. *
  17219. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17220. *
  17221. * dword4 - b'21:17 - number of bits in crc
  17222. *
  17223. * dword4 - b'26:22 - offset of crc (in number of bits)
  17224. *
  17225. * dword4 - b'31:27 - reserved for future use
  17226. *
  17227. */
  17228. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17229. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17230. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17231. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17232. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17233. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17234. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17235. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17236. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17237. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17238. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17239. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17240. /* macros for accessing lower 16 bits in dword */
  17241. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17242. do { \
  17243. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17244. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17245. } while (0)
  17246. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17247. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17248. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17249. do { \
  17250. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17251. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17252. } while (0)
  17253. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17254. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17255. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17256. do { \
  17257. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17258. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17259. } while (0)
  17260. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17261. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17262. /* macros for accessing upper 16 bits in dword */
  17263. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17264. do { \
  17265. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17266. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17267. } while (0)
  17268. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17269. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17270. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17271. do { \
  17272. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17273. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17274. } while (0)
  17275. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17276. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17277. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17278. do { \
  17279. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17280. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17281. } while (0)
  17282. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17283. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17284. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17285. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17286. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17287. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17288. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17289. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17290. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17291. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17292. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17293. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17294. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17295. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17296. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17297. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17298. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17299. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17300. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17301. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17302. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17303. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17304. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17305. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17306. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17307. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17308. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17309. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17310. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17311. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17312. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17313. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17314. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17315. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17316. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17317. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17318. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17319. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17320. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17321. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17322. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17323. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17324. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17325. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17326. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17327. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17328. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17329. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17330. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17331. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17332. /* offsets in number dwords */
  17333. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17334. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17335. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17336. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17337. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17338. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17339. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17340. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17341. typedef struct {
  17342. A_UINT32 msg_type: 8, /* bits 7:0 */
  17343. rsvd0: 24;/* bits 31:8 */
  17344. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17345. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17346. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17347. rsvd1: 5, /* bits 15:11 */
  17348. ring_id_valid: 1, /* bits 16:16 */
  17349. ring_id_bits: 5, /* bits 21:17 */
  17350. ring_id_offset: 5, /* bits 26:22 */
  17351. rsvd2: 5; /* bits 31:27 */
  17352. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17353. seq_idx_bits: 5, /* bits 5:1 */
  17354. seq_idx_offset: 5, /* bits 10:6 */
  17355. rsvd3: 5, /* bits 15:11 */
  17356. link_id_valid: 1, /* bits 16:16 */
  17357. link_id_bits: 5, /* bits 21:17 */
  17358. link_id_offset: 5, /* bits 26:22 */
  17359. rsvd4: 5; /* bits 31:27 */
  17360. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17361. seq_cmd_type_bits: 5, /* bits 5:1 */
  17362. seq_cmd_type_offset: 5, /* bits 10:6 */
  17363. rsvd5: 5, /* bits 15:11 */
  17364. tqm_cmd_valid: 1, /* bits 16:16 */
  17365. tqm_cmd_bits: 5, /* bits 21:17 */
  17366. tqm_cmd_offset: 5, /* bits 26:12 */
  17367. rsvd6: 5; /* bits 31:27 */
  17368. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17369. mac_id_bits: 5, /* bits 5:1 */
  17370. mac_id_offset: 5, /* bits 10:6 */
  17371. rsvd8: 5, /* bits 15:11 */
  17372. crc_valid: 1, /* bits 16:16 */
  17373. crc_bits: 5, /* bits 21:17 */
  17374. crc_offset: 5, /* bits 26:12 */
  17375. rsvd9: 5; /* bits 31:27 */
  17376. } htt_t2h_ppdu_id_fmt_ind_t;
  17377. #endif