htt.h 763 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. */
  215. #define HTT_CURRENT_VERSION_MAJOR 3
  216. #define HTT_CURRENT_VERSION_MINOR 95
  217. #define HTT_NUM_TX_FRAG_DESC 1024
  218. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  219. #define HTT_CHECK_SET_VAL(field, val) \
  220. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  221. /* macros to assist in sign-extending fields from HTT messages */
  222. #define HTT_SIGN_BIT_MASK(field) \
  223. ((field ## _M + (1 << field ## _S)) >> 1)
  224. #define HTT_SIGN_BIT(_val, field) \
  225. (_val & HTT_SIGN_BIT_MASK(field))
  226. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  227. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  228. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  229. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  230. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  231. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  232. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  233. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  234. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  235. /*
  236. * TEMPORARY:
  237. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  238. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  239. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  240. * updated.
  241. */
  242. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  243. /*
  244. * TEMPORARY:
  245. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  246. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  247. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  248. * updated.
  249. */
  250. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  251. /*
  252. * htt_dbg_stats_type -
  253. * bit positions for each stats type within a stats type bitmask
  254. * The bitmask contains 24 bits.
  255. */
  256. enum htt_dbg_stats_type {
  257. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  258. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  259. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  260. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  261. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  262. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  263. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  264. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  265. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  266. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  267. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  268. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  269. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  270. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  271. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  272. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  273. /* bits 16-23 currently reserved */
  274. /* keep this last */
  275. HTT_DBG_NUM_STATS
  276. };
  277. /*=== HTT option selection TLVs ===
  278. * Certain HTT messages have alternatives or options.
  279. * For such cases, the host and target need to agree on which option to use.
  280. * Option specification TLVs can be appended to the VERSION_REQ and
  281. * VERSION_CONF messages to select options other than the default.
  282. * These TLVs are entirely optional - if they are not provided, there is a
  283. * well-defined default for each option. If they are provided, they can be
  284. * provided in any order. Each TLV can be present or absent independent of
  285. * the presence / absence of other TLVs.
  286. *
  287. * The HTT option selection TLVs use the following format:
  288. * |31 16|15 8|7 0|
  289. * |---------------------------------+----------------+----------------|
  290. * | value (payload) | length | tag |
  291. * |-------------------------------------------------------------------|
  292. * The value portion need not be only 2 bytes; it can be extended by any
  293. * integer number of 4-byte units. The total length of the TLV, including
  294. * the tag and length fields, must be a multiple of 4 bytes. The length
  295. * field specifies the total TLV size in 4-byte units. Thus, the typical
  296. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  297. * field, would store 0x1 in its length field, to show that the TLV occupies
  298. * a single 4-byte unit.
  299. */
  300. /*--- TLV header format - applies to all HTT option TLVs ---*/
  301. enum HTT_OPTION_TLV_TAGS {
  302. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  303. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  304. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  305. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  306. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  307. };
  308. PREPACK struct htt_option_tlv_header_t {
  309. A_UINT8 tag;
  310. A_UINT8 length;
  311. } POSTPACK;
  312. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  313. #define HTT_OPTION_TLV_TAG_S 0
  314. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  315. #define HTT_OPTION_TLV_LENGTH_S 8
  316. /*
  317. * value0 - 16 bit value field stored in word0
  318. * The TLV's value field may be longer than 2 bytes, in which case
  319. * the remainder of the value is stored in word1, word2, etc.
  320. */
  321. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  322. #define HTT_OPTION_TLV_VALUE0_S 16
  323. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_TAG_GET(word) \
  329. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  330. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  336. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  337. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  343. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  344. /*--- format of specific HTT option TLVs ---*/
  345. /*
  346. * HTT option TLV for specifying LL bus address size
  347. * Some chips require bus addresses used by the target to access buffers
  348. * within the host's memory to be 32 bits; others require bus addresses
  349. * used by the target to access buffers within the host's memory to be
  350. * 64 bits.
  351. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  352. * a suffix to the VERSION_CONF message to specify which bus address format
  353. * the target requires.
  354. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  355. * default to providing bus addresses to the target in 32-bit format.
  356. */
  357. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  359. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  360. };
  361. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  362. struct htt_option_tlv_header_t hdr;
  363. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  364. } POSTPACK;
  365. /*
  366. * HTT option TLV for specifying whether HL systems should indicate
  367. * over-the-air tx completion for individual frames, or should instead
  368. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  369. * requests an OTA tx completion for a particular tx frame.
  370. * This option does not apply to LL systems, where the TX_COMPL_IND
  371. * is mandatory.
  372. * This option is primarily intended for HL systems in which the tx frame
  373. * downloads over the host --> target bus are as slow as or slower than
  374. * the transmissions over the WLAN PHY. For cases where the bus is faster
  375. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  376. * and consquently will send one TX_COMPL_IND message that covers several
  377. * tx frames. For cases where the WLAN PHY is faster than the bus,
  378. * the target will end up transmitting very short A-MPDUs, and consequently
  379. * sending many TX_COMPL_IND messages, which each cover a very small number
  380. * of tx frames.
  381. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  382. * a suffix to the VERSION_REQ message to request whether the host desires to
  383. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  384. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  385. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  386. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  387. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  388. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  389. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  390. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  391. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  392. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  393. * TLV.
  394. */
  395. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  396. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  397. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  398. };
  399. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  400. struct htt_option_tlv_header_t hdr;
  401. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  402. } POSTPACK;
  403. /*
  404. * HTT option TLV for specifying how many tx queue groups the target
  405. * may establish.
  406. * This TLV specifies the maximum value the target may send in the
  407. * txq_group_id field of any TXQ_GROUP information elements sent by
  408. * the target to the host. This allows the host to pre-allocate an
  409. * appropriate number of tx queue group structs.
  410. *
  411. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  412. * a suffix to the VERSION_REQ message to specify whether the host supports
  413. * tx queue groups at all, and if so if there is any limit on the number of
  414. * tx queue groups that the host supports.
  415. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  416. * a suffix to the VERSION_CONF message. If the host has specified in the
  417. * VER_REQ message a limit on the number of tx queue groups the host can
  418. * supprt, the target shall limit its specification of the maximum tx groups
  419. * to be no larger than this host-specified limit.
  420. *
  421. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  422. * shall preallocate 4 tx queue group structs, and the target shall not
  423. * specify a txq_group_id larger than 3.
  424. */
  425. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  426. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  427. /*
  428. * values 1 through N specify the max number of tx queue groups
  429. * the sender supports
  430. */
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  432. };
  433. /* TEMPORARY backwards-compatibility alias for a typo fix -
  434. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  435. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  436. * to support the old name (with the typo) until all references to the
  437. * old name are replaced with the new name.
  438. */
  439. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  440. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  441. struct htt_option_tlv_header_t hdr;
  442. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  443. } POSTPACK;
  444. /*
  445. * HTT option TLV for specifying whether the target supports an extended
  446. * version of the HTT tx descriptor. If the target provides this TLV
  447. * and specifies in the TLV that the target supports an extended version
  448. * of the HTT tx descriptor, the target must check the "extension" bit in
  449. * the HTT tx descriptor, and if the extension bit is set, to expect a
  450. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  451. * descriptor. Furthermore, the target must provide room for the HTT
  452. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  453. * This option is intended for systems where the host needs to explicitly
  454. * control the transmission parameters such as tx power for individual
  455. * tx frames.
  456. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  457. * as a suffix to the VERSION_CONF message to explicitly specify whether
  458. * the target supports the HTT tx MSDU extension descriptor.
  459. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  460. * by the host as lack of target support for the HTT tx MSDU extension
  461. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  462. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  463. * the HTT tx MSDU extension descriptor.
  464. * The host is not required to provide the HTT tx MSDU extension descriptor
  465. * just because the target supports it; the target must check the
  466. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  467. * extension descriptor is present.
  468. */
  469. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  471. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  472. };
  473. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  474. struct htt_option_tlv_header_t hdr;
  475. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  476. } POSTPACK;
  477. typedef struct {
  478. union {
  479. /* BIT [11 : 0] :- tag
  480. * BIT [23 : 12] :- length
  481. * BIT [31 : 24] :- reserved
  482. */
  483. A_UINT32 tag__length;
  484. /*
  485. * The following struct is not endian-portable.
  486. * It is suitable for use within the target, which is known to be
  487. * little-endian.
  488. * The host should use the above endian-portable macros to access
  489. * the tag and length bitfields in an endian-neutral manner.
  490. */
  491. struct {
  492. A_UINT32 tag : 12, /* BIT [11 : 0] */
  493. length : 12, /* BIT [23 : 12] */
  494. reserved : 8; /* BIT [31 : 24] */
  495. };
  496. };
  497. } htt_tlv_hdr_t;
  498. typedef enum {
  499. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  500. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  501. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  502. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  503. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  504. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  505. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  506. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  507. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  508. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  509. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  510. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  511. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  512. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  513. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  514. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  515. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  516. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  517. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  518. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  519. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  520. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  521. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  522. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  523. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  524. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  525. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  526. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  527. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  528. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  529. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  530. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  531. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  532. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  533. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  534. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  535. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  536. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  537. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  538. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  539. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  540. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  541. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  542. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  543. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  544. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  545. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  546. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  547. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  549. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  550. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  551. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  552. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  553. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  554. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  555. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  556. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  557. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  558. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  559. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  560. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  561. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  562. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  563. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  564. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  565. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  566. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  567. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  568. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  569. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  570. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  571. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  572. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  573. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  574. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  575. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  576. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  577. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  578. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  579. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  580. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  581. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  582. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  583. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  584. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  585. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  586. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  587. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  588. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  589. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  590. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  591. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  592. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  593. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  594. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  595. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  596. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  597. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  598. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  599. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  600. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  601. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  602. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  603. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  604. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  605. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  606. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  607. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  608. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  609. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  610. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  612. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  613. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  615. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  616. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  617. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  618. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  619. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  620. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  621. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  622. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  623. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  624. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  625. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  626. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  627. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  628. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  629. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  630. HTT_STATS_MAX_TAG,
  631. } htt_tlv_tag_t;
  632. #define HTT_STATS_TLV_TAG_M 0x00000fff
  633. #define HTT_STATS_TLV_TAG_S 0
  634. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  635. #define HTT_STATS_TLV_LENGTH_S 12
  636. #define HTT_STATS_TLV_TAG_GET(_var) \
  637. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  638. HTT_STATS_TLV_TAG_S)
  639. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  640. do { \
  641. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  642. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  643. } while (0)
  644. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  645. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  646. HTT_STATS_TLV_LENGTH_S)
  647. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  648. do { \
  649. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  650. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  651. } while (0)
  652. /*=== host -> target messages ===============================================*/
  653. enum htt_h2t_msg_type {
  654. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  655. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  656. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  657. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  658. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  659. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  660. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  661. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  662. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  663. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  664. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  665. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  666. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  667. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  668. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  669. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  670. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  671. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  672. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  673. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  674. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  675. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  676. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  677. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  678. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  679. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  680. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  681. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  682. /* keep this last */
  683. HTT_H2T_NUM_MSGS
  684. };
  685. /*
  686. * HTT host to target message type -
  687. * stored in bits 7:0 of the first word of the message
  688. */
  689. #define HTT_H2T_MSG_TYPE_M 0xff
  690. #define HTT_H2T_MSG_TYPE_S 0
  691. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  692. do { \
  693. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  694. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  695. } while (0)
  696. #define HTT_H2T_MSG_TYPE_GET(word) \
  697. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  698. /**
  699. * @brief host -> target version number request message definition
  700. *
  701. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  702. *
  703. *
  704. * |31 24|23 16|15 8|7 0|
  705. * |----------------+----------------+----------------+----------------|
  706. * | reserved | msg type |
  707. * |-------------------------------------------------------------------|
  708. * : option request TLV (optional) |
  709. * :...................................................................:
  710. *
  711. * The VER_REQ message may consist of a single 4-byte word, or may be
  712. * extended with TLVs that specify which HTT options the host is requesting
  713. * from the target.
  714. * The following option TLVs may be appended to the VER_REQ message:
  715. * - HL_SUPPRESS_TX_COMPL_IND
  716. * - HL_MAX_TX_QUEUE_GROUPS
  717. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  718. * may be appended to the VER_REQ message (but only one TLV of each type).
  719. *
  720. * Header fields:
  721. * - MSG_TYPE
  722. * Bits 7:0
  723. * Purpose: identifies this as a version number request message
  724. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  725. */
  726. #define HTT_VER_REQ_BYTES 4
  727. /* TBDXXX: figure out a reasonable number */
  728. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  729. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  730. /**
  731. * @brief HTT tx MSDU descriptor
  732. *
  733. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  734. *
  735. * @details
  736. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  737. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  738. * the target firmware needs for the FW's tx processing, particularly
  739. * for creating the HW msdu descriptor.
  740. * The same HTT tx descriptor is used for HL and LL systems, though
  741. * a few fields within the tx descriptor are used only by LL or
  742. * only by HL.
  743. * The HTT tx descriptor is defined in two manners: by a struct with
  744. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  745. * definitions.
  746. * The target should use the struct def, for simplicitly and clarity,
  747. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  748. * neutral. Specifically, the host shall use the get/set macros built
  749. * around the mask + shift defs.
  750. */
  751. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  752. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  753. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  754. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  755. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  756. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  757. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  758. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  759. #define HTT_TX_VDEV_ID_WORD 0
  760. #define HTT_TX_VDEV_ID_MASK 0x3f
  761. #define HTT_TX_VDEV_ID_SHIFT 16
  762. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  763. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  764. #define HTT_TX_MSDU_LEN_DWORD 1
  765. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  766. /*
  767. * HTT_VAR_PADDR macros
  768. * Allow physical / bus addresses to be either a single 32-bit value,
  769. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  770. */
  771. #define HTT_VAR_PADDR32(var_name) \
  772. A_UINT32 var_name
  773. #define HTT_VAR_PADDR64_LE(var_name) \
  774. struct { \
  775. /* little-endian: lo precedes hi */ \
  776. A_UINT32 lo; \
  777. A_UINT32 hi; \
  778. } var_name
  779. /*
  780. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  781. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  782. * addresses are stored in a XXX-bit field.
  783. * This macro is used to define both htt_tx_msdu_desc32_t and
  784. * htt_tx_msdu_desc64_t structs.
  785. */
  786. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  787. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  788. { \
  789. /* DWORD 0: flags and meta-data */ \
  790. A_UINT32 \
  791. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  792. \
  793. /* pkt_subtype - \
  794. * Detailed specification of the tx frame contents, extending the \
  795. * general specification provided by pkt_type. \
  796. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  797. * pkt_type | pkt_subtype \
  798. * ============================================================== \
  799. * 802.3 | bit 0:3 - Reserved \
  800. * | bit 4: 0x0 - Copy-Engine Classification Results \
  801. * | not appended to the HTT message \
  802. * | 0x1 - Copy-Engine Classification Results \
  803. * | appended to the HTT message in the \
  804. * | format: \
  805. * | [HTT tx desc, frame header, \
  806. * | CE classification results] \
  807. * | The CE classification results begin \
  808. * | at the next 4-byte boundary after \
  809. * | the frame header. \
  810. * ------------+------------------------------------------------- \
  811. * Eth2 | bit 0:3 - Reserved \
  812. * | bit 4: 0x0 - Copy-Engine Classification Results \
  813. * | not appended to the HTT message \
  814. * | 0x1 - Copy-Engine Classification Results \
  815. * | appended to the HTT message. \
  816. * | See the above specification of the \
  817. * | CE classification results location. \
  818. * ------------+------------------------------------------------- \
  819. * native WiFi | bit 0:3 - Reserved \
  820. * | bit 4: 0x0 - Copy-Engine Classification Results \
  821. * | not appended to the HTT message \
  822. * | 0x1 - Copy-Engine Classification Results \
  823. * | appended to the HTT message. \
  824. * | See the above specification of the \
  825. * | CE classification results location. \
  826. * ------------+------------------------------------------------- \
  827. * mgmt | 0x0 - 802.11 MAC header absent \
  828. * | 0x1 - 802.11 MAC header present \
  829. * ------------+------------------------------------------------- \
  830. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  831. * | 0x1 - 802.11 MAC header present \
  832. * | bit 1: 0x0 - allow aggregation \
  833. * | 0x1 - don't allow aggregation \
  834. * | bit 2: 0x0 - perform encryption \
  835. * | 0x1 - don't perform encryption \
  836. * | bit 3: 0x0 - perform tx classification / queuing \
  837. * | 0x1 - don't perform tx classification; \
  838. * | insert the frame into the "misc" \
  839. * | tx queue \
  840. * | bit 4: 0x0 - Copy-Engine Classification Results \
  841. * | not appended to the HTT message \
  842. * | 0x1 - Copy-Engine Classification Results \
  843. * | appended to the HTT message. \
  844. * | See the above specification of the \
  845. * | CE classification results location. \
  846. */ \
  847. pkt_subtype: 5, \
  848. \
  849. /* pkt_type - \
  850. * General specification of the tx frame contents. \
  851. * The htt_pkt_type enum should be used to specify and check the \
  852. * value of this field. \
  853. */ \
  854. pkt_type: 3, \
  855. \
  856. /* vdev_id - \
  857. * ID for the vdev that is sending this tx frame. \
  858. * For certain non-standard packet types, e.g. pkt_type == raw \
  859. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  860. * This field is used primarily for determining where to queue \
  861. * broadcast and multicast frames. \
  862. */ \
  863. vdev_id: 6, \
  864. /* ext_tid - \
  865. * The extended traffic ID. \
  866. * If the TID is unknown, the extended TID is set to \
  867. * HTT_TX_EXT_TID_INVALID. \
  868. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  869. * value of the QoS TID. \
  870. * If the tx frame is non-QoS data, then the extended TID is set to \
  871. * HTT_TX_EXT_TID_NON_QOS. \
  872. * If the tx frame is multicast or broadcast, then the extended TID \
  873. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  874. */ \
  875. ext_tid: 5, \
  876. \
  877. /* postponed - \
  878. * This flag indicates whether the tx frame has been downloaded to \
  879. * the target before but discarded by the target, and now is being \
  880. * downloaded again; or if this is a new frame that is being \
  881. * downloaded for the first time. \
  882. * This flag allows the target to determine the correct order for \
  883. * transmitting new vs. old frames. \
  884. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  885. * This flag only applies to HL systems, since in LL systems, \
  886. * the tx flow control is handled entirely within the target. \
  887. */ \
  888. postponed: 1, \
  889. \
  890. /* extension - \
  891. * This flag indicates whether a HTT tx MSDU extension descriptor \
  892. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  893. * \
  894. * 0x0 - no extension MSDU descriptor is present \
  895. * 0x1 - an extension MSDU descriptor immediately follows the \
  896. * regular MSDU descriptor \
  897. */ \
  898. extension: 1, \
  899. \
  900. /* cksum_offload - \
  901. * This flag indicates whether checksum offload is enabled or not \
  902. * for this frame. Target FW use this flag to turn on HW checksumming \
  903. * 0x0 - No checksum offload \
  904. * 0x1 - L3 header checksum only \
  905. * 0x2 - L4 checksum only \
  906. * 0x3 - L3 header checksum + L4 checksum \
  907. */ \
  908. cksum_offload: 2, \
  909. \
  910. /* tx_comp_req - \
  911. * This flag indicates whether Tx Completion \
  912. * from fw is required or not. \
  913. * This flag is only relevant if tx completion is not \
  914. * universally enabled. \
  915. * For all LL systems, tx completion is mandatory, \
  916. * so this flag will be irrelevant. \
  917. * For HL systems tx completion is optional, but HL systems in which \
  918. * the bus throughput exceeds the WLAN throughput will \
  919. * probably want to always use tx completion, and thus \
  920. * would not check this flag. \
  921. * This flag is required when tx completions are not used universally, \
  922. * but are still required for certain tx frames for which \
  923. * an OTA delivery acknowledgment is needed by the host. \
  924. * In practice, this would be for HL systems in which the \
  925. * bus throughput is less than the WLAN throughput. \
  926. * \
  927. * 0x0 - Tx Completion Indication from Fw not required \
  928. * 0x1 - Tx Completion Indication from Fw is required \
  929. */ \
  930. tx_compl_req: 1; \
  931. \
  932. \
  933. /* DWORD 1: MSDU length and ID */ \
  934. A_UINT32 \
  935. len: 16, /* MSDU length, in bytes */ \
  936. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  937. * and this id is used to calculate fragmentation \
  938. * descriptor pointer inside the target based on \
  939. * the base address, configured inside the target. \
  940. */ \
  941. \
  942. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  943. /* frags_desc_ptr - \
  944. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  945. * where the tx frame's fragments reside in memory. \
  946. * This field only applies to LL systems, since in HL systems the \
  947. * (degenerate single-fragment) fragmentation descriptor is created \
  948. * within the target. \
  949. */ \
  950. _paddr__frags_desc_ptr_; \
  951. \
  952. /* DWORD 3 (or 4): peerid, chanfreq */ \
  953. /* \
  954. * Peer ID : Target can use this value to know which peer-id packet \
  955. * destined to. \
  956. * It's intended to be specified by host in case of NAWDS. \
  957. */ \
  958. A_UINT16 peerid; \
  959. \
  960. /* \
  961. * Channel frequency: This identifies the desired channel \
  962. * frequency (in mhz) for tx frames. This is used by FW to help \
  963. * determine when it is safe to transmit or drop frames for \
  964. * off-channel operation. \
  965. * The default value of zero indicates to FW that the corresponding \
  966. * VDEV's home channel (if there is one) is the desired channel \
  967. * frequency. \
  968. */ \
  969. A_UINT16 chanfreq; \
  970. \
  971. /* Reason reserved is commented is increasing the htt structure size \
  972. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  973. * A_UINT32 reserved_dword3_bits0_31; \
  974. */ \
  975. } POSTPACK
  976. /* define a htt_tx_msdu_desc32_t type */
  977. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  978. /* define a htt_tx_msdu_desc64_t type */
  979. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  980. /*
  981. * Make htt_tx_msdu_desc_t be an alias for either
  982. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  983. */
  984. #if HTT_PADDR64
  985. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  986. #else
  987. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  988. #endif
  989. /* decriptor information for Management frame*/
  990. /*
  991. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  992. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  993. */
  994. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  995. extern A_UINT32 mgmt_hdr_len;
  996. PREPACK struct htt_mgmt_tx_desc_t {
  997. A_UINT32 msg_type;
  998. #if HTT_PADDR64
  999. A_UINT64 frag_paddr; /* DMAble address of the data */
  1000. #else
  1001. A_UINT32 frag_paddr; /* DMAble address of the data */
  1002. #endif
  1003. A_UINT32 desc_id; /* returned to host during completion
  1004. * to free the meory*/
  1005. A_UINT32 len; /* Fragment length */
  1006. A_UINT32 vdev_id; /* virtual device ID*/
  1007. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1008. } POSTPACK;
  1009. PREPACK struct htt_mgmt_tx_compl_ind {
  1010. A_UINT32 desc_id;
  1011. A_UINT32 status;
  1012. } POSTPACK;
  1013. /*
  1014. * This SDU header size comes from the summation of the following:
  1015. * 1. Max of:
  1016. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1017. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1018. * b. 802.11 header, for raw frames: 36 bytes
  1019. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1020. * QoS header, HT header)
  1021. * c. 802.3 header, for ethernet frames: 14 bytes
  1022. * (destination address, source address, ethertype / length)
  1023. * 2. Max of:
  1024. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1025. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1026. * 3. 802.1Q VLAN header: 4 bytes
  1027. * 4. LLC/SNAP header: 8 bytes
  1028. */
  1029. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1030. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1031. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1032. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1033. A_COMPILE_TIME_ASSERT(
  1034. htt_encap_hdr_size_max_check_nwifi,
  1035. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1036. A_COMPILE_TIME_ASSERT(
  1037. htt_encap_hdr_size_max_check_enet,
  1038. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1039. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1040. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1041. #define HTT_TX_HDR_SIZE_802_1Q 4
  1042. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1043. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1044. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1045. HTT_TX_HDR_SIZE_802_1Q + \
  1046. HTT_TX_HDR_SIZE_LLC_SNAP)
  1047. #define HTT_HL_TX_FRM_HDR_LEN \
  1048. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1049. #define HTT_LL_TX_FRM_HDR_LEN \
  1050. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1051. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1052. /* dword 0 */
  1053. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1054. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1055. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1056. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1057. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1058. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1059. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1060. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1061. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1062. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1063. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1064. #define HTT_TX_DESC_PKT_TYPE_S 13
  1065. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1066. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1067. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1068. #define HTT_TX_DESC_VDEV_ID_S 16
  1069. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1070. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1071. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1072. #define HTT_TX_DESC_EXT_TID_S 22
  1073. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1074. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1075. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1076. #define HTT_TX_DESC_POSTPONED_S 27
  1077. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1078. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1079. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1080. #define HTT_TX_DESC_EXTENSION_S 28
  1081. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1082. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1083. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1084. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1085. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1086. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1087. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1088. #define HTT_TX_DESC_TX_COMP_S 31
  1089. /* dword 1 */
  1090. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1091. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1092. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1093. #define HTT_TX_DESC_FRM_LEN_S 0
  1094. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1095. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1096. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1097. #define HTT_TX_DESC_FRM_ID_S 16
  1098. /* dword 2 */
  1099. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1100. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1101. /* for systems using 64-bit format for bus addresses */
  1102. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1103. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1104. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1105. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1106. /* for systems using 32-bit format for bus addresses */
  1107. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1109. /* dword 3 */
  1110. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1111. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1112. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1113. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1114. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1115. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1116. #if HTT_PADDR64
  1117. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1118. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1119. #else
  1120. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1121. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1122. #endif
  1123. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1124. #define HTT_TX_DESC_PEER_ID_S 0
  1125. /*
  1126. * TEMPORARY:
  1127. * The original definitions for the PEER_ID fields contained typos
  1128. * (with _DESC_PADDR appended to this PEER_ID field name).
  1129. * Retain deprecated original names for PEER_ID fields until all code that
  1130. * refers to them has been updated.
  1131. */
  1132. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1133. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1134. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1135. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1136. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1137. HTT_TX_DESC_PEER_ID_M
  1138. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1139. HTT_TX_DESC_PEER_ID_S
  1140. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1141. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1142. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1143. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1144. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1145. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1146. #if HTT_PADDR64
  1147. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1148. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1149. #else
  1150. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1151. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1152. #endif
  1153. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1154. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1155. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1156. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1157. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1158. do { \
  1159. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1160. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1161. } while (0)
  1162. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1163. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1164. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1165. do { \
  1166. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1167. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1168. } while (0)
  1169. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1170. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1171. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1172. do { \
  1173. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1174. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1175. } while (0)
  1176. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1177. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1178. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1179. do { \
  1180. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1181. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1182. } while (0)
  1183. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1184. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1185. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1186. do { \
  1187. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1188. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1189. } while (0)
  1190. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1191. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1192. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1193. do { \
  1194. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1195. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1196. } while (0)
  1197. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1198. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1199. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1200. do { \
  1201. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1202. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1203. } while (0)
  1204. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1205. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1206. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1207. do { \
  1208. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1209. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1210. } while (0)
  1211. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1212. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1213. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1214. do { \
  1215. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1216. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1217. } while (0)
  1218. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1219. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1220. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1221. do { \
  1222. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1223. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1224. } while (0)
  1225. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1226. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1227. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1228. do { \
  1229. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1230. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1231. } while (0)
  1232. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1233. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1234. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1235. do { \
  1236. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1237. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1238. } while (0)
  1239. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1240. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1241. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1242. do { \
  1243. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1244. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1245. } while (0)
  1246. /* enums used in the HTT tx MSDU extension descriptor */
  1247. enum {
  1248. htt_tx_guard_interval_regular = 0,
  1249. htt_tx_guard_interval_short = 1,
  1250. };
  1251. enum {
  1252. htt_tx_preamble_type_ofdm = 0,
  1253. htt_tx_preamble_type_cck = 1,
  1254. htt_tx_preamble_type_ht = 2,
  1255. htt_tx_preamble_type_vht = 3,
  1256. };
  1257. enum {
  1258. htt_tx_bandwidth_5MHz = 0,
  1259. htt_tx_bandwidth_10MHz = 1,
  1260. htt_tx_bandwidth_20MHz = 2,
  1261. htt_tx_bandwidth_40MHz = 3,
  1262. htt_tx_bandwidth_80MHz = 4,
  1263. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1264. };
  1265. /**
  1266. * @brief HTT tx MSDU extension descriptor
  1267. * @details
  1268. * If the target supports HTT tx MSDU extension descriptors, the host has
  1269. * the option of appending the following struct following the regular
  1270. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1271. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1272. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1273. * tx specs for each frame.
  1274. */
  1275. PREPACK struct htt_tx_msdu_desc_ext_t {
  1276. /* DWORD 0: flags */
  1277. A_UINT32
  1278. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1279. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1280. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1281. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1282. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1283. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1284. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1285. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1286. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1287. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1288. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1289. /* DWORD 1: tx power, tx rate, tx BW */
  1290. A_UINT32
  1291. /* pwr -
  1292. * Specify what power the tx frame needs to be transmitted at.
  1293. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1294. * The value needs to be appropriately sign-extended when extracting
  1295. * the value from the message and storing it in a variable that is
  1296. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1297. * automatically handles this sign-extension.)
  1298. * If the transmission uses multiple tx chains, this power spec is
  1299. * the total transmit power, assuming incoherent combination of
  1300. * per-chain power to produce the total power.
  1301. */
  1302. pwr: 8,
  1303. /* mcs_mask -
  1304. * Specify the allowable values for MCS index (modulation and coding)
  1305. * to use for transmitting the frame.
  1306. *
  1307. * For HT / VHT preamble types, this mask directly corresponds to
  1308. * the HT or VHT MCS indices that are allowed. For each bit N set
  1309. * within the mask, MCS index N is allowed for transmitting the frame.
  1310. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1311. * rates versus OFDM rates, so the host has the option of specifying
  1312. * that the target must transmit the frame with CCK or OFDM rates
  1313. * (not HT or VHT), but leaving the decision to the target whether
  1314. * to use CCK or OFDM.
  1315. *
  1316. * For CCK and OFDM, the bits within this mask are interpreted as
  1317. * follows:
  1318. * bit 0 -> CCK 1 Mbps rate is allowed
  1319. * bit 1 -> CCK 2 Mbps rate is allowed
  1320. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1321. * bit 3 -> CCK 11 Mbps rate is allowed
  1322. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1323. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1324. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1325. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1326. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1327. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1328. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1329. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1330. *
  1331. * The MCS index specification needs to be compatible with the
  1332. * bandwidth mask specification. For example, a MCS index == 9
  1333. * specification is inconsistent with a preamble type == VHT,
  1334. * Nss == 1, and channel bandwidth == 20 MHz.
  1335. *
  1336. * Furthermore, the host has only a limited ability to specify to
  1337. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1338. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1339. */
  1340. mcs_mask: 12,
  1341. /* nss_mask -
  1342. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1343. * Each bit in this mask corresponds to a Nss value:
  1344. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1345. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1346. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1347. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1348. * The values in the Nss mask must be suitable for the recipient, e.g.
  1349. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1350. * recipient which only supports 2x2 MIMO.
  1351. */
  1352. nss_mask: 4,
  1353. /* guard_interval -
  1354. * Specify a htt_tx_guard_interval enum value to indicate whether
  1355. * the transmission should use a regular guard interval or a
  1356. * short guard interval.
  1357. */
  1358. guard_interval: 1,
  1359. /* preamble_type_mask -
  1360. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1361. * may choose from for transmitting this frame.
  1362. * The bits in this mask correspond to the values in the
  1363. * htt_tx_preamble_type enum. For example, to allow the target
  1364. * to transmit the frame as either CCK or OFDM, this field would
  1365. * be set to
  1366. * (1 << htt_tx_preamble_type_ofdm) |
  1367. * (1 << htt_tx_preamble_type_cck)
  1368. */
  1369. preamble_type_mask: 4,
  1370. reserved1_31_29: 3; /* unused, set to 0x0 */
  1371. /* DWORD 2: tx chain mask, tx retries */
  1372. A_UINT32
  1373. /* chain_mask - specify which chains to transmit from */
  1374. chain_mask: 4,
  1375. /* retry_limit -
  1376. * Specify the maximum number of transmissions, including the
  1377. * initial transmission, to attempt before giving up if no ack
  1378. * is received.
  1379. * If the tx rate is specified, then all retries shall use the
  1380. * same rate as the initial transmission.
  1381. * If no tx rate is specified, the target can choose whether to
  1382. * retain the original rate during the retransmissions, or to
  1383. * fall back to a more robust rate.
  1384. */
  1385. retry_limit: 4,
  1386. /* bandwidth_mask -
  1387. * Specify what channel widths may be used for the transmission.
  1388. * A value of zero indicates "don't care" - the target may choose
  1389. * the transmission bandwidth.
  1390. * The bits within this mask correspond to the htt_tx_bandwidth
  1391. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1392. * The bandwidth_mask must be consistent with the preamble_type_mask
  1393. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1394. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1395. */
  1396. bandwidth_mask: 6,
  1397. reserved2_31_14: 18; /* unused, set to 0x0 */
  1398. /* DWORD 3: tx expiry time (TSF) LSBs */
  1399. A_UINT32 expire_tsf_lo;
  1400. /* DWORD 4: tx expiry time (TSF) MSBs */
  1401. A_UINT32 expire_tsf_hi;
  1402. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1403. } POSTPACK;
  1404. /* DWORD 0 */
  1405. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1406. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1407. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1408. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1409. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1410. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1425. /* DWORD 1 */
  1426. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1427. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1428. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1429. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1430. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1431. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1432. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1433. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1434. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1435. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1436. /* DWORD 2 */
  1437. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1438. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1439. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1440. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1441. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1442. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1443. /* DWORD 0 */
  1444. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1445. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1446. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1447. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1448. do { \
  1449. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1450. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1451. } while (0)
  1452. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1453. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1454. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1455. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1456. do { \
  1457. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1458. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1459. } while (0)
  1460. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1461. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1462. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1463. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1464. do { \
  1465. HTT_CHECK_SET_VAL( \
  1466. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1467. ((_var) |= ((_val) \
  1468. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1469. } while (0)
  1470. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1471. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1472. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1474. do { \
  1475. HTT_CHECK_SET_VAL( \
  1476. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1477. ((_var) |= ((_val) \
  1478. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1479. } while (0)
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1481. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1482. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1484. do { \
  1485. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1486. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1487. } while (0)
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1489. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1490. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1492. do { \
  1493. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1494. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1495. } while (0)
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1497. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1498. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1500. do { \
  1501. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1502. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1503. } while (0)
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1505. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1506. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1508. do { \
  1509. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1510. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1511. } while (0)
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1513. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1514. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1516. do { \
  1517. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1518. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1519. } while (0)
  1520. /* DWORD 1 */
  1521. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1522. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1523. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1524. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1525. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1526. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1527. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1528. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1529. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1530. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1531. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1532. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1533. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1534. do { \
  1535. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1536. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1537. } while (0)
  1538. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1539. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1540. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1541. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1542. do { \
  1543. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1544. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1545. } while (0)
  1546. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1547. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1548. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1549. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1550. do { \
  1551. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1552. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1553. } while (0)
  1554. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1555. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1556. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1557. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1558. do { \
  1559. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1560. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1561. } while (0)
  1562. /* DWORD 2 */
  1563. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1569. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1570. } while (0)
  1571. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1573. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1574. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1577. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1578. } while (0)
  1579. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1580. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1581. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1582. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1583. do { \
  1584. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1585. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1586. } while (0)
  1587. typedef enum {
  1588. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1589. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1590. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1591. } htt_11ax_ltf_subtype_t;
  1592. typedef enum {
  1593. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1594. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1595. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1596. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1597. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1598. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1599. } htt_tx_ext2_preamble_type_t;
  1600. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1603. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1604. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1607. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1608. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1612. /**
  1613. * @brief HTT tx MSDU extension descriptor v2
  1614. * @details
  1615. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1616. * is received as tcl_exit_base->host_meta_info in firmware.
  1617. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1618. * are already part of tcl_exit_base.
  1619. */
  1620. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1621. /* DWORD 0: flags */
  1622. A_UINT32
  1623. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1624. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1625. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1626. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1627. valid_retries : 1, /* if set, tx retries spec is valid */
  1628. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1629. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1630. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1631. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1632. valid_key_flags : 1, /* if set, key flags is valid */
  1633. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1634. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1635. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1636. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1637. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1638. 1 = ENCRYPT,
  1639. 2 ~ 3 - Reserved */
  1640. /* retry_limit -
  1641. * Specify the maximum number of transmissions, including the
  1642. * initial transmission, to attempt before giving up if no ack
  1643. * is received.
  1644. * If the tx rate is specified, then all retries shall use the
  1645. * same rate as the initial transmission.
  1646. * If no tx rate is specified, the target can choose whether to
  1647. * retain the original rate during the retransmissions, or to
  1648. * fall back to a more robust rate.
  1649. */
  1650. retry_limit : 4,
  1651. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1652. * Valid only for 11ax preamble types HE_SU
  1653. * and HE_EXT_SU
  1654. */
  1655. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1656. * Valid only for 11ax preamble types HE_SU
  1657. * and HE_EXT_SU
  1658. */
  1659. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1660. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1661. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1662. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1663. */
  1664. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1665. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1666. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1667. * Use cases:
  1668. * Any time firmware uses TQM-BYPASS for Data
  1669. * TID, firmware expect host to set this bit.
  1670. */
  1671. /* DWORD 1: tx power, tx rate */
  1672. A_UINT32
  1673. power : 8, /* unit of the power field is 0.5 dbm
  1674. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1675. * signed value ranging from -64dbm to 63.5 dbm
  1676. */
  1677. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1678. * Setting more than one MCS isn't currently
  1679. * supported by the target (but is supported
  1680. * in the interface in case in the future
  1681. * the target supports specifications of
  1682. * a limited set of MCS values.
  1683. */
  1684. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1685. * Setting more than one Nss isn't currently
  1686. * supported by the target (but is supported
  1687. * in the interface in case in the future
  1688. * the target supports specifications of
  1689. * a limited set of Nss values.
  1690. */
  1691. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1692. update_peer_cache : 1; /* When set these custom values will be
  1693. * used for all packets, until the next
  1694. * update via this ext header.
  1695. * This is to make sure not all packets
  1696. * need to include this header.
  1697. */
  1698. /* DWORD 2: tx chain mask, tx retries */
  1699. A_UINT32
  1700. /* chain_mask - specify which chains to transmit from */
  1701. chain_mask : 8,
  1702. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1703. * TODO: Update Enum values for key_flags
  1704. */
  1705. /*
  1706. * Channel frequency: This identifies the desired channel
  1707. * frequency (in MHz) for tx frames. This is used by FW to help
  1708. * determine when it is safe to transmit or drop frames for
  1709. * off-channel operation.
  1710. * The default value of zero indicates to FW that the corresponding
  1711. * VDEV's home channel (if there is one) is the desired channel
  1712. * frequency.
  1713. */
  1714. chanfreq : 16;
  1715. /* DWORD 3: tx expiry time (TSF) LSBs */
  1716. A_UINT32 expire_tsf_lo;
  1717. /* DWORD 4: tx expiry time (TSF) MSBs */
  1718. A_UINT32 expire_tsf_hi;
  1719. /* DWORD 5: flags to control routing / processing of the MSDU */
  1720. A_UINT32
  1721. /* learning_frame
  1722. * When this flag is set, this frame will be dropped by FW
  1723. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1724. */
  1725. learning_frame : 1,
  1726. /* send_as_standalone
  1727. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1728. * i.e. with no A-MSDU or A-MPDU aggregation.
  1729. * The scope is extended to other use-cases.
  1730. */
  1731. send_as_standalone : 1,
  1732. /* is_host_opaque_valid
  1733. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1734. * with valid information.
  1735. */
  1736. is_host_opaque_valid : 1,
  1737. rsvd0 : 29;
  1738. /* DWORD 6 : Host opaque cookie for special frames */
  1739. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1740. rsvd1 : 16;
  1741. /*
  1742. * This structure can be expanded further up to 40 bytes
  1743. * by adding further DWORDs as needed.
  1744. */
  1745. } POSTPACK;
  1746. /* DWORD 0 */
  1747. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1749. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1750. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1751. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1773. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1774. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1775. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1776. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1777. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1778. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1779. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1780. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1781. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1782. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1783. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1784. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1785. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1786. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1787. /* DWORD 1 */
  1788. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1789. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1790. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1791. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1792. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1793. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1794. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1795. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1796. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1797. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1798. /* DWORD 2 */
  1799. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1800. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1801. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1802. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1803. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1804. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1805. /* DWORD 5 */
  1806. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1807. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1808. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1809. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1810. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1811. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1812. /* DWORD 6 */
  1813. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1814. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1815. /* DWORD 0 */
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1817. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1818. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1820. do { \
  1821. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1822. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1823. } while (0)
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1825. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1826. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1828. do { \
  1829. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1830. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1831. } while (0)
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1833. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1834. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1836. do { \
  1837. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1838. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1839. } while (0)
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1841. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1842. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1844. do { \
  1845. HTT_CHECK_SET_VAL( \
  1846. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1847. ((_var) |= ((_val) \
  1848. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1849. } while (0)
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1851. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1852. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1854. do { \
  1855. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1856. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1857. } while (0)
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1859. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1860. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1862. do { \
  1863. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1864. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1865. } while (0)
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1867. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1868. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1870. do { \
  1871. HTT_CHECK_SET_VAL( \
  1872. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1873. ((_var) |= ((_val) \
  1874. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1875. } while (0)
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1877. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1878. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1880. do { \
  1881. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1882. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1883. } while (0)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1885. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1886. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1887. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1888. do { \
  1889. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1890. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1891. } while (0)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1893. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1894. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1896. do { \
  1897. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1898. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1899. } while (0)
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1901. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1902. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1903. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1904. do { \
  1905. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1906. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1907. } while (0)
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1909. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1910. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1912. do { \
  1913. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1914. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1915. } while (0)
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1917. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1918. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1920. do { \
  1921. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1922. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1923. } while (0)
  1924. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1925. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1926. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1927. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1931. } while (0)
  1932. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1933. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1934. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1935. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1938. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1939. } while (0)
  1940. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1941. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1942. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1943. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1944. do { \
  1945. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1946. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1947. } while (0)
  1948. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1949. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1950. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1951. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1954. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1955. } while (0)
  1956. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1957. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1958. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1959. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1963. } while (0)
  1964. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1965. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1966. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1967. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1970. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1971. } while (0)
  1972. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1973. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1974. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1975. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1976. do { \
  1977. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1978. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1979. } while (0)
  1980. /* DWORD 1 */
  1981. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1985. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1986. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1987. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1988. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1989. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1990. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1991. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1992. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1993. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1994. do { \
  1995. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1996. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1997. } while (0)
  1998. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  1999. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2000. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2001. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2002. do { \
  2003. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2004. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2005. } while (0)
  2006. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2007. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2008. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2009. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2010. do { \
  2011. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2012. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2013. } while (0)
  2014. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2015. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2016. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2017. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2018. do { \
  2019. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2020. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2021. } while (0)
  2022. /* DWORD 2 */
  2023. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2025. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2026. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2030. } while (0)
  2031. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2032. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2033. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2034. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2038. } while (0)
  2039. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2040. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2041. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2042. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2043. do { \
  2044. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2045. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2046. } while (0)
  2047. /* DWORD 5 */
  2048. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2055. } while (0)
  2056. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2057. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2058. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2059. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2063. } while (0)
  2064. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2065. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2066. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2067. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2071. } while (0)
  2072. /* DWORD 6 */
  2073. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2075. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2076. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2080. } while (0)
  2081. typedef enum {
  2082. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2083. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2084. } htt_tcl_metadata_type;
  2085. /**
  2086. * @brief HTT TCL command number format
  2087. * @details
  2088. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2089. * available to firmware as tcl_exit_base->tcl_status_number.
  2090. * For regular / multicast packets host will send vdev and mac id and for
  2091. * NAWDS packets, host will send peer id.
  2092. * A_UINT32 is used to avoid endianness conversion problems.
  2093. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2094. */
  2095. typedef struct {
  2096. A_UINT32
  2097. type: 1, /* vdev_id based or peer_id based */
  2098. rsvd: 31;
  2099. } htt_tx_tcl_vdev_or_peer_t;
  2100. typedef struct {
  2101. A_UINT32
  2102. type: 1, /* vdev_id based or peer_id based */
  2103. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2104. vdev_id: 8,
  2105. pdev_id: 2,
  2106. host_inspected:1,
  2107. rsvd: 19;
  2108. } htt_tx_tcl_vdev_metadata;
  2109. typedef struct {
  2110. A_UINT32
  2111. type: 1, /* vdev_id based or peer_id based */
  2112. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2113. peer_id: 14,
  2114. rsvd: 16;
  2115. } htt_tx_tcl_peer_metadata;
  2116. PREPACK struct htt_tx_tcl_metadata {
  2117. union {
  2118. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2119. htt_tx_tcl_vdev_metadata vdev_meta;
  2120. htt_tx_tcl_peer_metadata peer_meta;
  2121. };
  2122. } POSTPACK;
  2123. /* DWORD 0 */
  2124. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2125. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2126. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2127. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2128. /* VDEV metadata */
  2129. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2130. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2131. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2132. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2133. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2134. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2135. /* PEER metadata */
  2136. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2137. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2138. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2139. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2140. HTT_TX_TCL_METADATA_TYPE_S)
  2141. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2142. do { \
  2143. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2144. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2145. } while (0)
  2146. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2147. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2148. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2149. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2150. do { \
  2151. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2152. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2153. } while (0)
  2154. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2155. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2156. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2157. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2158. do { \
  2159. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2160. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2161. } while (0)
  2162. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2163. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2164. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2165. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2169. } while (0)
  2170. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2171. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2172. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2173. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2174. do { \
  2175. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2176. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2177. } while (0)
  2178. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2179. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2180. HTT_TX_TCL_METADATA_PEER_ID_S)
  2181. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2182. do { \
  2183. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2184. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2185. } while (0)
  2186. typedef enum {
  2187. HTT_TX_FW2WBM_TX_STATUS_OK,
  2188. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2189. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2190. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2191. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2192. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2193. HTT_TX_FW2WBM_TX_STATUS_MAX
  2194. } htt_tx_fw2wbm_tx_status_t;
  2195. typedef enum {
  2196. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2197. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2198. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2199. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2200. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2201. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2202. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2203. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2204. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2205. } htt_tx_fw2wbm_reinject_reason_t;
  2206. /**
  2207. * @brief HTT TX WBM Completion from firmware to host
  2208. * @details
  2209. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2210. * DWORD 3 and 4 for software based completions (Exception frames and
  2211. * TQM bypass frames)
  2212. * For software based completions, wbm_release_ring->release_source_module will
  2213. * be set to release_source_fw
  2214. */
  2215. PREPACK struct htt_tx_wbm_completion {
  2216. A_UINT32
  2217. sch_cmd_id: 24,
  2218. exception_frame: 1, /* If set, this packet was queued via exception path */
  2219. rsvd0_31_25: 7;
  2220. A_UINT32
  2221. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2222. * reception of an ACK or BA, this field indicates
  2223. * the RSSI of the received ACK or BA frame.
  2224. * When the frame is removed as result of a direct
  2225. * remove command from the SW, this field is set
  2226. * to 0x0 (which is never a valid value when real
  2227. * RSSI is available).
  2228. * Units: dB w.r.t noise floor
  2229. */
  2230. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2231. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2232. rsvd1_31_16: 16;
  2233. } POSTPACK;
  2234. /* DWORD 0 */
  2235. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2236. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2237. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2238. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2239. /* DWORD 1 */
  2240. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2241. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2242. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2243. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2244. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2245. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2246. /* DWORD 0 */
  2247. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2248. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2249. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2250. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2251. do { \
  2252. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2253. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2254. } while (0)
  2255. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2256. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2257. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2258. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2259. do { \
  2260. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2261. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2262. } while (0)
  2263. /* DWORD 1 */
  2264. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2265. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2266. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2267. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2268. do { \
  2269. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2270. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2271. } while (0)
  2272. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2273. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2274. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2275. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2276. do { \
  2277. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2278. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2279. } while (0)
  2280. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2281. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2282. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2283. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2284. do { \
  2285. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2286. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2287. } while (0)
  2288. /**
  2289. * @brief HTT TX WBM Completion from firmware to host
  2290. * @details
  2291. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2292. * (WBM) offload HW.
  2293. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2294. * For software based completions, release_source_module will
  2295. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2296. * struct wbm_release_ring and then switch to this after looking at
  2297. * release_source_module.
  2298. */
  2299. PREPACK struct htt_tx_wbm_completion_v2 {
  2300. A_UINT32
  2301. used_by_hw0; /* Refer to struct wbm_release_ring */
  2302. A_UINT32
  2303. used_by_hw1; /* Refer to struct wbm_release_ring */
  2304. A_UINT32
  2305. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2306. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2307. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2308. exception_frame: 1,
  2309. rsvd0: 12, /* For future use */
  2310. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2311. rsvd1: 1; /* For future use */
  2312. A_UINT32
  2313. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2314. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2315. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2316. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2317. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2318. */
  2319. A_UINT32
  2320. data1: 32;
  2321. A_UINT32
  2322. data2: 32;
  2323. A_UINT32
  2324. used_by_hw3; /* Refer to struct wbm_release_ring */
  2325. } POSTPACK;
  2326. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2327. /* DWORD 3 */
  2328. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2329. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2330. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2331. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2332. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2333. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2334. /* DWORD 3 */
  2335. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2336. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2337. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2338. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2339. do { \
  2340. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2341. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2342. } while (0)
  2343. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2344. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2345. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2346. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2349. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2350. } while (0)
  2351. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2352. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2353. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2354. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2355. do { \
  2356. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2357. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2358. } while (0)
  2359. /**
  2360. * @brief HTT TX WBM transmit status from firmware to host
  2361. * @details
  2362. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2363. * (WBM) offload HW.
  2364. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2365. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2366. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2367. */
  2368. PREPACK struct htt_tx_wbm_transmit_status {
  2369. A_UINT32
  2370. sch_cmd_id: 24,
  2371. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2372. * reception of an ACK or BA, this field indicates
  2373. * the RSSI of the received ACK or BA frame.
  2374. * When the frame is removed as result of a direct
  2375. * remove command from the SW, this field is set
  2376. * to 0x0 (which is never a valid value when real
  2377. * RSSI is available).
  2378. * Units: dB w.r.t noise floor
  2379. */
  2380. A_UINT32
  2381. sw_peer_id: 16,
  2382. tid_num: 5,
  2383. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2384. * and tid_num fields contain valid data.
  2385. * If this "valid" flag is not set, the
  2386. * sw_peer_id and tid_num fields must be ignored.
  2387. */
  2388. mcast: 1,
  2389. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2390. * contains valid data.
  2391. */
  2392. reserved0: 8;
  2393. A_UINT32
  2394. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2395. * packets in the wbm completion path
  2396. */
  2397. } POSTPACK;
  2398. /* DWORD 4 */
  2399. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2400. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2401. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2402. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2403. /* DWORD 5 */
  2404. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2405. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2406. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2407. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2408. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2409. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2410. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2411. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2412. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2413. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2414. /* DWORD 4 */
  2415. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2416. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2417. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2418. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2419. do { \
  2420. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2421. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2422. } while (0)
  2423. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2424. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2425. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2426. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2427. do { \
  2428. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2429. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2430. } while (0)
  2431. /* DWORD 5 */
  2432. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2433. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2434. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2435. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2436. do { \
  2437. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2438. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2439. } while (0)
  2440. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2441. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2442. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2443. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2444. do { \
  2445. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2446. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2447. } while (0)
  2448. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2449. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2450. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2451. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2452. do { \
  2453. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2454. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2455. } while (0)
  2456. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2457. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2458. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2459. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2460. do { \
  2461. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2462. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2463. } while (0)
  2464. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2465. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2466. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2467. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2468. do { \
  2469. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2470. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2471. } while (0)
  2472. /**
  2473. * @brief HTT TX WBM reinject status from firmware to host
  2474. * @details
  2475. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2476. * (WBM) offload HW.
  2477. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2478. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2479. */
  2480. PREPACK struct htt_tx_wbm_reinject_status {
  2481. A_UINT32
  2482. reserved0: 32;
  2483. A_UINT32
  2484. reserved1: 32;
  2485. A_UINT32
  2486. reserved2: 32;
  2487. } POSTPACK;
  2488. /**
  2489. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2490. * @details
  2491. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2492. * (WBM) offload HW.
  2493. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2494. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2495. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2496. * STA side.
  2497. */
  2498. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2499. A_UINT32
  2500. mec_sa_addr_31_0;
  2501. A_UINT32
  2502. mec_sa_addr_47_32: 16,
  2503. sa_ast_index: 16;
  2504. A_UINT32
  2505. vdev_id: 8,
  2506. reserved0: 24;
  2507. } POSTPACK;
  2508. /* DWORD 4 - mec_sa_addr_31_0 */
  2509. /* DWORD 5 */
  2510. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2511. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2512. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2513. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2514. /* DWORD 6 */
  2515. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2516. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2517. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2518. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2519. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2520. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2521. do { \
  2522. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2523. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2524. } while (0)
  2525. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2526. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2527. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2528. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2529. do { \
  2530. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2531. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2532. } while (0)
  2533. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2534. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2535. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2536. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2537. do { \
  2538. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2539. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2540. } while (0)
  2541. typedef enum {
  2542. TX_FLOW_PRIORITY_BE,
  2543. TX_FLOW_PRIORITY_HIGH,
  2544. TX_FLOW_PRIORITY_LOW,
  2545. } htt_tx_flow_priority_t;
  2546. typedef enum {
  2547. TX_FLOW_LATENCY_SENSITIVE,
  2548. TX_FLOW_LATENCY_INSENSITIVE,
  2549. } htt_tx_flow_latency_t;
  2550. typedef enum {
  2551. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2552. TX_FLOW_INTERACTIVE_TRAFFIC,
  2553. TX_FLOW_PERIODIC_TRAFFIC,
  2554. TX_FLOW_BURSTY_TRAFFIC,
  2555. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2556. } htt_tx_flow_traffic_pattern_t;
  2557. /**
  2558. * @brief HTT TX Flow search metadata format
  2559. * @details
  2560. * Host will set this metadata in flow table's flow search entry along with
  2561. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2562. * firmware and TQM ring if the flow search entry wins.
  2563. * This metadata is available to firmware in that first MSDU's
  2564. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2565. * to one of the available flows for specific tid and returns the tqm flow
  2566. * pointer as part of htt_tx_map_flow_info message.
  2567. */
  2568. PREPACK struct htt_tx_flow_metadata {
  2569. A_UINT32
  2570. rsvd0_1_0: 2,
  2571. tid: 4,
  2572. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2573. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2574. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2575. * Else choose final tid based on latency, priority.
  2576. */
  2577. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2578. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2579. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2580. } POSTPACK;
  2581. /* DWORD 0 */
  2582. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2583. #define HTT_TX_FLOW_METADATA_TID_S 2
  2584. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2585. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2586. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2587. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2588. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2589. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2590. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2591. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2592. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2593. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2594. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2595. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2596. /* DWORD 0 */
  2597. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2598. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2599. HTT_TX_FLOW_METADATA_TID_S)
  2600. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2601. do { \
  2602. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2603. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2604. } while (0)
  2605. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2606. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2607. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2608. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2609. do { \
  2610. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2611. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2612. } while (0)
  2613. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2614. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2615. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2616. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2617. do { \
  2618. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2619. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2620. } while (0)
  2621. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2622. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2623. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2624. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2625. do { \
  2626. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2627. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2628. } while (0)
  2629. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2630. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2631. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2632. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2633. do { \
  2634. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2635. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2636. } while (0)
  2637. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2638. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2639. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2640. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2641. do { \
  2642. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2643. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2644. } while (0)
  2645. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2646. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2647. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2648. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2652. } while (0)
  2653. /**
  2654. * @brief host -> target ADD WDS Entry
  2655. *
  2656. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2657. *
  2658. * @brief host -> target DELETE WDS Entry
  2659. *
  2660. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2661. *
  2662. * @details
  2663. * HTT wds entry from source port learning
  2664. * Host will learn wds entries from rx and send this message to firmware
  2665. * to enable firmware to configure/delete AST entries for wds clients.
  2666. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2667. * and when SA's entry is deleted, firmware removes this AST entry
  2668. *
  2669. * The message would appear as follows:
  2670. *
  2671. * |31 30|29 |17 16|15 8|7 0|
  2672. * |----------------+----------------+----------------+----------------|
  2673. * | rsvd0 |PDVID| vdev_id | msg_type |
  2674. * |-------------------------------------------------------------------|
  2675. * | sa_addr_31_0 |
  2676. * |-------------------------------------------------------------------|
  2677. * | | ta_peer_id | sa_addr_47_32 |
  2678. * |-------------------------------------------------------------------|
  2679. * Where PDVID = pdev_id
  2680. *
  2681. * The message is interpreted as follows:
  2682. *
  2683. * dword0 - b'0:7 - msg_type: This will be set to
  2684. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2685. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2686. *
  2687. * dword0 - b'8:15 - vdev_id
  2688. *
  2689. * dword0 - b'16:17 - pdev_id
  2690. *
  2691. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2692. *
  2693. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2694. *
  2695. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2696. *
  2697. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2698. */
  2699. PREPACK struct htt_wds_entry {
  2700. A_UINT32
  2701. msg_type: 8,
  2702. vdev_id: 8,
  2703. pdev_id: 2,
  2704. rsvd0: 14;
  2705. A_UINT32 sa_addr_31_0;
  2706. A_UINT32
  2707. sa_addr_47_32: 16,
  2708. ta_peer_id: 14,
  2709. rsvd2: 2;
  2710. } POSTPACK;
  2711. /* DWORD 0 */
  2712. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2713. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2714. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2715. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2716. /* DWORD 2 */
  2717. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2718. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2719. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2720. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2721. /* DWORD 0 */
  2722. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2723. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2724. HTT_WDS_ENTRY_VDEV_ID_S)
  2725. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2726. do { \
  2727. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2728. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2729. } while (0)
  2730. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2731. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2732. HTT_WDS_ENTRY_PDEV_ID_S)
  2733. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2734. do { \
  2735. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2736. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2737. } while (0)
  2738. /* DWORD 2 */
  2739. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2740. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2741. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2742. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2745. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2746. } while (0)
  2747. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2748. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2749. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2750. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2753. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2754. } while (0)
  2755. /**
  2756. * @brief MAC DMA rx ring setup specification
  2757. *
  2758. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2759. *
  2760. * @details
  2761. * To allow for dynamic rx ring reconfiguration and to avoid race
  2762. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2763. * it uses. Instead, it sends this message to the target, indicating how
  2764. * the rx ring used by the host should be set up and maintained.
  2765. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2766. * specifications.
  2767. *
  2768. * |31 16|15 8|7 0|
  2769. * |---------------------------------------------------------------|
  2770. * header: | reserved | num rings | msg type |
  2771. * |---------------------------------------------------------------|
  2772. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2773. #if HTT_PADDR64
  2774. * | FW_IDX shadow register physical address (bits 63:32) |
  2775. #endif
  2776. * |---------------------------------------------------------------|
  2777. * | rx ring base physical address (bits 31:0) |
  2778. #if HTT_PADDR64
  2779. * | rx ring base physical address (bits 63:32) |
  2780. #endif
  2781. * |---------------------------------------------------------------|
  2782. * | rx ring buffer size | rx ring length |
  2783. * |---------------------------------------------------------------|
  2784. * | FW_IDX initial value | enabled flags |
  2785. * |---------------------------------------------------------------|
  2786. * | MSDU payload offset | 802.11 header offset |
  2787. * |---------------------------------------------------------------|
  2788. * | PPDU end offset | PPDU start offset |
  2789. * |---------------------------------------------------------------|
  2790. * | MPDU end offset | MPDU start offset |
  2791. * |---------------------------------------------------------------|
  2792. * | MSDU end offset | MSDU start offset |
  2793. * |---------------------------------------------------------------|
  2794. * | frag info offset | rx attention offset |
  2795. * |---------------------------------------------------------------|
  2796. * payload 2, if present, has the same format as payload 1
  2797. * Header fields:
  2798. * - MSG_TYPE
  2799. * Bits 7:0
  2800. * Purpose: identifies this as an rx ring configuration message
  2801. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2802. * - NUM_RINGS
  2803. * Bits 15:8
  2804. * Purpose: indicates whether the host is setting up one rx ring or two
  2805. * Value: 1 or 2
  2806. * Payload:
  2807. * for systems using 64-bit format for bus addresses:
  2808. * - IDX_SHADOW_REG_PADDR_LO
  2809. * Bits 31:0
  2810. * Value: lower 4 bytes of physical address of the host's
  2811. * FW_IDX shadow register
  2812. * - IDX_SHADOW_REG_PADDR_HI
  2813. * Bits 31:0
  2814. * Value: upper 4 bytes of physical address of the host's
  2815. * FW_IDX shadow register
  2816. * - RING_BASE_PADDR_LO
  2817. * Bits 31:0
  2818. * Value: lower 4 bytes of physical address of the host's rx ring
  2819. * - RING_BASE_PADDR_HI
  2820. * Bits 31:0
  2821. * Value: uppper 4 bytes of physical address of the host's rx ring
  2822. * for systems using 32-bit format for bus addresses:
  2823. * - IDX_SHADOW_REG_PADDR
  2824. * Bits 31:0
  2825. * Value: physical address of the host's FW_IDX shadow register
  2826. * - RING_BASE_PADDR
  2827. * Bits 31:0
  2828. * Value: physical address of the host's rx ring
  2829. * - RING_LEN
  2830. * Bits 15:0
  2831. * Value: number of elements in the rx ring
  2832. * - RING_BUF_SZ
  2833. * Bits 31:16
  2834. * Value: size of the buffers referenced by the rx ring, in byte units
  2835. * - ENABLED_FLAGS
  2836. * Bits 15:0
  2837. * Value: 1-bit flags to show whether different rx fields are enabled
  2838. * bit 0: 802.11 header enabled (1) or disabled (0)
  2839. * bit 1: MSDU payload enabled (1) or disabled (0)
  2840. * bit 2: PPDU start enabled (1) or disabled (0)
  2841. * bit 3: PPDU end enabled (1) or disabled (0)
  2842. * bit 4: MPDU start enabled (1) or disabled (0)
  2843. * bit 5: MPDU end enabled (1) or disabled (0)
  2844. * bit 6: MSDU start enabled (1) or disabled (0)
  2845. * bit 7: MSDU end enabled (1) or disabled (0)
  2846. * bit 8: rx attention enabled (1) or disabled (0)
  2847. * bit 9: frag info enabled (1) or disabled (0)
  2848. * bit 10: unicast rx enabled (1) or disabled (0)
  2849. * bit 11: multicast rx enabled (1) or disabled (0)
  2850. * bit 12: ctrl rx enabled (1) or disabled (0)
  2851. * bit 13: mgmt rx enabled (1) or disabled (0)
  2852. * bit 14: null rx enabled (1) or disabled (0)
  2853. * bit 15: phy data rx enabled (1) or disabled (0)
  2854. * - IDX_INIT_VAL
  2855. * Bits 31:16
  2856. * Purpose: Specify the initial value for the FW_IDX.
  2857. * Value: the number of buffers initially present in the host's rx ring
  2858. * - OFFSET_802_11_HDR
  2859. * Bits 15:0
  2860. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2861. * - OFFSET_MSDU_PAYLOAD
  2862. * Bits 31:16
  2863. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2864. * - OFFSET_PPDU_START
  2865. * Bits 15:0
  2866. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2867. * - OFFSET_PPDU_END
  2868. * Bits 31:16
  2869. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2870. * - OFFSET_MPDU_START
  2871. * Bits 15:0
  2872. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2873. * - OFFSET_MPDU_END
  2874. * Bits 31:16
  2875. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2876. * - OFFSET_MSDU_START
  2877. * Bits 15:0
  2878. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2879. * - OFFSET_MSDU_END
  2880. * Bits 31:16
  2881. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2882. * - OFFSET_RX_ATTN
  2883. * Bits 15:0
  2884. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2885. * - OFFSET_FRAG_INFO
  2886. * Bits 31:16
  2887. * Value: offset in QUAD-bytes of frag info table
  2888. */
  2889. /* header fields */
  2890. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2891. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2892. /* payload fields */
  2893. /* for systems using a 64-bit format for bus addresses */
  2894. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2895. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2896. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2897. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2898. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2899. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2900. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2901. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2902. /* for systems using a 32-bit format for bus addresses */
  2903. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2904. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2905. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2906. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2907. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2908. #define HTT_RX_RING_CFG_LEN_S 0
  2909. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2910. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2911. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2912. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2913. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2914. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2915. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2916. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2917. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2918. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2919. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2920. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2921. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2922. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2923. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2924. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2925. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2926. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2927. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2928. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2929. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2930. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2931. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2932. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2933. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2934. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2935. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2936. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2937. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2938. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2939. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2940. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2941. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2942. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2943. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2944. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2945. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2946. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2947. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2948. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2949. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2950. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2951. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2952. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2953. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2954. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2955. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2956. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2957. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2959. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2960. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2961. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2962. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2963. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2964. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2965. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2966. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2967. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2968. #if HTT_PADDR64
  2969. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2970. #else
  2971. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2972. #endif
  2973. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2974. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2975. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2976. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2977. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2978. do { \
  2979. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2980. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2981. } while (0)
  2982. /* degenerate case for 32-bit fields */
  2983. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2984. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2985. ((_var) = (_val))
  2986. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2987. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2988. ((_var) = (_val))
  2989. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2990. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2991. ((_var) = (_val))
  2992. /* degenerate case for 32-bit fields */
  2993. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2994. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2995. ((_var) = (_val))
  2996. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2997. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2998. ((_var) = (_val))
  2999. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3000. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3001. ((_var) = (_val))
  3002. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3003. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3004. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3005. do { \
  3006. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3007. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3008. } while (0)
  3009. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3010. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3011. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3014. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3015. } while (0)
  3016. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3017. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3018. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3019. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3020. do { \
  3021. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3022. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3023. } while (0)
  3024. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3025. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3026. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3027. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3028. do { \
  3029. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3030. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3031. } while (0)
  3032. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3033. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3034. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3035. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3036. do { \
  3037. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3038. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3039. } while (0)
  3040. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3041. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3042. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3043. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3044. do { \
  3045. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3046. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3047. } while (0)
  3048. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3049. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3050. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3051. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3052. do { \
  3053. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3054. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3055. } while (0)
  3056. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3057. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3058. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3059. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3060. do { \
  3061. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3062. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3063. } while (0)
  3064. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3065. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3066. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3067. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3068. do { \
  3069. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3070. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3071. } while (0)
  3072. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3073. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3074. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3075. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3076. do { \
  3077. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3078. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3079. } while (0)
  3080. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3081. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3082. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3083. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3084. do { \
  3085. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3086. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3087. } while (0)
  3088. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3089. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3090. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3091. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3092. do { \
  3093. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3094. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3095. } while (0)
  3096. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3097. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3098. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3099. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3100. do { \
  3101. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3102. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3103. } while (0)
  3104. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3105. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3106. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3107. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3108. do { \
  3109. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3110. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3111. } while (0)
  3112. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3113. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3114. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3115. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3116. do { \
  3117. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3118. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3119. } while (0)
  3120. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3121. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3122. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3123. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3124. do { \
  3125. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3126. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3127. } while (0)
  3128. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3129. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3130. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3131. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3132. do { \
  3133. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3134. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3135. } while (0)
  3136. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3137. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3138. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3139. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3140. do { \
  3141. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3142. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3143. } while (0)
  3144. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3145. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3146. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3147. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3148. do { \
  3149. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3150. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3151. } while (0)
  3152. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3153. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3154. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3155. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3156. do { \
  3157. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3158. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3159. } while (0)
  3160. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3161. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3162. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3163. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3164. do { \
  3165. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3166. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3167. } while (0)
  3168. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3169. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3170. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3171. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3172. do { \
  3173. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3174. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3175. } while (0)
  3176. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3177. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3178. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3179. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3180. do { \
  3181. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3182. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3183. } while (0)
  3184. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3185. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3186. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3187. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3188. do { \
  3189. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3190. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3191. } while (0)
  3192. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3193. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3194. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3195. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3196. do { \
  3197. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3198. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3199. } while (0)
  3200. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3201. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3202. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3203. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3204. do { \
  3205. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3206. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3207. } while (0)
  3208. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3209. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3210. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3211. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3212. do { \
  3213. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3214. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3215. } while (0)
  3216. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3217. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3218. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3219. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3220. do { \
  3221. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3222. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3223. } while (0)
  3224. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3225. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3226. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3227. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3228. do { \
  3229. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3230. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3231. } while (0)
  3232. /**
  3233. * @brief host -> target FW statistics retrieve
  3234. *
  3235. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3236. *
  3237. * @details
  3238. * The following field definitions describe the format of the HTT host
  3239. * to target FW stats retrieve message. The message specifies the type of
  3240. * stats host wants to retrieve.
  3241. *
  3242. * |31 24|23 16|15 8|7 0|
  3243. * |-----------------------------------------------------------|
  3244. * | stats types request bitmask | msg type |
  3245. * |-----------------------------------------------------------|
  3246. * | stats types reset bitmask | reserved |
  3247. * |-----------------------------------------------------------|
  3248. * | stats type | config value |
  3249. * |-----------------------------------------------------------|
  3250. * | cookie LSBs |
  3251. * |-----------------------------------------------------------|
  3252. * | cookie MSBs |
  3253. * |-----------------------------------------------------------|
  3254. * Header fields:
  3255. * - MSG_TYPE
  3256. * Bits 7:0
  3257. * Purpose: identifies this is a stats upload request message
  3258. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3259. * - UPLOAD_TYPES
  3260. * Bits 31:8
  3261. * Purpose: identifies which types of FW statistics to upload
  3262. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3263. * - RESET_TYPES
  3264. * Bits 31:8
  3265. * Purpose: identifies which types of FW statistics to reset
  3266. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3267. * - CFG_VAL
  3268. * Bits 23:0
  3269. * Purpose: give an opaque configuration value to the specified stats type
  3270. * Value: stats-type specific configuration value
  3271. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3272. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3273. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3274. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3275. * - CFG_STAT_TYPE
  3276. * Bits 31:24
  3277. * Purpose: specify which stats type (if any) the config value applies to
  3278. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3279. * a valid configuration specification
  3280. * - COOKIE_LSBS
  3281. * Bits 31:0
  3282. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3283. * message with its preceding host->target stats request message.
  3284. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3285. * - COOKIE_MSBS
  3286. * Bits 31:0
  3287. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3288. * message with its preceding host->target stats request message.
  3289. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3290. */
  3291. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3292. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3293. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3294. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3295. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3296. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3297. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3298. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3299. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3300. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3301. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3302. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3303. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3304. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3305. do { \
  3306. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3307. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3308. } while (0)
  3309. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3310. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3311. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3312. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3313. do { \
  3314. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3315. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3316. } while (0)
  3317. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3318. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3319. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3320. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3321. do { \
  3322. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3323. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3324. } while (0)
  3325. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3326. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3327. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3328. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3329. do { \
  3330. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3331. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3332. } while (0)
  3333. /**
  3334. * @brief host -> target HTT out-of-band sync request
  3335. *
  3336. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3337. *
  3338. * @details
  3339. * The HTT SYNC tells the target to suspend processing of subsequent
  3340. * HTT host-to-target messages until some other target agent locally
  3341. * informs the target HTT FW that the current sync counter is equal to
  3342. * or greater than (in a modulo sense) the sync counter specified in
  3343. * the SYNC message.
  3344. * This allows other host-target components to synchronize their operation
  3345. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3346. * security key has been downloaded to and activated by the target.
  3347. * In the absence of any explicit synchronization counter value
  3348. * specification, the target HTT FW will use zero as the default current
  3349. * sync value.
  3350. *
  3351. * |31 24|23 16|15 8|7 0|
  3352. * |-----------------------------------------------------------|
  3353. * | reserved | sync count | msg type |
  3354. * |-----------------------------------------------------------|
  3355. * Header fields:
  3356. * - MSG_TYPE
  3357. * Bits 7:0
  3358. * Purpose: identifies this as a sync message
  3359. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3360. * - SYNC_COUNT
  3361. * Bits 15:8
  3362. * Purpose: specifies what sync value the HTT FW will wait for from
  3363. * an out-of-band specification to resume its operation
  3364. * Value: in-band sync counter value to compare against the out-of-band
  3365. * counter spec.
  3366. * The HTT target FW will suspend its host->target message processing
  3367. * as long as
  3368. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3369. */
  3370. #define HTT_H2T_SYNC_MSG_SZ 4
  3371. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3372. #define HTT_H2T_SYNC_COUNT_S 8
  3373. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3374. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3375. HTT_H2T_SYNC_COUNT_S)
  3376. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3377. do { \
  3378. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3379. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3380. } while (0)
  3381. /**
  3382. * @brief host -> target HTT aggregation configuration
  3383. *
  3384. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3385. */
  3386. #define HTT_AGGR_CFG_MSG_SZ 4
  3387. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3388. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3389. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3390. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3391. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3392. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3393. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3394. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3395. do { \
  3396. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3397. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3398. } while (0)
  3399. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3400. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3401. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3402. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3403. do { \
  3404. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3405. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3406. } while (0)
  3407. /**
  3408. * @brief host -> target HTT configure max amsdu info per vdev
  3409. *
  3410. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3411. *
  3412. * @details
  3413. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3414. *
  3415. * |31 21|20 16|15 8|7 0|
  3416. * |-----------------------------------------------------------|
  3417. * | reserved | vdev id | max amsdu | msg type |
  3418. * |-----------------------------------------------------------|
  3419. * Header fields:
  3420. * - MSG_TYPE
  3421. * Bits 7:0
  3422. * Purpose: identifies this as a aggr cfg ex message
  3423. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3424. * - MAX_NUM_AMSDU_SUBFRM
  3425. * Bits 15:8
  3426. * Purpose: max MSDUs per A-MSDU
  3427. * - VDEV_ID
  3428. * Bits 20:16
  3429. * Purpose: ID of the vdev to which this limit is applied
  3430. */
  3431. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3432. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3433. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3434. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3435. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3436. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3437. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3438. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3439. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3440. do { \
  3441. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3442. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3443. } while (0)
  3444. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3445. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3446. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3447. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3448. do { \
  3449. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3450. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3451. } while (0)
  3452. /**
  3453. * @brief HTT WDI_IPA Config Message
  3454. *
  3455. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3456. *
  3457. * @details
  3458. * The HTT WDI_IPA config message is created/sent by host at driver
  3459. * init time. It contains information about data structures used on
  3460. * WDI_IPA TX and RX path.
  3461. * TX CE ring is used for pushing packet metadata from IPA uC
  3462. * to WLAN FW
  3463. * TX Completion ring is used for generating TX completions from
  3464. * WLAN FW to IPA uC
  3465. * RX Indication ring is used for indicating RX packets from FW
  3466. * to IPA uC
  3467. * RX Ring2 is used as either completion ring or as second
  3468. * indication ring. when Ring2 is used as completion ring, IPA uC
  3469. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3470. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3471. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3472. * indicated in RX Indication ring. Please see WDI_IPA specification
  3473. * for more details.
  3474. * |31 24|23 16|15 8|7 0|
  3475. * |----------------+----------------+----------------+----------------|
  3476. * | tx pkt pool size | Rsvd | msg_type |
  3477. * |-------------------------------------------------------------------|
  3478. * | tx comp ring base (bits 31:0) |
  3479. #if HTT_PADDR64
  3480. * | tx comp ring base (bits 63:32) |
  3481. #endif
  3482. * |-------------------------------------------------------------------|
  3483. * | tx comp ring size |
  3484. * |-------------------------------------------------------------------|
  3485. * | tx comp WR_IDX physical address (bits 31:0) |
  3486. #if HTT_PADDR64
  3487. * | tx comp WR_IDX physical address (bits 63:32) |
  3488. #endif
  3489. * |-------------------------------------------------------------------|
  3490. * | tx CE WR_IDX physical address (bits 31:0) |
  3491. #if HTT_PADDR64
  3492. * | tx CE WR_IDX physical address (bits 63:32) |
  3493. #endif
  3494. * |-------------------------------------------------------------------|
  3495. * | rx indication ring base (bits 31:0) |
  3496. #if HTT_PADDR64
  3497. * | rx indication ring base (bits 63:32) |
  3498. #endif
  3499. * |-------------------------------------------------------------------|
  3500. * | rx indication ring size |
  3501. * |-------------------------------------------------------------------|
  3502. * | rx ind RD_IDX physical address (bits 31:0) |
  3503. #if HTT_PADDR64
  3504. * | rx ind RD_IDX physical address (bits 63:32) |
  3505. #endif
  3506. * |-------------------------------------------------------------------|
  3507. * | rx ind WR_IDX physical address (bits 31:0) |
  3508. #if HTT_PADDR64
  3509. * | rx ind WR_IDX physical address (bits 63:32) |
  3510. #endif
  3511. * |-------------------------------------------------------------------|
  3512. * |-------------------------------------------------------------------|
  3513. * | rx ring2 base (bits 31:0) |
  3514. #if HTT_PADDR64
  3515. * | rx ring2 base (bits 63:32) |
  3516. #endif
  3517. * |-------------------------------------------------------------------|
  3518. * | rx ring2 size |
  3519. * |-------------------------------------------------------------------|
  3520. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3521. #if HTT_PADDR64
  3522. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3523. #endif
  3524. * |-------------------------------------------------------------------|
  3525. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3526. #if HTT_PADDR64
  3527. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3528. #endif
  3529. * |-------------------------------------------------------------------|
  3530. *
  3531. * Header fields:
  3532. * Header fields:
  3533. * - MSG_TYPE
  3534. * Bits 7:0
  3535. * Purpose: Identifies this as WDI_IPA config message
  3536. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3537. * - TX_PKT_POOL_SIZE
  3538. * Bits 15:0
  3539. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3540. * WDI_IPA TX path
  3541. * For systems using 32-bit format for bus addresses:
  3542. * - TX_COMP_RING_BASE_ADDR
  3543. * Bits 31:0
  3544. * Purpose: TX Completion Ring base address in DDR
  3545. * - TX_COMP_RING_SIZE
  3546. * Bits 31:0
  3547. * Purpose: TX Completion Ring size (must be power of 2)
  3548. * - TX_COMP_WR_IDX_ADDR
  3549. * Bits 31:0
  3550. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3551. * updates the Write Index for WDI_IPA TX completion ring
  3552. * - TX_CE_WR_IDX_ADDR
  3553. * Bits 31:0
  3554. * Purpose: DDR address where IPA uC
  3555. * updates the WR Index for TX CE ring
  3556. * (needed for fusion platforms)
  3557. * - RX_IND_RING_BASE_ADDR
  3558. * Bits 31:0
  3559. * Purpose: RX Indication Ring base address in DDR
  3560. * - RX_IND_RING_SIZE
  3561. * Bits 31:0
  3562. * Purpose: RX Indication Ring size
  3563. * - RX_IND_RD_IDX_ADDR
  3564. * Bits 31:0
  3565. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3566. * RX indication ring
  3567. * - RX_IND_WR_IDX_ADDR
  3568. * Bits 31:0
  3569. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3570. * updates the Write Index for WDI_IPA RX indication ring
  3571. * - RX_RING2_BASE_ADDR
  3572. * Bits 31:0
  3573. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3574. * - RX_RING2_SIZE
  3575. * Bits 31:0
  3576. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3577. * - RX_RING2_RD_IDX_ADDR
  3578. * Bits 31:0
  3579. * Purpose: If Second RX ring is Indication ring, DDR address where
  3580. * IPA uC updates the Read Index for Ring2.
  3581. * If Second RX ring is completion ring, this is NOT used
  3582. * - RX_RING2_WR_IDX_ADDR
  3583. * Bits 31:0
  3584. * Purpose: If Second RX ring is Indication ring, DDR address where
  3585. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3586. * If second RX ring is completion ring, DDR address where
  3587. * IPA uC updates the Write Index for Ring 2.
  3588. * For systems using 64-bit format for bus addresses:
  3589. * - TX_COMP_RING_BASE_ADDR_LO
  3590. * Bits 31:0
  3591. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3592. * - TX_COMP_RING_BASE_ADDR_HI
  3593. * Bits 31:0
  3594. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3595. * - TX_COMP_RING_SIZE
  3596. * Bits 31:0
  3597. * Purpose: TX Completion Ring size (must be power of 2)
  3598. * - TX_COMP_WR_IDX_ADDR_LO
  3599. * Bits 31:0
  3600. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3601. * Lower 4 bytes of DDR address where WIFI FW
  3602. * updates the Write Index for WDI_IPA TX completion ring
  3603. * - TX_COMP_WR_IDX_ADDR_HI
  3604. * Bits 31:0
  3605. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3606. * Higher 4 bytes of DDR address where WIFI FW
  3607. * updates the Write Index for WDI_IPA TX completion ring
  3608. * - TX_CE_WR_IDX_ADDR_LO
  3609. * Bits 31:0
  3610. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3611. * updates the WR Index for TX CE ring
  3612. * (needed for fusion platforms)
  3613. * - TX_CE_WR_IDX_ADDR_HI
  3614. * Bits 31:0
  3615. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3616. * updates the WR Index for TX CE ring
  3617. * (needed for fusion platforms)
  3618. * - RX_IND_RING_BASE_ADDR_LO
  3619. * Bits 31:0
  3620. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3621. * - RX_IND_RING_BASE_ADDR_HI
  3622. * Bits 31:0
  3623. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3624. * - RX_IND_RING_SIZE
  3625. * Bits 31:0
  3626. * Purpose: RX Indication Ring size
  3627. * - RX_IND_RD_IDX_ADDR_LO
  3628. * Bits 31:0
  3629. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3630. * for WDI_IPA RX indication ring
  3631. * - RX_IND_RD_IDX_ADDR_HI
  3632. * Bits 31:0
  3633. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3634. * for WDI_IPA RX indication ring
  3635. * - RX_IND_WR_IDX_ADDR_LO
  3636. * Bits 31:0
  3637. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3638. * Lower 4 bytes of DDR address where WIFI FW
  3639. * updates the Write Index for WDI_IPA RX indication ring
  3640. * - RX_IND_WR_IDX_ADDR_HI
  3641. * Bits 31:0
  3642. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3643. * Higher 4 bytes of DDR address where WIFI FW
  3644. * updates the Write Index for WDI_IPA RX indication ring
  3645. * - RX_RING2_BASE_ADDR_LO
  3646. * Bits 31:0
  3647. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3648. * - RX_RING2_BASE_ADDR_HI
  3649. * Bits 31:0
  3650. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3651. * - RX_RING2_SIZE
  3652. * Bits 31:0
  3653. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3654. * - RX_RING2_RD_IDX_ADDR_LO
  3655. * Bits 31:0
  3656. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3657. * DDR address where IPA uC updates the Read Index for Ring2.
  3658. * If Second RX ring is completion ring, this is NOT used
  3659. * - RX_RING2_RD_IDX_ADDR_HI
  3660. * Bits 31:0
  3661. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3662. * DDR address where IPA uC updates the Read Index for Ring2.
  3663. * If Second RX ring is completion ring, this is NOT used
  3664. * - RX_RING2_WR_IDX_ADDR_LO
  3665. * Bits 31:0
  3666. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3667. * DDR address where WIFI FW updates the Write Index
  3668. * for WDI_IPA RX ring2
  3669. * If second RX ring is completion ring, lower 4 bytes of
  3670. * DDR address where IPA uC updates the Write Index for Ring 2.
  3671. * - RX_RING2_WR_IDX_ADDR_HI
  3672. * Bits 31:0
  3673. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3674. * DDR address where WIFI FW updates the Write Index
  3675. * for WDI_IPA RX ring2
  3676. * If second RX ring is completion ring, higher 4 bytes of
  3677. * DDR address where IPA uC updates the Write Index for Ring 2.
  3678. */
  3679. #if HTT_PADDR64
  3680. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3681. #else
  3682. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3683. #endif
  3684. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3685. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3686. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3687. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3688. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3689. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3690. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3691. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3695. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3698. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3699. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3700. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3701. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3702. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3703. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3704. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3705. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3706. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3707. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3708. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3709. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3710. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3711. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3715. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3718. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3719. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3720. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3721. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3722. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3723. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3724. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3725. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3726. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3746. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3747. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3748. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3751. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3752. } while (0)
  3753. /* for systems using 32-bit format for bus addr */
  3754. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3755. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3756. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3759. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3760. } while (0)
  3761. /* for systems using 64-bit format for bus addr */
  3762. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3763. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3764. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3765. do { \
  3766. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3767. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3768. } while (0)
  3769. /* for systems using 64-bit format for bus addr */
  3770. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3771. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3772. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3775. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3776. } while (0)
  3777. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3778. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3779. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3780. do { \
  3781. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3782. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3783. } while (0)
  3784. /* for systems using 32-bit format for bus addr */
  3785. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3786. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3787. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3788. do { \
  3789. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3790. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3791. } while (0)
  3792. /* for systems using 64-bit format for bus addr */
  3793. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3794. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3795. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3796. do { \
  3797. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3798. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3799. } while (0)
  3800. /* for systems using 64-bit format for bus addr */
  3801. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3802. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3803. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3804. do { \
  3805. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3806. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3807. } while (0)
  3808. /* for systems using 32-bit format for bus addr */
  3809. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3810. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3811. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3812. do { \
  3813. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3814. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3815. } while (0)
  3816. /* for systems using 64-bit format for bus addr */
  3817. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3818. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3819. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3820. do { \
  3821. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3822. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3823. } while (0)
  3824. /* for systems using 64-bit format for bus addr */
  3825. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3826. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3827. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3828. do { \
  3829. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3830. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3831. } while (0)
  3832. /* for systems using 32-bit format for bus addr */
  3833. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3834. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3835. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3836. do { \
  3837. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3838. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3839. } while (0)
  3840. /* for systems using 64-bit format for bus addr */
  3841. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3842. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3843. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3844. do { \
  3845. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3846. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3847. } while (0)
  3848. /* for systems using 64-bit format for bus addr */
  3849. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3850. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3851. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3852. do { \
  3853. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3854. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3855. } while (0)
  3856. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3857. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3858. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3859. do { \
  3860. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3861. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3862. } while (0)
  3863. /* for systems using 32-bit format for bus addr */
  3864. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3865. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3866. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3867. do { \
  3868. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3869. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3870. } while (0)
  3871. /* for systems using 64-bit format for bus addr */
  3872. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3873. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3874. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3875. do { \
  3876. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3877. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3878. } while (0)
  3879. /* for systems using 64-bit format for bus addr */
  3880. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3881. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3882. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3883. do { \
  3884. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3885. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3886. } while (0)
  3887. /* for systems using 32-bit format for bus addr */
  3888. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3889. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3890. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3891. do { \
  3892. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3893. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3894. } while (0)
  3895. /* for systems using 64-bit format for bus addr */
  3896. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3897. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3898. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3899. do { \
  3900. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3901. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3902. } while (0)
  3903. /* for systems using 64-bit format for bus addr */
  3904. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3905. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3906. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3907. do { \
  3908. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3909. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3910. } while (0)
  3911. /* for systems using 32-bit format for bus addr */
  3912. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3913. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3914. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3915. do { \
  3916. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3917. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3918. } while (0)
  3919. /* for systems using 64-bit format for bus addr */
  3920. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3921. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3922. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3923. do { \
  3924. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3925. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3926. } while (0)
  3927. /* for systems using 64-bit format for bus addr */
  3928. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3929. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3930. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3931. do { \
  3932. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3933. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3934. } while (0)
  3935. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3936. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3937. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3938. do { \
  3939. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3940. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3941. } while (0)
  3942. /* for systems using 32-bit format for bus addr */
  3943. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3944. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3945. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3946. do { \
  3947. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3948. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3949. } while (0)
  3950. /* for systems using 64-bit format for bus addr */
  3951. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3952. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3953. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3954. do { \
  3955. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3956. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3957. } while (0)
  3958. /* for systems using 64-bit format for bus addr */
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3960. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3962. do { \
  3963. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3964. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3965. } while (0)
  3966. /* for systems using 32-bit format for bus addr */
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3968. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3970. do { \
  3971. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3972. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3973. } while (0)
  3974. /* for systems using 64-bit format for bus addr */
  3975. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3976. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3977. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3978. do { \
  3979. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3980. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3981. } while (0)
  3982. /* for systems using 64-bit format for bus addr */
  3983. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3984. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3985. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3986. do { \
  3987. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3988. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3989. } while (0)
  3990. /*
  3991. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3992. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3993. * addresses are stored in a XXX-bit field.
  3994. * This macro is used to define both htt_wdi_ipa_config32_t and
  3995. * htt_wdi_ipa_config64_t structs.
  3996. */
  3997. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3998. _paddr__tx_comp_ring_base_addr_, \
  3999. _paddr__tx_comp_wr_idx_addr_, \
  4000. _paddr__tx_ce_wr_idx_addr_, \
  4001. _paddr__rx_ind_ring_base_addr_, \
  4002. _paddr__rx_ind_rd_idx_addr_, \
  4003. _paddr__rx_ind_wr_idx_addr_, \
  4004. _paddr__rx_ring2_base_addr_,\
  4005. _paddr__rx_ring2_rd_idx_addr_,\
  4006. _paddr__rx_ring2_wr_idx_addr_) \
  4007. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4008. { \
  4009. /* DWORD 0: flags and meta-data */ \
  4010. A_UINT32 \
  4011. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4012. reserved: 8, \
  4013. tx_pkt_pool_size: 16;\
  4014. /* DWORD 1 */\
  4015. _paddr__tx_comp_ring_base_addr_;\
  4016. /* DWORD 2 (or 3)*/\
  4017. A_UINT32 tx_comp_ring_size;\
  4018. /* DWORD 3 (or 4)*/\
  4019. _paddr__tx_comp_wr_idx_addr_;\
  4020. /* DWORD 4 (or 6)*/\
  4021. _paddr__tx_ce_wr_idx_addr_;\
  4022. /* DWORD 5 (or 8)*/\
  4023. _paddr__rx_ind_ring_base_addr_;\
  4024. /* DWORD 6 (or 10)*/\
  4025. A_UINT32 rx_ind_ring_size;\
  4026. /* DWORD 7 (or 11)*/\
  4027. _paddr__rx_ind_rd_idx_addr_;\
  4028. /* DWORD 8 (or 13)*/\
  4029. _paddr__rx_ind_wr_idx_addr_;\
  4030. /* DWORD 9 (or 15)*/\
  4031. _paddr__rx_ring2_base_addr_;\
  4032. /* DWORD 10 (or 17) */\
  4033. A_UINT32 rx_ring2_size;\
  4034. /* DWORD 11 (or 18) */\
  4035. _paddr__rx_ring2_rd_idx_addr_;\
  4036. /* DWORD 12 (or 20) */\
  4037. _paddr__rx_ring2_wr_idx_addr_;\
  4038. } POSTPACK
  4039. /* define a htt_wdi_ipa_config32_t type */
  4040. 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));
  4041. /* define a htt_wdi_ipa_config64_t type */
  4042. 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));
  4043. #if HTT_PADDR64
  4044. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4045. #else
  4046. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4047. #endif
  4048. enum htt_wdi_ipa_op_code {
  4049. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4050. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4051. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4052. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4053. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4054. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4055. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4056. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4057. /* keep this last */
  4058. HTT_WDI_IPA_OPCODE_MAX
  4059. };
  4060. /**
  4061. * @brief HTT WDI_IPA Operation Request Message
  4062. *
  4063. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4064. *
  4065. * @details
  4066. * HTT WDI_IPA Operation Request message is sent by host
  4067. * to either suspend or resume WDI_IPA TX or RX path.
  4068. * |31 24|23 16|15 8|7 0|
  4069. * |----------------+----------------+----------------+----------------|
  4070. * | op_code | Rsvd | msg_type |
  4071. * |-------------------------------------------------------------------|
  4072. *
  4073. * Header fields:
  4074. * - MSG_TYPE
  4075. * Bits 7:0
  4076. * Purpose: Identifies this as WDI_IPA Operation Request message
  4077. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4078. * - OP_CODE
  4079. * Bits 31:16
  4080. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4081. * value: = enum htt_wdi_ipa_op_code
  4082. */
  4083. PREPACK struct htt_wdi_ipa_op_request_t
  4084. {
  4085. /* DWORD 0: flags and meta-data */
  4086. A_UINT32
  4087. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4088. reserved: 8,
  4089. op_code: 16;
  4090. } POSTPACK;
  4091. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4092. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4093. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4094. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4095. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4096. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4097. do { \
  4098. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4099. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4100. } while (0)
  4101. /*
  4102. * @brief host -> target HTT_SRING_SETUP message
  4103. *
  4104. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4105. *
  4106. * @details
  4107. * After target is booted up, Host can send SRING setup message for
  4108. * each host facing LMAC SRING. Target setups up HW registers based
  4109. * on setup message and confirms back to Host if response_required is set.
  4110. * Host should wait for confirmation message before sending new SRING
  4111. * setup message
  4112. *
  4113. * The message would appear as follows:
  4114. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4115. * |--------------- +-----------------+-----------------+-----------------|
  4116. * | ring_type | ring_id | pdev_id | msg_type |
  4117. * |----------------------------------------------------------------------|
  4118. * | ring_base_addr_lo |
  4119. * |----------------------------------------------------------------------|
  4120. * | ring_base_addr_hi |
  4121. * |----------------------------------------------------------------------|
  4122. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4123. * |----------------------------------------------------------------------|
  4124. * | ring_head_offset32_remote_addr_lo |
  4125. * |----------------------------------------------------------------------|
  4126. * | ring_head_offset32_remote_addr_hi |
  4127. * |----------------------------------------------------------------------|
  4128. * | ring_tail_offset32_remote_addr_lo |
  4129. * |----------------------------------------------------------------------|
  4130. * | ring_tail_offset32_remote_addr_hi |
  4131. * |----------------------------------------------------------------------|
  4132. * | ring_msi_addr_lo |
  4133. * |----------------------------------------------------------------------|
  4134. * | ring_msi_addr_hi |
  4135. * |----------------------------------------------------------------------|
  4136. * | ring_msi_data |
  4137. * |----------------------------------------------------------------------|
  4138. * | intr_timer_th |IM| intr_batch_counter_th |
  4139. * |----------------------------------------------------------------------|
  4140. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4141. * |----------------------------------------------------------------------|
  4142. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4143. * |----------------------------------------------------------------------|
  4144. * Where
  4145. * IM = sw_intr_mode
  4146. * RR = response_required
  4147. * PTCF = prefetch_timer_cfg
  4148. * IP = IPA drop flag
  4149. *
  4150. * The message is interpreted as follows:
  4151. * dword0 - b'0:7 - msg_type: This will be set to
  4152. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4153. * b'8:15 - pdev_id:
  4154. * 0 (for rings at SOC/UMAC level),
  4155. * 1/2/3 mac id (for rings at LMAC level)
  4156. * b'16:23 - ring_id: identify which ring is to setup,
  4157. * more details can be got from enum htt_srng_ring_id
  4158. * b'24:31 - ring_type: identify type of host rings,
  4159. * more details can be got from enum htt_srng_ring_type
  4160. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4161. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4162. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4163. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4164. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4165. * SW_TO_HW_RING.
  4166. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4167. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4168. * Lower 32 bits of memory address of the remote variable
  4169. * storing the 4-byte word offset that identifies the head
  4170. * element within the ring.
  4171. * (The head offset variable has type A_UINT32.)
  4172. * Valid for HW_TO_SW and SW_TO_SW rings.
  4173. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4174. * Upper 32 bits of memory address of the remote variable
  4175. * storing the 4-byte word offset that identifies the head
  4176. * element within the ring.
  4177. * (The head offset variable has type A_UINT32.)
  4178. * Valid for HW_TO_SW and SW_TO_SW rings.
  4179. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4180. * Lower 32 bits of memory address of the remote variable
  4181. * storing the 4-byte word offset that identifies the tail
  4182. * element within the ring.
  4183. * (The tail offset variable has type A_UINT32.)
  4184. * Valid for HW_TO_SW and SW_TO_SW rings.
  4185. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4186. * Upper 32 bits of memory address of the remote variable
  4187. * storing the 4-byte word offset that identifies the tail
  4188. * element within the ring.
  4189. * (The tail offset variable has type A_UINT32.)
  4190. * Valid for HW_TO_SW and SW_TO_SW rings.
  4191. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4192. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4193. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4194. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4195. * dword10 - b'0:31 - ring_msi_data: MSI data
  4196. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4197. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4198. * dword11 - b'0:14 - intr_batch_counter_th:
  4199. * batch counter threshold is in units of 4-byte words.
  4200. * HW internally maintains and increments batch count.
  4201. * (see SRING spec for detail description).
  4202. * When batch count reaches threshold value, an interrupt
  4203. * is generated by HW.
  4204. * b'15 - sw_intr_mode:
  4205. * This configuration shall be static.
  4206. * Only programmed at power up.
  4207. * 0: generate pulse style sw interrupts
  4208. * 1: generate level style sw interrupts
  4209. * b'16:31 - intr_timer_th:
  4210. * The timer init value when timer is idle or is
  4211. * initialized to start downcounting.
  4212. * In 8us units (to cover a range of 0 to 524 ms)
  4213. * dword12 - b'0:15 - intr_low_threshold:
  4214. * Used only by Consumer ring to generate ring_sw_int_p.
  4215. * Ring entries low threshold water mark, that is used
  4216. * in combination with the interrupt timer as well as
  4217. * the the clearing of the level interrupt.
  4218. * b'16:18 - prefetch_timer_cfg:
  4219. * Used only by Consumer ring to set timer mode to
  4220. * support Application prefetch handling.
  4221. * The external tail offset/pointer will be updated
  4222. * at following intervals:
  4223. * 3'b000: (Prefetch feature disabled; used only for debug)
  4224. * 3'b001: 1 usec
  4225. * 3'b010: 4 usec
  4226. * 3'b011: 8 usec (default)
  4227. * 3'b100: 16 usec
  4228. * Others: Reserverd
  4229. * b'19 - response_required:
  4230. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4231. * b'20 - ipa_drop_flag:
  4232. Indicates that host will config ipa drop threshold percentage
  4233. * b'21:31 - reserved: reserved for future use
  4234. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4235. * b'8:15 - ipa drop high threshold percentage:
  4236. * b'16:31 - Reserved
  4237. */
  4238. PREPACK struct htt_sring_setup_t {
  4239. A_UINT32 msg_type: 8,
  4240. pdev_id: 8,
  4241. ring_id: 8,
  4242. ring_type: 8;
  4243. A_UINT32 ring_base_addr_lo;
  4244. A_UINT32 ring_base_addr_hi;
  4245. A_UINT32 ring_size: 16,
  4246. ring_entry_size: 8,
  4247. ring_misc_cfg_flag: 8;
  4248. A_UINT32 ring_head_offset32_remote_addr_lo;
  4249. A_UINT32 ring_head_offset32_remote_addr_hi;
  4250. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4251. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4252. A_UINT32 ring_msi_addr_lo;
  4253. A_UINT32 ring_msi_addr_hi;
  4254. A_UINT32 ring_msi_data;
  4255. A_UINT32 intr_batch_counter_th: 15,
  4256. sw_intr_mode: 1,
  4257. intr_timer_th: 16;
  4258. A_UINT32 intr_low_threshold: 16,
  4259. prefetch_timer_cfg: 3,
  4260. response_required: 1,
  4261. ipa_drop_flag: 1,
  4262. reserved1: 11;
  4263. A_UINT32 ipa_drop_low_threshold: 8,
  4264. ipa_drop_high_threshold: 8,
  4265. reserved: 16;
  4266. } POSTPACK;
  4267. enum htt_srng_ring_type {
  4268. HTT_HW_TO_SW_RING = 0,
  4269. HTT_SW_TO_HW_RING,
  4270. HTT_SW_TO_SW_RING,
  4271. /* Insert new ring types above this line */
  4272. };
  4273. enum htt_srng_ring_id {
  4274. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4275. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4276. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4277. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4278. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4279. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4280. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4281. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4282. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4283. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4284. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4285. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4286. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4287. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4288. HTT_RX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4289. /* Add Other SRING which can't be directly configured by host software above this line */
  4290. };
  4291. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4292. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4293. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4294. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4295. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4296. HTT_SRING_SETUP_PDEV_ID_S)
  4297. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4298. do { \
  4299. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4300. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4301. } while (0)
  4302. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4303. #define HTT_SRING_SETUP_RING_ID_S 16
  4304. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4305. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4306. HTT_SRING_SETUP_RING_ID_S)
  4307. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4308. do { \
  4309. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4310. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4311. } while (0)
  4312. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4313. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4314. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4315. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4316. HTT_SRING_SETUP_RING_TYPE_S)
  4317. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4318. do { \
  4319. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4320. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4321. } while (0)
  4322. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4323. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4324. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4325. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4326. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4327. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4328. do { \
  4329. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4330. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4331. } while (0)
  4332. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4333. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4334. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4335. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4336. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4337. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4338. do { \
  4339. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4340. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4341. } while (0)
  4342. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4343. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4344. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4345. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4346. HTT_SRING_SETUP_RING_SIZE_S)
  4347. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4348. do { \
  4349. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4350. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4351. } while (0)
  4352. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4353. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4354. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4355. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4356. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4357. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4358. do { \
  4359. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4360. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4361. } while (0)
  4362. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4363. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4364. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4365. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4366. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4367. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4368. do { \
  4369. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4370. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4371. } while (0)
  4372. /* This control bit is applicable to only Producer, which updates Ring ID field
  4373. * of each descriptor before pushing into the ring.
  4374. * 0: updates ring_id(default)
  4375. * 1: ring_id updating disabled */
  4376. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4377. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4378. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4379. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4380. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4381. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4382. do { \
  4383. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4384. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4385. } while (0)
  4386. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4387. * of each descriptor before pushing into the ring.
  4388. * 0: updates Loopcnt(default)
  4389. * 1: Loopcnt updating disabled */
  4390. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4392. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4393. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4394. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4395. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4396. do { \
  4397. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4398. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4399. } while (0)
  4400. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4401. * into security_id port of GXI/AXI. */
  4402. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4403. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4404. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4405. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4406. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4407. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4408. do { \
  4409. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4410. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4411. } while (0)
  4412. /* During MSI write operation, SRNG drives value of this register bit into
  4413. * swap bit of GXI/AXI. */
  4414. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4415. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4416. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4417. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4418. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4419. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4420. do { \
  4421. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4422. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4423. } while (0)
  4424. /* During Pointer write operation, SRNG drives value of this register bit into
  4425. * swap bit of GXI/AXI. */
  4426. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4427. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4428. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4429. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4430. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4431. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4432. do { \
  4433. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4434. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4435. } while (0)
  4436. /* During any data or TLV write operation, SRNG drives value of this register
  4437. * bit into swap bit of GXI/AXI. */
  4438. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4439. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4440. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4441. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4442. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4443. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4444. do { \
  4445. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4446. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4447. } while (0)
  4448. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4449. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4450. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4451. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4452. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4453. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4454. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4455. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4456. do { \
  4457. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4458. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4459. } while (0)
  4460. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4461. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4462. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4463. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4464. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4465. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4466. do { \
  4467. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4468. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4469. } while (0)
  4470. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4471. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4472. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4473. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4474. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4475. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4476. do { \
  4477. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4478. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4479. } while (0)
  4480. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4481. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4482. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4483. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4484. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4485. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4486. do { \
  4487. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4488. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4489. } while (0)
  4490. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4491. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4492. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4493. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4494. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4495. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4496. do { \
  4497. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4498. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4499. } while (0)
  4500. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4501. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4502. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4503. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4504. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4505. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4506. do { \
  4507. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4508. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4509. } while (0)
  4510. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4511. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4512. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4513. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4514. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4515. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4516. do { \
  4517. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4518. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4519. } while (0)
  4520. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4521. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4522. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4523. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4524. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4525. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4528. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4529. } while (0)
  4530. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4531. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4532. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4533. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4534. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4535. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4536. do { \
  4537. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4538. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4539. } while (0)
  4540. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4541. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4542. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4543. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4544. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4545. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4546. do { \
  4547. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4548. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4549. } while (0)
  4550. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4551. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4552. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4553. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4554. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4555. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4556. do { \
  4557. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4558. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4559. } while (0)
  4560. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4561. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4562. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4563. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4564. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4565. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4566. do { \
  4567. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4568. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4569. } while (0)
  4570. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4571. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4572. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4573. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4574. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4575. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4576. do { \
  4577. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4578. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4579. } while (0)
  4580. /**
  4581. * @brief host -> target RX ring selection config message
  4582. *
  4583. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4584. *
  4585. * @details
  4586. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4587. * configure RXDMA rings.
  4588. * The configuration is per ring based and includes both packet subtypes
  4589. * and PPDU/MPDU TLVs.
  4590. *
  4591. * The message would appear as follows:
  4592. *
  4593. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4594. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4595. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4596. * |-------------------------------------------------------------------|
  4597. * | rsvd2 | ring_buffer_size |
  4598. * |-------------------------------------------------------------------|
  4599. * | packet_type_enable_flags_0 |
  4600. * |-------------------------------------------------------------------|
  4601. * | packet_type_enable_flags_1 |
  4602. * |-------------------------------------------------------------------|
  4603. * | packet_type_enable_flags_2 |
  4604. * |-------------------------------------------------------------------|
  4605. * | packet_type_enable_flags_3 |
  4606. * |-------------------------------------------------------------------|
  4607. * | tlv_filter_in_flags |
  4608. * |-------------------------------------------------------------------|
  4609. * | rx_header_offset | rx_packet_offset |
  4610. * |-------------------------------------------------------------------|
  4611. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4612. * |-------------------------------------------------------------------|
  4613. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4614. * |-------------------------------------------------------------------|
  4615. * | rsvd3 | rx_attention_offset |
  4616. * |-------------------------------------------------------------------|
  4617. * | rsvd4 | mo| fp| rx_drop_threshold |
  4618. * | |ndp|ndp| |
  4619. * |-------------------------------------------------------------------|
  4620. * Where:
  4621. * PS = pkt_swap
  4622. * SS = status_swap
  4623. * OV = rx_offsets_valid
  4624. * DT = drop_thresh_valid
  4625. * The message is interpreted as follows:
  4626. * dword0 - b'0:7 - msg_type: This will be set to
  4627. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4628. * b'8:15 - pdev_id:
  4629. * 0 (for rings at SOC/UMAC level),
  4630. * 1/2/3 mac id (for rings at LMAC level)
  4631. * b'16:23 - ring_id : Identify the ring to configure.
  4632. * More details can be got from enum htt_srng_ring_id
  4633. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4634. * BUF_RING_CFG_0 defs within HW .h files,
  4635. * e.g. wmac_top_reg_seq_hwioreg.h
  4636. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4637. * BUF_RING_CFG_0 defs within HW .h files,
  4638. * e.g. wmac_top_reg_seq_hwioreg.h
  4639. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4640. * configuration fields are valid
  4641. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4642. * rx_drop_threshold field is valid
  4643. * b'28:31 - rsvd1: reserved for future use
  4644. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4645. * in byte units.
  4646. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4647. * - b'16:31 - rsvd2: Reserved for future use
  4648. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4649. * Enable MGMT packet from 0b0000 to 0b1001
  4650. * bits from low to high: FP, MD, MO - 3 bits
  4651. * FP: Filter_Pass
  4652. * MD: Monitor_Direct
  4653. * MO: Monitor_Other
  4654. * 10 mgmt subtypes * 3 bits -> 30 bits
  4655. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4656. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4657. * Enable MGMT packet from 0b1010 to 0b1111
  4658. * bits from low to high: FP, MD, MO - 3 bits
  4659. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4660. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4661. * Enable CTRL packet from 0b0000 to 0b1001
  4662. * bits from low to high: FP, MD, MO - 3 bits
  4663. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4664. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4665. * Enable CTRL packet from 0b1010 to 0b1111,
  4666. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4667. * bits from low to high: FP, MD, MO - 3 bits
  4668. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4669. * dword6 - b'0:31 - tlv_filter_in_flags:
  4670. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4671. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4672. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4673. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4674. * A value of 0 will be considered as ignore this config.
  4675. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4676. * e.g. wmac_top_reg_seq_hwioreg.h
  4677. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4678. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4679. * A value of 0 will be considered as ignore this config.
  4680. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4681. * e.g. wmac_top_reg_seq_hwioreg.h
  4682. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4683. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4684. * A value of 0 will be considered as ignore this config.
  4685. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4686. * e.g. wmac_top_reg_seq_hwioreg.h
  4687. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4688. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4689. * A value of 0 will be considered as ignore this config.
  4690. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4691. * e.g. wmac_top_reg_seq_hwioreg.h
  4692. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4693. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4694. * A value of 0 will be considered as ignore this config.
  4695. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4696. * e.g. wmac_top_reg_seq_hwioreg.h
  4697. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4698. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4699. * A value of 0 will be considered as ignore this config.
  4700. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4701. * e.g. wmac_top_reg_seq_hwioreg.h
  4702. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4703. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4704. * A value of 0 will be considered as ignore this config.
  4705. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4706. * e.g. wmac_top_reg_seq_hwioreg.h
  4707. * - b'16:31 - rsvd3 for future use
  4708. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4709. * to source rings. Consumer drops packets if the available
  4710. * words in the ring falls below the configured threshold
  4711. * value.
  4712. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4713. * by host. 1 -> subscribed
  4714. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4715. * by host. 1 -> subscribed
  4716. */
  4717. PREPACK struct htt_rx_ring_selection_cfg_t {
  4718. A_UINT32 msg_type: 8,
  4719. pdev_id: 8,
  4720. ring_id: 8,
  4721. status_swap: 1,
  4722. pkt_swap: 1,
  4723. rx_offsets_valid: 1,
  4724. drop_thresh_valid: 1,
  4725. rsvd1: 4;
  4726. A_UINT32 ring_buffer_size: 16,
  4727. rsvd2: 16;
  4728. A_UINT32 packet_type_enable_flags_0;
  4729. A_UINT32 packet_type_enable_flags_1;
  4730. A_UINT32 packet_type_enable_flags_2;
  4731. A_UINT32 packet_type_enable_flags_3;
  4732. A_UINT32 tlv_filter_in_flags;
  4733. A_UINT32 rx_packet_offset: 16,
  4734. rx_header_offset: 16;
  4735. A_UINT32 rx_mpdu_end_offset: 16,
  4736. rx_mpdu_start_offset: 16;
  4737. A_UINT32 rx_msdu_end_offset: 16,
  4738. rx_msdu_start_offset: 16;
  4739. A_UINT32 rx_attn_offset: 16,
  4740. rsvd3: 16;
  4741. A_UINT32 rx_drop_threshold: 10,
  4742. fp_ndp: 1,
  4743. mo_ndp: 1,
  4744. rsvd4: 20;
  4745. } POSTPACK;
  4746. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4747. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4748. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4749. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4750. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4751. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4752. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4753. do { \
  4754. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4755. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4756. } while (0)
  4757. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4758. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4759. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4760. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4761. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4762. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4765. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4766. } while (0)
  4767. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4768. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4769. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4770. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4771. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4772. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4775. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4776. } while (0)
  4777. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4780. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4781. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4782. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4783. do { \
  4784. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4785. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4786. } while (0)
  4787. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4788. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4789. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4790. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4791. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4792. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4795. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4796. } while (0)
  4797. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4798. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4799. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4800. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4801. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4802. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4803. do { \
  4804. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4805. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4806. } while (0)
  4807. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4808. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4809. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4810. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4811. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4812. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4815. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4816. } while (0)
  4817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4820. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4821. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4825. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4826. } while (0)
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4830. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4831. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4833. do { \
  4834. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4835. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4836. } while (0)
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4840. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4841. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4843. do { \
  4844. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4845. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4846. } while (0)
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4850. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4851. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4853. do { \
  4854. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4855. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4856. } while (0)
  4857. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4858. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4859. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4860. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4861. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4862. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4863. do { \
  4864. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4865. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4866. } while (0)
  4867. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4868. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4869. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4870. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4871. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4872. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4875. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4876. } while (0)
  4877. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4878. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4879. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4880. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4881. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4882. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4883. do { \
  4884. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4885. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4886. } while (0)
  4887. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4888. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4889. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4890. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4891. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4892. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4893. do { \
  4894. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4895. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4896. } while (0)
  4897. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4898. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4899. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4900. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4901. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4902. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4903. do { \
  4904. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4905. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4906. } while (0)
  4907. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4908. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4909. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4910. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4911. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4912. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4915. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4916. } while (0)
  4917. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4918. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4919. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4920. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4921. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4922. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4923. do { \
  4924. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4925. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4926. } while (0)
  4927. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4928. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4929. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4930. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4931. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4932. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4933. do { \
  4934. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4935. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4936. } while (0)
  4937. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4938. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4939. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4940. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4941. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4942. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4945. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4946. } while (0)
  4947. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4948. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4949. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4950. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4951. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4952. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4955. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4956. } while (0)
  4957. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4958. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4959. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4960. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4961. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4962. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4965. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4966. } while (0)
  4967. /*
  4968. * Subtype based MGMT frames enable bits.
  4969. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4970. */
  4971. /* association request */
  4972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4978. /* association response */
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4985. /* Reassociation request */
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4992. /* Reassociation response */
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  4999. /* Probe request */
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5006. /* Probe response */
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5013. /* Timing Advertisement */
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5020. /* Reserved */
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5027. /* Beacon */
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5034. /* ATIM */
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5041. /* Disassociation */
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5048. /* Authentication */
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5055. /* Deauthentication */
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5062. /* Action */
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5069. /* Action No Ack */
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5076. /* Reserved */
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5083. /*
  5084. * Subtype based CTRL frames enable bits.
  5085. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5086. */
  5087. /* Reserved */
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5094. /* Reserved */
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5101. /* Reserved */
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5108. /* Reserved */
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5115. /* Reserved */
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5122. /* Reserved */
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5129. /* Reserved */
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5136. /* Control Wrapper */
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5143. /* Block Ack Request */
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5150. /* Block Ack*/
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5157. /* PS-POLL */
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5164. /* RTS */
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5171. /* CTS */
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5178. /* ACK */
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5185. /* CF-END */
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5192. /* CF-END + CF-ACK */
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5199. /* Multicast data */
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5206. /* Unicast data */
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5213. /* NULL data */
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5221. do { \
  5222. HTT_CHECK_SET_VAL(httsym, value); \
  5223. (word) |= (value) << httsym##_S; \
  5224. } while (0)
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5226. (((word) & httsym##_M) >> httsym##_S)
  5227. #define htt_rx_ring_pkt_enable_subtype_set( \
  5228. word, flag, mode, type, subtype, val) \
  5229. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5230. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5231. #define htt_rx_ring_pkt_enable_subtype_get( \
  5232. word, flag, mode, type, subtype) \
  5233. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5234. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5235. /* Definition to filter in TLVs */
  5236. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5262. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5263. do { \
  5264. HTT_CHECK_SET_VAL(httsym, enable); \
  5265. (word) |= (enable) << httsym##_S; \
  5266. } while (0)
  5267. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5268. (((word) & httsym##_M) >> httsym##_S)
  5269. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5270. HTT_RX_RING_TLV_ENABLE_SET( \
  5271. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5272. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5273. HTT_RX_RING_TLV_ENABLE_GET( \
  5274. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5275. /**
  5276. * @brief host -> target TX monitor config message
  5277. *
  5278. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5279. *
  5280. * @details
  5281. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5282. * configure RXDMA rings.
  5283. * The configuration is per ring based and includes both packet types
  5284. * and PPDU/MPDU TLVs.
  5285. *
  5286. * The message would appear as follows:
  5287. *
  5288. * |31 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5289. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5290. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5291. * |-----+--------+--------+-----+------+--------------------------------|
  5292. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5293. * |---------------------------------------------------------------+-----|
  5294. * | rsvd3 | E |
  5295. * |---------------------------------------------------------------------|
  5296. * | tlv_filter_mask_in0 |
  5297. * |---------------------------------------------------------------------|
  5298. * | tlv_filter_mask_in1 |
  5299. * |---------------------------------------------------------------------|
  5300. * | tlv_filter_mask_in2 |
  5301. * |---------------------------------------------------------------------|
  5302. * | tlv_filter_mask_in3 |
  5303. * |------------------------------------+--------------------------------|
  5304. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5305. * |------------------------------------+--------------------------------|
  5306. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5307. * |------------------------------------+--------------------------------|
  5308. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5309. * |-----------------------+-----+------+--------------------------------|
  5310. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5311. * |---------------------------------------------------------------------|
  5312. *
  5313. * Where:
  5314. * PS = pkt_swap
  5315. * SS = status_swap
  5316. * The message is interpreted as follows:
  5317. * dword0 - b'0:7 - msg_type: This will be set to
  5318. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5319. * b'8:15 - pdev_id:
  5320. * 0 (for rings at SOC/UMAC level),
  5321. * 1/2/3 mac id (for rings at LMAC level)
  5322. * b'16:23 - ring_id : Identify the ring to configure.
  5323. * More details can be got from enum htt_srng_ring_id
  5324. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5325. * BUF_RING_CFG_0 defs within HW .h files,
  5326. * e.g. wmac_top_reg_seq_hwioreg.h
  5327. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5328. * BUF_RING_CFG_0 defs within HW .h files,
  5329. * e.g. wmac_top_reg_seq_hwioreg.h
  5330. * b'26:31 - rsvd1: reserved for future use
  5331. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5332. * in byte units.
  5333. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5334. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5335. * Each bit out of 3 bits represents if configurable length
  5336. * is valid and needs to programmed.
  5337. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5338. * 64, 128, 256.
  5339. * If all 3 bits are set config length is > 256
  5340. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5341. * 64, 128, 256.
  5342. * If all 3 bits are set config length is > 256
  5343. * b'25:27 - config_length_data(DATA) for DATA: Each bit set represent
  5344. * 64, 128, 256.
  5345. * If all 3 bits are set config length is > 256
  5346. * - b'28:31 - rsvd2: Reserved for future use
  5347. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5348. * b'3:31 - rsvd3: Reserved for future use
  5349. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5350. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5351. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5352. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5353. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5354. * - b'16:31 - tx_peer_entry_word_mask:
  5355. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5356. * - b'16:31 - tx_msdu_start_word_mask:
  5357. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5358. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5359. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5360. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5361. * Each bit out of 3 bits represents if MSDU/MPDU
  5362. * logging is enabled
  5363. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5364. * 0 -> MSDU level logging is enabled
  5365. * (valid only if bit is set in
  5366. * pkt_type_msdu_or_mpdu_logging)
  5367. * 1 -> MPDU level logging is enabled
  5368. * (valid only if bit is set in
  5369. * pkt_type_msdu_or_mpdu_logging)
  5370. * - b'22:31 - rsvd4 for future use
  5371. */
  5372. PREPACK struct htt_tx_monitor_cfg_t {
  5373. A_UINT32 msg_type: 8,
  5374. pdev_id: 8,
  5375. ring_id: 8,
  5376. status_swap: 1,
  5377. pkt_swap: 1,
  5378. rsvd1: 6;
  5379. A_UINT32 ring_buffer_size: 16,
  5380. pkt_type_config_length: 3,
  5381. config_length_mgmt: 3,
  5382. config_length_ctrl: 3,
  5383. config_length_data: 3,
  5384. rsvd2: 4;
  5385. A_UINT32 pkt_type_enable_flags: 3,
  5386. rsvd3: 29;
  5387. A_UINT32 tlv_filter_mask_in0;
  5388. A_UINT32 tlv_filter_mask_in1;
  5389. A_UINT32 tlv_filter_mask_in2;
  5390. A_UINT32 tlv_filter_mask_in3;
  5391. A_UINT32 tx_fes_setup_word_mask: 16,
  5392. tx_peer_entry_word_mask: 16;
  5393. A_UINT32 tx_queue_ext_word_mask: 16,
  5394. tx_msdu_start_word_mask: 16;
  5395. A_UINT32 tx_mpdu_start_word_mask: 16,
  5396. pcu_ppdu_setup_word_mask: 16;
  5397. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5398. pkt_type_msdu_or_mpdu_logging: 3,
  5399. enable_msdu_or_mpdu_logging: 3,
  5400. rsvd4: 10;
  5401. } POSTPACK;
  5402. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5403. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5404. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5405. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5406. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5407. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5408. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5411. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5412. } while (0)
  5413. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5414. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5415. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5416. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5417. HTT_TX_MONITOR_CFG_RING_ID_S)
  5418. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5421. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5422. } while (0)
  5423. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5424. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5425. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5426. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5427. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5428. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5431. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5432. } while (0)
  5433. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5434. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5435. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5436. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5437. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5438. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5441. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5442. } while (0)
  5443. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5444. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5445. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5446. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5447. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5448. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5451. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5452. } while (0)
  5453. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5454. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5455. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5456. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5457. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5458. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5461. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5462. } while (0)
  5463. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5464. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5465. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5466. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5467. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5468. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5471. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5472. } while (0)
  5473. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5474. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5475. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5476. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5477. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5478. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5481. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5482. } while (0)
  5483. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5484. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5485. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5486. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5487. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5488. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5489. do { \
  5490. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5491. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5492. } while (0)
  5493. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5494. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5495. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5496. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5497. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5498. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5501. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5502. } while (0)
  5503. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5504. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5505. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5506. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5507. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5508. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5511. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5512. } while (0)
  5513. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5514. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5515. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5516. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5517. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5518. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5521. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5522. } while (0)
  5523. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5524. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5525. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5526. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5527. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5528. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5531. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5532. } while (0)
  5533. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5534. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5535. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5536. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5537. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5538. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5541. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5542. } while (0)
  5543. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5544. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5545. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5546. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5547. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5548. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5551. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5552. } while (0)
  5553. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5554. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5555. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5556. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5557. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5558. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5561. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5562. } while (0)
  5563. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5564. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5565. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5566. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5567. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5568. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5571. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5572. } while (0)
  5573. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5574. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5575. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5576. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5577. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5578. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5581. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5582. } while (0)
  5583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5586. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5587. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5588. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5591. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5592. } while (0)
  5593. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5594. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5595. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5596. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5597. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5598. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5601. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5602. } while (0)
  5603. /*
  5604. * pkt_type_config_length
  5605. */
  5606. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5607. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5608. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5609. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5610. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5611. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5612. /*
  5613. * pkt_type_enable_flags
  5614. */
  5615. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5617. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5618. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5619. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5620. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5621. /*
  5622. * pkt_type_msdu_or_mpdu_logging
  5623. * */
  5624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5631. do { \
  5632. HTT_CHECK_SET_VAL(httsym, value); \
  5633. (word) |= (value) << httsym##_S; \
  5634. } while (0)
  5635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5636. (((word) & httsym##_M) >> httsym##_S)
  5637. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5638. * type -> MGMT, CTRL, DATA*/
  5639. #define htt_tx_ring_pkt_type_set( \
  5640. word, mode, type, val) \
  5641. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5642. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5643. #define htt_tx_ring_pkt_type_get( \
  5644. word, mode, type) \
  5645. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5646. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5647. /* Definition to filter in TLVs */
  5648. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5649. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5650. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5651. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5652. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5712. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5713. do { \
  5714. HTT_CHECK_SET_VAL(httsym, enable); \
  5715. (word) |= (enable) << httsym##_S; \
  5716. } while (0)
  5717. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5718. (((word) & httsym##_M) >> httsym##_S)
  5719. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5720. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5721. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5722. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5723. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5724. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5789. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5790. do { \
  5791. HTT_CHECK_SET_VAL(httsym, enable); \
  5792. (word) |= (enable) << httsym##_S; \
  5793. } while (0)
  5794. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5795. (((word) & httsym##_M) >> httsym##_S)
  5796. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5797. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5798. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5799. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5800. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5801. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5866. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5867. do { \
  5868. HTT_CHECK_SET_VAL(httsym, enable); \
  5869. (word) |= (enable) << httsym##_S; \
  5870. } while (0)
  5871. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5872. (((word) & httsym##_M) >> httsym##_S)
  5873. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5874. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5875. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5876. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5877. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5878. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5923. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5924. do { \
  5925. HTT_CHECK_SET_VAL(httsym, enable); \
  5926. (word) |= (enable) << httsym##_S; \
  5927. } while (0)
  5928. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5929. (((word) & httsym##_M) >> httsym##_S)
  5930. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5931. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5932. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5933. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5934. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5935. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5936. /**
  5937. * @brief host --> target Receive Flow Steering configuration message definition
  5938. *
  5939. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5940. *
  5941. * host --> target Receive Flow Steering configuration message definition.
  5942. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5943. * The reason for this is we want RFS to be configured and ready before MAC
  5944. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5945. *
  5946. * |31 24|23 16|15 9|8|7 0|
  5947. * |----------------+----------------+----------------+----------------|
  5948. * | reserved |E| msg type |
  5949. * |-------------------------------------------------------------------|
  5950. * Where E = RFS enable flag
  5951. *
  5952. * The RFS_CONFIG message consists of a single 4-byte word.
  5953. *
  5954. * Header fields:
  5955. * - MSG_TYPE
  5956. * Bits 7:0
  5957. * Purpose: identifies this as a RFS config msg
  5958. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5959. * - RFS_CONFIG
  5960. * Bit 8
  5961. * Purpose: Tells target whether to enable (1) or disable (0)
  5962. * flow steering feature when sending rx indication messages to host
  5963. */
  5964. #define HTT_H2T_RFS_CONFIG_M 0x100
  5965. #define HTT_H2T_RFS_CONFIG_S 8
  5966. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5967. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5968. HTT_H2T_RFS_CONFIG_S)
  5969. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5970. do { \
  5971. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5972. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5973. } while (0)
  5974. #define HTT_RFS_CFG_REQ_BYTES 4
  5975. /**
  5976. * @brief host -> target FW extended statistics retrieve
  5977. *
  5978. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5979. *
  5980. * @details
  5981. * The following field definitions describe the format of the HTT host
  5982. * to target FW extended stats retrieve message.
  5983. * The message specifies the type of stats the host wants to retrieve.
  5984. *
  5985. * |31 24|23 16|15 8|7 0|
  5986. * |-----------------------------------------------------------|
  5987. * | reserved | stats type | pdev_mask | msg type |
  5988. * |-----------------------------------------------------------|
  5989. * | config param [0] |
  5990. * |-----------------------------------------------------------|
  5991. * | config param [1] |
  5992. * |-----------------------------------------------------------|
  5993. * | config param [2] |
  5994. * |-----------------------------------------------------------|
  5995. * | config param [3] |
  5996. * |-----------------------------------------------------------|
  5997. * | reserved |
  5998. * |-----------------------------------------------------------|
  5999. * | cookie LSBs |
  6000. * |-----------------------------------------------------------|
  6001. * | cookie MSBs |
  6002. * |-----------------------------------------------------------|
  6003. * Header fields:
  6004. * - MSG_TYPE
  6005. * Bits 7:0
  6006. * Purpose: identifies this is a extended stats upload request message
  6007. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6008. * - PDEV_MASK
  6009. * Bits 8:15
  6010. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6011. * Value: This is a overloaded field, refer to usage and interpretation of
  6012. * PDEV in interface document.
  6013. * Bit 8 : Reserved for SOC stats
  6014. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6015. * Indicates MACID_MASK in DBS
  6016. * - STATS_TYPE
  6017. * Bits 23:16
  6018. * Purpose: identifies which FW statistics to upload
  6019. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6020. * - Reserved
  6021. * Bits 31:24
  6022. * - CONFIG_PARAM [0]
  6023. * Bits 31:0
  6024. * Purpose: give an opaque configuration value to the specified stats type
  6025. * Value: stats-type specific configuration value
  6026. * Refer to htt_stats.h for interpretation for each stats sub_type
  6027. * - CONFIG_PARAM [1]
  6028. * Bits 31:0
  6029. * Purpose: give an opaque configuration value to the specified stats type
  6030. * Value: stats-type specific configuration value
  6031. * Refer to htt_stats.h for interpretation for each stats sub_type
  6032. * - CONFIG_PARAM [2]
  6033. * Bits 31:0
  6034. * Purpose: give an opaque configuration value to the specified stats type
  6035. * Value: stats-type specific configuration value
  6036. * Refer to htt_stats.h for interpretation for each stats sub_type
  6037. * - CONFIG_PARAM [3]
  6038. * Bits 31:0
  6039. * Purpose: give an opaque configuration value to the specified stats type
  6040. * Value: stats-type specific configuration value
  6041. * Refer to htt_stats.h for interpretation for each stats sub_type
  6042. * - Reserved [31:0] for future use.
  6043. * - COOKIE_LSBS
  6044. * Bits 31:0
  6045. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6046. * message with its preceding host->target stats request message.
  6047. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6048. * - COOKIE_MSBS
  6049. * Bits 31:0
  6050. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6051. * message with its preceding host->target stats request message.
  6052. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6053. */
  6054. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6055. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6056. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6057. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6058. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6059. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6060. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6061. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6062. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6063. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6064. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6065. do { \
  6066. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6067. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6068. } while (0)
  6069. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6070. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6071. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6072. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6073. do { \
  6074. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6075. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6076. } while (0)
  6077. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6078. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6079. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6080. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6081. do { \
  6082. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6083. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6084. } while (0)
  6085. /**
  6086. * @brief host -> target FW PPDU_STATS request message
  6087. *
  6088. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6089. *
  6090. * @details
  6091. * The following field definitions describe the format of the HTT host
  6092. * to target FW for PPDU_STATS_CFG msg.
  6093. * The message allows the host to configure the PPDU_STATS_IND messages
  6094. * produced by the target.
  6095. *
  6096. * |31 24|23 16|15 8|7 0|
  6097. * |-----------------------------------------------------------|
  6098. * | REQ bit mask | pdev_mask | msg type |
  6099. * |-----------------------------------------------------------|
  6100. * Header fields:
  6101. * - MSG_TYPE
  6102. * Bits 7:0
  6103. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6104. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6105. * - PDEV_MASK
  6106. * Bits 8:15
  6107. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6108. * Value: This is a overloaded field, refer to usage and interpretation of
  6109. * PDEV in interface document.
  6110. * Bit 8 : Reserved for SOC stats
  6111. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6112. * Indicates MACID_MASK in DBS
  6113. * - REQ_TLV_BIT_MASK
  6114. * Bits 16:31
  6115. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6116. * needs to be included in the target's PPDU_STATS_IND messages.
  6117. * Value: refer htt_ppdu_stats_tlv_tag_t
  6118. *
  6119. */
  6120. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6121. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6122. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6123. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6124. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6125. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6126. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6127. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6128. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6129. do { \
  6130. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6131. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6132. } while (0)
  6133. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6134. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6135. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6136. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6137. do { \
  6138. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6139. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6140. } while (0)
  6141. /**
  6142. * @brief Host-->target HTT RX FSE setup message
  6143. *
  6144. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6145. *
  6146. * @details
  6147. * Through this message, the host will provide details of the flow tables
  6148. * in host DDR along with hash keys.
  6149. * This message can be sent per SOC or per PDEV, which is differentiated
  6150. * by pdev id values.
  6151. * The host will allocate flow search table and sends table size,
  6152. * physical DMA address of flow table, and hash keys to firmware to
  6153. * program into the RXOLE FSE HW block.
  6154. *
  6155. * The following field definitions describe the format of the RX FSE setup
  6156. * message sent from the host to target
  6157. *
  6158. * Header fields:
  6159. * dword0 - b'7:0 - msg_type: This will be set to
  6160. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6161. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6162. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6163. * pdev's LMAC ring.
  6164. * b'31:16 - reserved : Reserved for future use
  6165. * dword1 - b'19:0 - number of records: This field indicates the number of
  6166. * entries in the flow table. For example: 8k number of
  6167. * records is equivalent to
  6168. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6169. * b'27:20 - max search: This field specifies the skid length to FSE
  6170. * parser HW module whenever match is not found at the
  6171. * exact index pointed by hash.
  6172. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6173. * Refer htt_ip_da_sa_prefix below for more details.
  6174. * b'31:30 - reserved: Reserved for future use
  6175. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6176. * table allocated by host in DDR
  6177. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6178. * table allocated by host in DDR
  6179. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6180. * entry hashing
  6181. *
  6182. *
  6183. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6184. * |---------------------------------------------------------------|
  6185. * | reserved | pdev_id | MSG_TYPE |
  6186. * |---------------------------------------------------------------|
  6187. * |resvd|IPDSA| max_search | Number of records |
  6188. * |---------------------------------------------------------------|
  6189. * | base address lo |
  6190. * |---------------------------------------------------------------|
  6191. * | base address high |
  6192. * |---------------------------------------------------------------|
  6193. * | toeplitz key 31_0 |
  6194. * |---------------------------------------------------------------|
  6195. * | toeplitz key 63_32 |
  6196. * |---------------------------------------------------------------|
  6197. * | toeplitz key 95_64 |
  6198. * |---------------------------------------------------------------|
  6199. * | toeplitz key 127_96 |
  6200. * |---------------------------------------------------------------|
  6201. * | toeplitz key 159_128 |
  6202. * |---------------------------------------------------------------|
  6203. * | toeplitz key 191_160 |
  6204. * |---------------------------------------------------------------|
  6205. * | toeplitz key 223_192 |
  6206. * |---------------------------------------------------------------|
  6207. * | toeplitz key 255_224 |
  6208. * |---------------------------------------------------------------|
  6209. * | toeplitz key 287_256 |
  6210. * |---------------------------------------------------------------|
  6211. * | reserved | toeplitz key 314_288(26:0 bits) |
  6212. * |---------------------------------------------------------------|
  6213. * where:
  6214. * IPDSA = ip_da_sa
  6215. */
  6216. /**
  6217. * @brief: htt_ip_da_sa_prefix
  6218. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6219. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6220. * documentation per RFC3849
  6221. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6222. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6223. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6224. */
  6225. enum htt_ip_da_sa_prefix {
  6226. HTT_RX_IPV6_20010db8,
  6227. HTT_RX_IPV4_MAPPED_IPV6,
  6228. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6229. HTT_RX_IPV6_64FF9B,
  6230. };
  6231. /**
  6232. * @brief Host-->target HTT RX FISA configure and enable
  6233. *
  6234. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6235. *
  6236. * @details
  6237. * The host will send this command down to configure and enable the FISA
  6238. * operational params.
  6239. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6240. * register.
  6241. * Should configure both the MACs.
  6242. *
  6243. * dword0 - b'7:0 - msg_type:
  6244. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6245. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6246. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6247. * pdev's LMAC ring.
  6248. * b'31:16 - reserved : Reserved for future use
  6249. *
  6250. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6251. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6252. * packets. 1 flow search will be skipped
  6253. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6254. * tcp,udp packets
  6255. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6256. * calculation
  6257. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6258. * calculation
  6259. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6260. * calculation
  6261. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6262. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6263. * length
  6264. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6265. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6266. * length
  6267. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6268. * num jump
  6269. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6270. * num jump
  6271. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6272. * data type switch has happend for MPDU Sequence num jump
  6273. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6274. * for MPDU Sequence num jump
  6275. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6276. * for decrypt errors
  6277. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6278. * while aggregating a msdu
  6279. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6280. * The aggregation is done until (number of MSDUs aggregated
  6281. * < LIMIT + 1)
  6282. * b'31:18 - Reserved
  6283. *
  6284. * fisa_control_value - 32bit value FW can write to register
  6285. *
  6286. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6287. * Threshold value for FISA timeout (units are microseconds).
  6288. * When the global timestamp exceeds this threshold, FISA
  6289. * aggregation will be restarted.
  6290. * A value of 0 means timeout is disabled.
  6291. * Compare the threshold register with timestamp field in
  6292. * flow entry to generate timeout for the flow.
  6293. *
  6294. * |31 18 |17 16|15 8|7 0|
  6295. * |-------------------------------------------------------------|
  6296. * | reserved | pdev_mask | msg type |
  6297. * |-------------------------------------------------------------|
  6298. * | reserved | FISA_CTRL |
  6299. * |-------------------------------------------------------------|
  6300. * | FISA_TIMEOUT_THRESH |
  6301. * |-------------------------------------------------------------|
  6302. */
  6303. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6304. A_UINT32 msg_type:8,
  6305. pdev_id:8,
  6306. reserved0:16;
  6307. /**
  6308. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6309. * [17:0]
  6310. */
  6311. union {
  6312. /*
  6313. * fisa_control_bits structure is deprecated.
  6314. * Please use fisa_control_bits_v2 going forward.
  6315. */
  6316. struct {
  6317. A_UINT32 fisa_enable: 1,
  6318. ipsec_skip_search: 1,
  6319. nontcp_skip_search: 1,
  6320. add_ipv4_fixed_hdr_len: 1,
  6321. add_ipv6_fixed_hdr_len: 1,
  6322. add_tcp_fixed_hdr_len: 1,
  6323. add_udp_hdr_len: 1,
  6324. chksum_cum_ip_len_en: 1,
  6325. disable_tid_check: 1,
  6326. disable_ta_check: 1,
  6327. disable_qos_check: 1,
  6328. disable_raw_check: 1,
  6329. disable_decrypt_err_check: 1,
  6330. disable_msdu_drop_check: 1,
  6331. fisa_aggr_limit: 4,
  6332. reserved: 14;
  6333. } fisa_control_bits;
  6334. struct {
  6335. A_UINT32 fisa_enable: 1,
  6336. fisa_aggr_limit: 4,
  6337. reserved: 27;
  6338. } fisa_control_bits_v2;
  6339. A_UINT32 fisa_control_value;
  6340. } u_fisa_control;
  6341. /**
  6342. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6343. * timeout threshold for aggregation. Unit in usec.
  6344. * [31:0]
  6345. */
  6346. A_UINT32 fisa_timeout_threshold;
  6347. } POSTPACK;
  6348. /* DWord 0: pdev-ID */
  6349. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6350. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6351. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6352. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6353. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6354. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6355. do { \
  6356. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6357. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6358. } while (0)
  6359. /* Dword 1: fisa_control_value fisa config */
  6360. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6361. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6362. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6363. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6364. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6365. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6366. do { \
  6367. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6368. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6369. } while (0)
  6370. /* Dword 1: fisa_control_value ipsec_skip_search */
  6371. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6372. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6373. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6374. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6375. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6376. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6377. do { \
  6378. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6379. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6380. } while (0)
  6381. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6382. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6383. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6384. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6385. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6386. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6387. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6388. do { \
  6389. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6390. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6391. } while (0)
  6392. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6393. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6394. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6395. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6396. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6397. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6398. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6399. do { \
  6400. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6401. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6402. } while (0)
  6403. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6404. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6405. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6406. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6407. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6408. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6409. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6410. do { \
  6411. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6412. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6413. } while (0)
  6414. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6415. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6416. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6417. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6418. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6419. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6420. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6421. do { \
  6422. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6423. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6424. } while (0)
  6425. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6426. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6427. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6428. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6429. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6430. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6431. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6434. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6435. } while (0)
  6436. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6437. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6438. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6439. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6440. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6441. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6442. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6443. do { \
  6444. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6445. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6446. } while (0)
  6447. /* Dword 1: fisa_control_value disable_tid_check */
  6448. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6449. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6450. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6451. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6452. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6453. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6454. do { \
  6455. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6456. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6457. } while (0)
  6458. /* Dword 1: fisa_control_value disable_ta_check */
  6459. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6460. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6461. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6462. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6463. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6464. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6465. do { \
  6466. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6467. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6468. } while (0)
  6469. /* Dword 1: fisa_control_value disable_qos_check */
  6470. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6471. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6472. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6473. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6474. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6475. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6476. do { \
  6477. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6478. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6479. } while (0)
  6480. /* Dword 1: fisa_control_value disable_raw_check */
  6481. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6482. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6483. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6484. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6485. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6486. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6487. do { \
  6488. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6489. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6490. } while (0)
  6491. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6492. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6493. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6494. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6495. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6496. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6497. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6498. do { \
  6499. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6500. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6501. } while (0)
  6502. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6503. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6504. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6505. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6506. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6507. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6508. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6511. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6512. } while (0)
  6513. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6514. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6515. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6516. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6517. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6518. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6519. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6520. do { \
  6521. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6522. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6523. } while (0)
  6524. /* Dword 1: fisa_control_value fisa config */
  6525. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6526. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6527. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6528. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6529. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6530. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6531. do { \
  6532. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6533. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6534. } while (0)
  6535. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6536. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6537. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6538. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6539. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6540. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6541. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6544. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6545. } while (0)
  6546. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6547. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6548. pdev_id:8,
  6549. reserved0:16;
  6550. A_UINT32 num_records:20,
  6551. max_search:8,
  6552. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6553. reserved1:2;
  6554. A_UINT32 base_addr_lo;
  6555. A_UINT32 base_addr_hi;
  6556. A_UINT32 toeplitz31_0;
  6557. A_UINT32 toeplitz63_32;
  6558. A_UINT32 toeplitz95_64;
  6559. A_UINT32 toeplitz127_96;
  6560. A_UINT32 toeplitz159_128;
  6561. A_UINT32 toeplitz191_160;
  6562. A_UINT32 toeplitz223_192;
  6563. A_UINT32 toeplitz255_224;
  6564. A_UINT32 toeplitz287_256;
  6565. A_UINT32 toeplitz314_288:27,
  6566. reserved2:5;
  6567. } POSTPACK;
  6568. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6569. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6570. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6571. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6572. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6573. /* DWORD 0: Pdev ID */
  6574. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6575. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6576. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6577. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6578. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6579. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6580. do { \
  6581. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6582. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6583. } while (0)
  6584. /* DWORD 1:num of records */
  6585. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6586. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6587. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6588. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6589. HTT_RX_FSE_SETUP_NUM_REC_S)
  6590. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6591. do { \
  6592. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6593. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6594. } while (0)
  6595. /* DWORD 1:max_search */
  6596. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6597. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6598. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6599. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6600. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6601. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6602. do { \
  6603. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6604. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6605. } while (0)
  6606. /* DWORD 1:ip_da_sa prefix */
  6607. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6608. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6609. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6610. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6611. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6612. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6615. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6616. } while (0)
  6617. /* DWORD 2: Base Address LO */
  6618. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6619. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6620. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6621. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6622. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6623. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6624. do { \
  6625. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6626. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6627. } while (0)
  6628. /* DWORD 3: Base Address High */
  6629. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6630. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6631. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6632. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6633. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6634. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6635. do { \
  6636. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6637. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6638. } while (0)
  6639. /* DWORD 4-12: Hash Value */
  6640. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6641. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6642. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6643. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6644. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6645. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6646. do { \
  6647. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6648. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6649. } while (0)
  6650. /* DWORD 13: Hash Value 314:288 bits */
  6651. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6652. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6653. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6654. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6655. do { \
  6656. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6657. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6658. } while (0)
  6659. /**
  6660. * @brief Host-->target HTT RX FSE operation message
  6661. *
  6662. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6663. *
  6664. * @details
  6665. * The host will send this Flow Search Engine (FSE) operation message for
  6666. * every flow add/delete operation.
  6667. * The FSE operation includes FSE full cache invalidation or individual entry
  6668. * invalidation.
  6669. * This message can be sent per SOC or per PDEV which is differentiated
  6670. * by pdev id values.
  6671. *
  6672. * |31 16|15 8|7 1|0|
  6673. * |-------------------------------------------------------------|
  6674. * | reserved | pdev_id | MSG_TYPE |
  6675. * |-------------------------------------------------------------|
  6676. * | reserved | operation |I|
  6677. * |-------------------------------------------------------------|
  6678. * | ip_src_addr_31_0 |
  6679. * |-------------------------------------------------------------|
  6680. * | ip_src_addr_63_32 |
  6681. * |-------------------------------------------------------------|
  6682. * | ip_src_addr_95_64 |
  6683. * |-------------------------------------------------------------|
  6684. * | ip_src_addr_127_96 |
  6685. * |-------------------------------------------------------------|
  6686. * | ip_dst_addr_31_0 |
  6687. * |-------------------------------------------------------------|
  6688. * | ip_dst_addr_63_32 |
  6689. * |-------------------------------------------------------------|
  6690. * | ip_dst_addr_95_64 |
  6691. * |-------------------------------------------------------------|
  6692. * | ip_dst_addr_127_96 |
  6693. * |-------------------------------------------------------------|
  6694. * | l4_dst_port | l4_src_port |
  6695. * | (32-bit SPI incase of IPsec) |
  6696. * |-------------------------------------------------------------|
  6697. * | reserved | l4_proto |
  6698. * |-------------------------------------------------------------|
  6699. *
  6700. * where I is 1-bit ipsec_valid.
  6701. *
  6702. * The following field definitions describe the format of the RX FSE operation
  6703. * message sent from the host to target for every add/delete flow entry to flow
  6704. * table.
  6705. *
  6706. * Header fields:
  6707. * dword0 - b'7:0 - msg_type: This will be set to
  6708. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6709. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6710. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6711. * specified pdev's LMAC ring.
  6712. * b'31:16 - reserved : Reserved for future use
  6713. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6714. * (Internet Protocol Security).
  6715. * IPsec describes the framework for providing security at
  6716. * IP layer. IPsec is defined for both versions of IP:
  6717. * IPV4 and IPV6.
  6718. * Please refer to htt_rx_flow_proto enumeration below for
  6719. * more info.
  6720. * ipsec_valid = 1 for IPSEC packets
  6721. * ipsec_valid = 0 for IP Packets
  6722. * b'7:1 - operation: This indicates types of FSE operation.
  6723. * Refer to htt_rx_fse_operation enumeration:
  6724. * 0 - No Cache Invalidation required
  6725. * 1 - Cache invalidate only one entry given by IP
  6726. * src/dest address at DWORD[2:9]
  6727. * 2 - Complete FSE Cache Invalidation
  6728. * 3 - FSE Disable
  6729. * 4 - FSE Enable
  6730. * b'31:8 - reserved: Reserved for future use
  6731. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6732. * for per flow addition/deletion
  6733. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6734. * and the subsequent 3 A_UINT32 will be padding bytes.
  6735. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6736. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6737. * from 0 to 65535 but only 0 to 1023 are designated as
  6738. * well-known ports. Refer to [RFC1700] for more details.
  6739. * This field is valid only if
  6740. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6741. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6742. * range from 0 to 65535 but only 0 to 1023 are designated
  6743. * as well-known ports. Refer to [RFC1700] for more details.
  6744. * This field is valid only if
  6745. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6746. * - SPI (31:0): Security Parameters Index is an
  6747. * identification tag added to the header while using IPsec
  6748. * for tunneling the IP traffici.
  6749. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6750. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6751. * Assigned Internet Protocol Numbers.
  6752. * l4_proto numbers for standard protocol like UDP/TCP
  6753. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6754. * l4_proto = 17 for UDP etc.
  6755. * b'31:8 - reserved: Reserved for future use.
  6756. *
  6757. */
  6758. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6759. A_UINT32 msg_type:8,
  6760. pdev_id:8,
  6761. reserved0:16;
  6762. A_UINT32 ipsec_valid:1,
  6763. operation:7,
  6764. reserved1:24;
  6765. A_UINT32 ip_src_addr_31_0;
  6766. A_UINT32 ip_src_addr_63_32;
  6767. A_UINT32 ip_src_addr_95_64;
  6768. A_UINT32 ip_src_addr_127_96;
  6769. A_UINT32 ip_dest_addr_31_0;
  6770. A_UINT32 ip_dest_addr_63_32;
  6771. A_UINT32 ip_dest_addr_95_64;
  6772. A_UINT32 ip_dest_addr_127_96;
  6773. union {
  6774. A_UINT32 spi;
  6775. struct {
  6776. A_UINT32 l4_src_port:16,
  6777. l4_dest_port:16;
  6778. } ip;
  6779. } u;
  6780. A_UINT32 l4_proto:8,
  6781. reserved:24;
  6782. } POSTPACK;
  6783. /**
  6784. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6785. *
  6786. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6787. *
  6788. * @details
  6789. * The host will send this Full monitor mode register configuration message.
  6790. * This message can be sent per SOC or per PDEV which is differentiated
  6791. * by pdev id values.
  6792. *
  6793. * |31 16|15 11|10 8|7 3|2|1|0|
  6794. * |-------------------------------------------------------------|
  6795. * | reserved | pdev_id | MSG_TYPE |
  6796. * |-------------------------------------------------------------|
  6797. * | reserved |Release Ring |N|Z|E|
  6798. * |-------------------------------------------------------------|
  6799. *
  6800. * where E is 1-bit full monitor mode enable/disable.
  6801. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6802. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6803. *
  6804. * The following field definitions describe the format of the full monitor
  6805. * mode configuration message sent from the host to target for each pdev.
  6806. *
  6807. * Header fields:
  6808. * dword0 - b'7:0 - msg_type: This will be set to
  6809. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6810. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6811. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6812. * specified pdev's LMAC ring.
  6813. * b'31:16 - reserved : Reserved for future use.
  6814. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6815. * monitor mode rxdma register is to be enabled or disabled.
  6816. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6817. * additional descriptors at ppdu end for zero mpdus
  6818. * enabled or disabled.
  6819. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6820. * additional descriptors at ppdu end for non zero mpdus
  6821. * enabled or disabled.
  6822. * b'10:3 - release_ring: This indicates the destination ring
  6823. * selection for the descriptor at the end of PPDU
  6824. * 0 - REO ring select
  6825. * 1 - FW ring select
  6826. * 2 - SW ring select
  6827. * 3 - Release ring select
  6828. * Refer to htt_rx_full_mon_release_ring.
  6829. * b'31:11 - reserved for future use
  6830. */
  6831. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6832. A_UINT32 msg_type:8,
  6833. pdev_id:8,
  6834. reserved0:16;
  6835. A_UINT32 full_monitor_mode_enable:1,
  6836. addnl_descs_zero_mpdus_end:1,
  6837. addnl_descs_non_zero_mpdus_end:1,
  6838. release_ring:8,
  6839. reserved1:21;
  6840. } POSTPACK;
  6841. /**
  6842. * Enumeration for full monitor mode destination ring select
  6843. * 0 - REO destination ring select
  6844. * 1 - FW destination ring select
  6845. * 2 - SW destination ring select
  6846. * 3 - Release destination ring select
  6847. */
  6848. enum htt_rx_full_mon_release_ring {
  6849. HTT_RX_MON_RING_REO,
  6850. HTT_RX_MON_RING_FW,
  6851. HTT_RX_MON_RING_SW,
  6852. HTT_RX_MON_RING_RELEASE,
  6853. };
  6854. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6855. /* DWORD 0: Pdev ID */
  6856. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6857. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6858. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6859. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6860. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6861. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6862. do { \
  6863. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6864. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6865. } while (0)
  6866. /* DWORD 1:ENABLE */
  6867. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6868. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6869. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6870. do { \
  6871. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6872. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6873. } while (0)
  6874. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6875. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6876. /* DWORD 1:ZERO_MPDU */
  6877. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6878. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6879. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6880. do { \
  6881. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6882. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6883. } while (0)
  6884. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6885. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6886. /* DWORD 1:NON_ZERO_MPDU */
  6887. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6888. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6889. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6890. do { \
  6891. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6892. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6893. } while (0)
  6894. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6895. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6896. /* DWORD 1:RELEASE_RINGS */
  6897. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6898. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6899. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6900. do { \
  6901. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6902. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6903. } while (0)
  6904. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6905. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6906. /**
  6907. * Enumeration for IP Protocol or IPSEC Protocol
  6908. * IPsec describes the framework for providing security at IP layer.
  6909. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6910. */
  6911. enum htt_rx_flow_proto {
  6912. HTT_RX_FLOW_IP_PROTO,
  6913. HTT_RX_FLOW_IPSEC_PROTO,
  6914. };
  6915. /**
  6916. * Enumeration for FSE Cache Invalidation
  6917. * 0 - No Cache Invalidation required
  6918. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6919. * 2 - Complete FSE Cache Invalidation
  6920. * 3 - FSE Disable
  6921. * 4 - FSE Enable
  6922. */
  6923. enum htt_rx_fse_operation {
  6924. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6925. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6926. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6927. HTT_RX_FSE_DISABLE,
  6928. HTT_RX_FSE_ENABLE,
  6929. };
  6930. /* DWORD 0: Pdev ID */
  6931. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6932. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6933. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6934. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6935. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6936. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6937. do { \
  6938. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6939. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6940. } while (0)
  6941. /* DWORD 1:IP PROTO or IPSEC */
  6942. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6943. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6944. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6945. do { \
  6946. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6947. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6948. } while (0)
  6949. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6950. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6951. /* DWORD 1:FSE Operation */
  6952. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6953. #define HTT_RX_FSE_OPERATION_S 1
  6954. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6955. do { \
  6956. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6957. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6958. } while (0)
  6959. #define HTT_RX_FSE_OPERATION_GET(word) \
  6960. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6961. /* DWORD 2-9:IP Address */
  6962. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6963. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6964. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6965. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6966. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6967. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6968. do { \
  6969. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6970. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6971. } while (0)
  6972. /* DWORD 10:Source Port Number */
  6973. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6974. #define HTT_RX_FSE_SOURCEPORT_S 0
  6975. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6976. do { \
  6977. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6978. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6979. } while (0)
  6980. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6981. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6982. /* DWORD 11:Destination Port Number */
  6983. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6984. #define HTT_RX_FSE_DESTPORT_S 16
  6985. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6986. do { \
  6987. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6988. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6989. } while (0)
  6990. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6991. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6992. /* DWORD 10-11:SPI (In case of IPSEC) */
  6993. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6994. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6995. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6996. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6997. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6998. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  6999. do { \
  7000. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7001. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7002. } while (0)
  7003. /* DWORD 12:L4 PROTO */
  7004. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7005. #define HTT_RX_FSE_L4_PROTO_S 0
  7006. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7007. do { \
  7008. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7009. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7010. } while (0)
  7011. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7012. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7013. /**
  7014. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7015. *
  7016. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7017. *
  7018. * |31 24|23 |15 8|7 2|1|0|
  7019. * |----------------+----------------+----------------+----------------|
  7020. * | reserved | pdev_id | msg_type |
  7021. * |---------------------------------+----------------+----------------|
  7022. * | reserved |E|F|
  7023. * |---------------------------------+----------------+----------------|
  7024. * Where E = Configure the target to provide the 3-tuple hash value in
  7025. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7026. * F = Configure the target to provide the 3-tuple hash value in
  7027. * flow_id_toeplitz field of rx_msdu_start tlv
  7028. *
  7029. * The following field definitions describe the format of the 3 tuple hash value
  7030. * message sent from the host to target as part of initialization sequence.
  7031. *
  7032. * Header fields:
  7033. * dword0 - b'7:0 - msg_type: This will be set to
  7034. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7035. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7036. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7037. * specified pdev's LMAC ring.
  7038. * b'31:16 - reserved : Reserved for future use
  7039. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7040. * b'1 - toeplitz_hash_2_or_4_field_enable
  7041. * b'31:2 - reserved : Reserved for future use
  7042. * ---------+------+----------------------------------------------------------
  7043. * bit1 | bit0 | Functionality
  7044. * ---------+------+----------------------------------------------------------
  7045. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7046. * | | in flow_id_toeplitz field
  7047. * ---------+------+----------------------------------------------------------
  7048. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7049. * | | in toeplitz_hash_2_or_4 field
  7050. * ---------+------+----------------------------------------------------------
  7051. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7052. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7053. * ---------+------+----------------------------------------------------------
  7054. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7055. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7056. * | | toeplitz_hash_2_or_4 field
  7057. *----------------------------------------------------------------------------
  7058. */
  7059. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7060. A_UINT32 msg_type :8,
  7061. pdev_id :8,
  7062. reserved0 :16;
  7063. A_UINT32 flow_id_toeplitz_field_enable :1,
  7064. toeplitz_hash_2_or_4_field_enable :1,
  7065. reserved1 :30;
  7066. } POSTPACK;
  7067. /* DWORD0 : pdev_id configuration Macros */
  7068. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7069. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7070. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7071. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7072. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7073. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7074. do { \
  7075. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7076. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7077. } while (0)
  7078. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7079. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7080. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7081. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7082. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7083. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7084. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7085. do { \
  7086. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7087. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7088. } while (0)
  7089. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7090. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7091. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7092. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7093. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7094. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7095. do { \
  7096. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7097. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7098. } while (0)
  7099. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7100. /**
  7101. * @brief host --> target Host PA Address Size
  7102. *
  7103. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7104. *
  7105. * @details
  7106. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7107. * provide the physical start address and size of each of the memory
  7108. * areas within host DDR that the target FW may need to access.
  7109. *
  7110. * For example, the host can use this message to allow the target FW
  7111. * to set up access to the host's pools of TQM link descriptors.
  7112. * The message would appear as follows:
  7113. *
  7114. * |31 24|23 16|15 8|7 0|
  7115. * |----------------+----------------+----------------+----------------|
  7116. * | reserved | num_entries | msg_type |
  7117. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7118. * | mem area 0 size |
  7119. * |----------------+----------------+----------------+----------------|
  7120. * | mem area 0 physical_address_lo |
  7121. * |----------------+----------------+----------------+----------------|
  7122. * | mem area 0 physical_address_hi |
  7123. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7124. * | mem area 1 size |
  7125. * |----------------+----------------+----------------+----------------|
  7126. * | mem area 1 physical_address_lo |
  7127. * |----------------+----------------+----------------+----------------|
  7128. * | mem area 1 physical_address_hi |
  7129. * |----------------+----------------+----------------+----------------|
  7130. * ...
  7131. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7132. * | mem area N size |
  7133. * |----------------+----------------+----------------+----------------|
  7134. * | mem area N physical_address_lo |
  7135. * |----------------+----------------+----------------+----------------|
  7136. * | mem area N physical_address_hi |
  7137. * |----------------+----------------+----------------+----------------|
  7138. *
  7139. * The message is interpreted as follows:
  7140. * dword0 - b'0:7 - msg_type: This will be set to
  7141. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7142. * b'8:15 - number_entries: Indicated the number of host memory
  7143. * areas specified within the remainder of the message
  7144. * b'16:31 - reserved.
  7145. * dword1 - b'0:31 - memory area 0 size in bytes
  7146. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7147. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7148. * and similar for memory area 1 through memory area N.
  7149. */
  7150. PREPACK struct htt_h2t_host_paddr_size {
  7151. A_UINT32 msg_type: 8,
  7152. num_entries: 8,
  7153. reserved: 16;
  7154. } POSTPACK;
  7155. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7156. A_UINT32 size;
  7157. A_UINT32 physical_address_lo;
  7158. A_UINT32 physical_address_hi;
  7159. } POSTPACK;
  7160. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7161. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7162. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7163. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7164. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7165. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7166. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7167. do { \
  7168. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7169. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7170. } while (0)
  7171. /**
  7172. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7173. *
  7174. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7175. *
  7176. * @details
  7177. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7178. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7179. *
  7180. * The message would appear as follows:
  7181. *
  7182. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7183. * |---------------------------------+---+---+----------+-+-----------|
  7184. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7185. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7186. *
  7187. *
  7188. * The message is interpreted as follows:
  7189. * dword0 - b'0:7 - msg_type: This will be set to
  7190. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7191. * b'8 - override bit to drive MSDUs to PPE ring
  7192. * b'9:13 - REO destination ring indication
  7193. * b'14 - Multi buffer msdu override enable bit
  7194. * b'15 - Intra BSS override
  7195. * b'16 - Decap raw override
  7196. * b'17 - Decap Native wifi override
  7197. * b'18 - IP frag override
  7198. * b'19:31 - reserved
  7199. */
  7200. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7201. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7202. override: 1,
  7203. reo_destination_indication: 5,
  7204. multi_buffer_msdu_override_en: 1,
  7205. intra_bss_override: 1,
  7206. decap_raw_override: 1,
  7207. decap_nwifi_override: 1,
  7208. ip_frag_override: 1,
  7209. reserved: 13;
  7210. } POSTPACK;
  7211. /* DWORD 0: Override */
  7212. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7213. #define HTT_PPE_CFG_OVERRIDE_S 8
  7214. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7215. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7216. HTT_PPE_CFG_OVERRIDE_S)
  7217. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7218. do { \
  7219. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7220. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7221. } while (0)
  7222. /* DWORD 0: REO Destination Indication*/
  7223. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7224. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7225. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7226. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7227. HTT_PPE_CFG_REO_DEST_IND_S)
  7228. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7229. do { \
  7230. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7231. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7232. } while (0)
  7233. /* DWORD 0: Multi buffer MSDU override */
  7234. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7235. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7236. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7237. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7238. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7239. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7240. do { \
  7241. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7242. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7243. } while (0)
  7244. /* DWORD 0: Intra BSS override */
  7245. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7246. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7247. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7248. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7249. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7250. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7251. do { \
  7252. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7253. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7254. } while (0)
  7255. /* DWORD 0: Decap RAW override */
  7256. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7257. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7258. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7259. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7260. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7261. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7262. do { \
  7263. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7264. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7265. } while (0)
  7266. /* DWORD 0: Decap NWIFI override */
  7267. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7268. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7269. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7270. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7271. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7272. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7273. do { \
  7274. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7275. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7276. } while (0)
  7277. /* DWORD 0: IP frag override */
  7278. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7279. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7280. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7281. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7282. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7283. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7284. do { \
  7285. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7286. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7287. } while (0)
  7288. /*
  7289. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7290. *
  7291. * @details
  7292. * The following field definitions describe the format of the HTT host
  7293. * to target FW VDEV TX RX stats retrieve message.
  7294. * The message specifies the type of stats the host wants to retrieve.
  7295. *
  7296. * |31 27|26 25|24 17|16|15 8|7 0|
  7297. * |-----------------------------------------------------------|
  7298. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7299. * |-----------------------------------------------------------|
  7300. * | vdev_id lower bitmask |
  7301. * |-----------------------------------------------------------|
  7302. * | vdev_id upper bitmask |
  7303. * |-----------------------------------------------------------|
  7304. * Header fields:
  7305. * Where:
  7306. * dword0 - b'7:0 - msg_type: This will be set to
  7307. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7308. * b'15:8 - pdev id
  7309. * b'16(E) - Enable/Disable the vdev HW stats
  7310. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7311. * b'25:26(R) - Reset stats bits
  7312. * 0: don't reset stats
  7313. * 1: reset stats once
  7314. * 2: reset stats at the start of each periodic interval
  7315. * b'27:31 - reserved for future use
  7316. * dword1 - b'0:31 - vdev_id lower bitmask
  7317. * dword2 - b'0:31 - vdev_id upper bitmask
  7318. */
  7319. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7320. A_UINT32 msg_type :8,
  7321. pdev_id :8,
  7322. enable :1,
  7323. periodic_interval :8,
  7324. reset_stats_bits :2,
  7325. reserved0 :5;
  7326. A_UINT32 vdev_id_lower_bitmask;
  7327. A_UINT32 vdev_id_upper_bitmask;
  7328. } POSTPACK;
  7329. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7330. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7331. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7332. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7333. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7334. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7335. do { \
  7336. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7337. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7338. } while (0)
  7339. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7340. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7341. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7342. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7343. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7344. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7345. do { \
  7346. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7347. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7348. } while (0)
  7349. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7350. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7351. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7352. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7353. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7354. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7357. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7358. } while (0)
  7359. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7360. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7361. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7362. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7363. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7364. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7365. do { \
  7366. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7367. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7368. } while (0)
  7369. /*=== target -> host messages ===============================================*/
  7370. enum htt_t2h_msg_type {
  7371. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7372. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7373. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7374. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7375. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7376. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7377. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7378. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7379. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7380. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7381. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7382. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7383. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7384. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7385. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7386. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7387. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7388. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7389. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7390. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7391. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7392. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7393. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7394. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7395. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7396. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7397. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7398. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7399. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7400. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7401. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7402. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7403. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7404. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7405. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7406. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7407. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7408. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7409. /* TX_OFFLOAD_DELIVER_IND:
  7410. * Forward the target's locally-generated packets to the host,
  7411. * to provide to the monitor mode interface.
  7412. */
  7413. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7414. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7415. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7416. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7417. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7418. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7419. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7420. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7421. HTT_T2H_MSG_TYPE_TEST,
  7422. /* keep this last */
  7423. HTT_T2H_NUM_MSGS
  7424. };
  7425. /*
  7426. * HTT target to host message type -
  7427. * stored in bits 7:0 of the first word of the message
  7428. */
  7429. #define HTT_T2H_MSG_TYPE_M 0xff
  7430. #define HTT_T2H_MSG_TYPE_S 0
  7431. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7432. do { \
  7433. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7434. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7435. } while (0)
  7436. #define HTT_T2H_MSG_TYPE_GET(word) \
  7437. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7438. /**
  7439. * @brief target -> host version number confirmation message definition
  7440. *
  7441. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7442. *
  7443. * |31 24|23 16|15 8|7 0|
  7444. * |----------------+----------------+----------------+----------------|
  7445. * | reserved | major number | minor number | msg type |
  7446. * |-------------------------------------------------------------------|
  7447. * : option request TLV (optional) |
  7448. * :...................................................................:
  7449. *
  7450. * The VER_CONF message may consist of a single 4-byte word, or may be
  7451. * extended with TLVs that specify HTT options selected by the target.
  7452. * The following option TLVs may be appended to the VER_CONF message:
  7453. * - LL_BUS_ADDR_SIZE
  7454. * - HL_SUPPRESS_TX_COMPL_IND
  7455. * - MAX_TX_QUEUE_GROUPS
  7456. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7457. * may be appended to the VER_CONF message (but only one TLV of each type).
  7458. *
  7459. * Header fields:
  7460. * - MSG_TYPE
  7461. * Bits 7:0
  7462. * Purpose: identifies this as a version number confirmation message
  7463. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7464. * - VER_MINOR
  7465. * Bits 15:8
  7466. * Purpose: Specify the minor number of the HTT message library version
  7467. * in use by the target firmware.
  7468. * The minor number specifies the specific revision within a range
  7469. * of fundamentally compatible HTT message definition revisions.
  7470. * Compatible revisions involve adding new messages or perhaps
  7471. * adding new fields to existing messages, in a backwards-compatible
  7472. * manner.
  7473. * Incompatible revisions involve changing the message type values,
  7474. * or redefining existing messages.
  7475. * Value: minor number
  7476. * - VER_MAJOR
  7477. * Bits 15:8
  7478. * Purpose: Specify the major number of the HTT message library version
  7479. * in use by the target firmware.
  7480. * The major number specifies the family of minor revisions that are
  7481. * fundamentally compatible with each other, but not with prior or
  7482. * later families.
  7483. * Value: major number
  7484. */
  7485. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7486. #define HTT_VER_CONF_MINOR_S 8
  7487. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7488. #define HTT_VER_CONF_MAJOR_S 16
  7489. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7490. do { \
  7491. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7492. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7493. } while (0)
  7494. #define HTT_VER_CONF_MINOR_GET(word) \
  7495. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7496. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7497. do { \
  7498. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7499. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7500. } while (0)
  7501. #define HTT_VER_CONF_MAJOR_GET(word) \
  7502. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7503. #define HTT_VER_CONF_BYTES 4
  7504. /**
  7505. * @brief - target -> host HTT Rx In order indication message
  7506. *
  7507. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7508. *
  7509. * @details
  7510. *
  7511. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7512. * |----------------+-------------------+---------------------+---------------|
  7513. * | peer ID | P| F| O| ext TID | msg type |
  7514. * |--------------------------------------------------------------------------|
  7515. * | MSDU count | Reserved | vdev id |
  7516. * |--------------------------------------------------------------------------|
  7517. * | MSDU 0 bus address (bits 31:0) |
  7518. #if HTT_PADDR64
  7519. * | MSDU 0 bus address (bits 63:32) |
  7520. #endif
  7521. * |--------------------------------------------------------------------------|
  7522. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7523. * |--------------------------------------------------------------------------|
  7524. * | MSDU 1 bus address (bits 31:0) |
  7525. #if HTT_PADDR64
  7526. * | MSDU 1 bus address (bits 63:32) |
  7527. #endif
  7528. * |--------------------------------------------------------------------------|
  7529. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7530. * |--------------------------------------------------------------------------|
  7531. */
  7532. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7533. *
  7534. * @details
  7535. * bits
  7536. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7537. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7538. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7539. * | | frag | | | | fail |chksum fail|
  7540. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7541. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7542. */
  7543. struct htt_rx_in_ord_paddr_ind_hdr_t
  7544. {
  7545. A_UINT32 /* word 0 */
  7546. msg_type: 8,
  7547. ext_tid: 5,
  7548. offload: 1,
  7549. frag: 1,
  7550. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7551. peer_id: 16;
  7552. A_UINT32 /* word 1 */
  7553. vap_id: 8,
  7554. /* NOTE:
  7555. * This reserved_1 field is not truly reserved - certain targets use
  7556. * this field internally to store debug information, and do not zero
  7557. * out the contents of the field before uploading the message to the
  7558. * host. Thus, any host-target communication supported by this field
  7559. * is limited to using values that are never used by the debug
  7560. * information stored by certain targets in the reserved_1 field.
  7561. * In particular, the targets in question don't use the value 0x3
  7562. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7563. * so this previously-unused value within these bits is available to
  7564. * use as the host / target PKT_CAPTURE_MODE flag.
  7565. */
  7566. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7567. /* if pkt_capture_mode == 0x3, host should
  7568. * send rx frames to monitor mode interface
  7569. */
  7570. msdu_cnt: 16;
  7571. };
  7572. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7573. {
  7574. A_UINT32 dma_addr;
  7575. A_UINT32
  7576. length: 16,
  7577. fw_desc: 8,
  7578. msdu_info:8;
  7579. };
  7580. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7581. {
  7582. A_UINT32 dma_addr_lo;
  7583. A_UINT32 dma_addr_hi;
  7584. A_UINT32
  7585. length: 16,
  7586. fw_desc: 8,
  7587. msdu_info:8;
  7588. };
  7589. #if HTT_PADDR64
  7590. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7591. #else
  7592. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7593. #endif
  7594. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7595. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7596. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7597. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7598. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7599. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7600. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7601. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7602. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7603. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7604. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7605. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7606. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7607. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7608. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7609. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7610. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7611. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7612. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7613. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7614. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7615. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7616. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7617. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7618. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7619. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7620. /* for systems using 64-bit format for bus addresses */
  7621. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7622. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7623. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7624. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7625. /* for systems using 32-bit format for bus addresses */
  7626. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7627. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7628. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7629. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7630. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7631. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7632. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7633. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7634. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7635. do { \
  7636. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7637. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7638. } while (0)
  7639. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7640. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7641. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7644. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7645. } while (0)
  7646. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7647. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7648. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7649. do { \
  7650. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7651. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7652. } while (0)
  7653. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7654. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7655. /*
  7656. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7657. * deliver the rx frames to the monitor mode interface.
  7658. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7659. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7660. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7661. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7662. */
  7663. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7664. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7665. do { \
  7666. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7667. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7668. } while (0)
  7669. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7670. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7671. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7672. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7673. do { \
  7674. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7675. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7676. } while (0)
  7677. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7678. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7679. /* for systems using 64-bit format for bus addresses */
  7680. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7681. do { \
  7682. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7683. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7684. } while (0)
  7685. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7686. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7687. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7690. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7691. } while (0)
  7692. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7693. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7694. /* for systems using 32-bit format for bus addresses */
  7695. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7696. do { \
  7697. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7698. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7699. } while (0)
  7700. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7701. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7702. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7705. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7706. } while (0)
  7707. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7708. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7709. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7712. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7713. } while (0)
  7714. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7715. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7716. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7717. do { \
  7718. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7719. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7720. } while (0)
  7721. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7722. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7723. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7726. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7727. } while (0)
  7728. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7729. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7730. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7731. do { \
  7732. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7733. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7734. } while (0)
  7735. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7736. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7737. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7738. do { \
  7739. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7740. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7741. } while (0)
  7742. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7743. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7744. /* definitions used within target -> host rx indication message */
  7745. PREPACK struct htt_rx_ind_hdr_prefix_t
  7746. {
  7747. A_UINT32 /* word 0 */
  7748. msg_type: 8,
  7749. ext_tid: 5,
  7750. release_valid: 1,
  7751. flush_valid: 1,
  7752. reserved0: 1,
  7753. peer_id: 16;
  7754. A_UINT32 /* word 1 */
  7755. flush_start_seq_num: 6,
  7756. flush_end_seq_num: 6,
  7757. release_start_seq_num: 6,
  7758. release_end_seq_num: 6,
  7759. num_mpdu_ranges: 8;
  7760. } POSTPACK;
  7761. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7762. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7763. #define HTT_TGT_RSSI_INVALID 0x80
  7764. PREPACK struct htt_rx_ppdu_desc_t
  7765. {
  7766. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7767. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7768. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7769. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7770. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7771. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7772. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7773. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7774. A_UINT32 /* word 0 */
  7775. rssi_cmb: 8,
  7776. timestamp_submicrosec: 8,
  7777. phy_err_code: 8,
  7778. phy_err: 1,
  7779. legacy_rate: 4,
  7780. legacy_rate_sel: 1,
  7781. end_valid: 1,
  7782. start_valid: 1;
  7783. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7784. union {
  7785. A_UINT32 /* word 1 */
  7786. rssi0_pri20: 8,
  7787. rssi0_ext20: 8,
  7788. rssi0_ext40: 8,
  7789. rssi0_ext80: 8;
  7790. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7791. } u0;
  7792. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7793. union {
  7794. A_UINT32 /* word 2 */
  7795. rssi1_pri20: 8,
  7796. rssi1_ext20: 8,
  7797. rssi1_ext40: 8,
  7798. rssi1_ext80: 8;
  7799. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7800. } u1;
  7801. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7802. union {
  7803. A_UINT32 /* word 3 */
  7804. rssi2_pri20: 8,
  7805. rssi2_ext20: 8,
  7806. rssi2_ext40: 8,
  7807. rssi2_ext80: 8;
  7808. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7809. } u2;
  7810. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7811. union {
  7812. A_UINT32 /* word 4 */
  7813. rssi3_pri20: 8,
  7814. rssi3_ext20: 8,
  7815. rssi3_ext40: 8,
  7816. rssi3_ext80: 8;
  7817. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7818. } u3;
  7819. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7820. A_UINT32 tsf32; /* word 5 */
  7821. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7822. A_UINT32 timestamp_microsec; /* word 6 */
  7823. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7824. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7825. A_UINT32 /* word 7 */
  7826. vht_sig_a1: 24,
  7827. preamble_type: 8;
  7828. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7829. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7830. A_UINT32 /* word 8 */
  7831. vht_sig_a2: 24,
  7832. /* sa_ant_matrix
  7833. * For cases where a single rx chain has options to be connected to
  7834. * different rx antennas, show which rx antennas were in use during
  7835. * receipt of a given PPDU.
  7836. * This sa_ant_matrix provides a bitmask of the antennas used while
  7837. * receiving this frame.
  7838. */
  7839. sa_ant_matrix: 8;
  7840. } POSTPACK;
  7841. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7842. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7843. PREPACK struct htt_rx_ind_hdr_suffix_t
  7844. {
  7845. A_UINT32 /* word 0 */
  7846. fw_rx_desc_bytes: 16,
  7847. reserved0: 16;
  7848. } POSTPACK;
  7849. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7850. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7851. PREPACK struct htt_rx_ind_hdr_t
  7852. {
  7853. struct htt_rx_ind_hdr_prefix_t prefix;
  7854. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7855. struct htt_rx_ind_hdr_suffix_t suffix;
  7856. } POSTPACK;
  7857. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7858. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7859. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7860. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7861. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7862. /*
  7863. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7864. * the offset into the HTT rx indication message at which the
  7865. * FW rx PPDU descriptor resides
  7866. */
  7867. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7868. /*
  7869. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7870. * the offset into the HTT rx indication message at which the
  7871. * header suffix (FW rx MSDU byte count) resides
  7872. */
  7873. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7874. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7875. /*
  7876. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7877. * the offset into the HTT rx indication message at which the per-MSDU
  7878. * information starts
  7879. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7880. * per-MSDU information portion of the message. The per-MSDU info itself
  7881. * starts at byte 12.
  7882. */
  7883. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7884. /**
  7885. * @brief target -> host rx indication message definition
  7886. *
  7887. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7888. *
  7889. * @details
  7890. * The following field definitions describe the format of the rx indication
  7891. * message sent from the target to the host.
  7892. * The message consists of three major sections:
  7893. * 1. a fixed-length header
  7894. * 2. a variable-length list of firmware rx MSDU descriptors
  7895. * 3. one or more 4-octet MPDU range information elements
  7896. * The fixed length header itself has two sub-sections
  7897. * 1. the message meta-information, including identification of the
  7898. * sender and type of the received data, and a 4-octet flush/release IE
  7899. * 2. the firmware rx PPDU descriptor
  7900. *
  7901. * The format of the message is depicted below.
  7902. * in this depiction, the following abbreviations are used for information
  7903. * elements within the message:
  7904. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7905. * elements associated with the PPDU start are valid.
  7906. * Specifically, the following fields are valid only if SV is set:
  7907. * RSSI (all variants), L, legacy rate, preamble type, service,
  7908. * VHT-SIG-A
  7909. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7910. * elements associated with the PPDU end are valid.
  7911. * Specifically, the following fields are valid only if EV is set:
  7912. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7913. * - L - Legacy rate selector - if legacy rates are used, this flag
  7914. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7915. * (L == 0) PHY.
  7916. * - P - PHY error flag - boolean indication of whether the rx frame had
  7917. * a PHY error
  7918. *
  7919. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7920. * |----------------+-------------------+---------------------+---------------|
  7921. * | peer ID | |RV|FV| ext TID | msg type |
  7922. * |--------------------------------------------------------------------------|
  7923. * | num | release | release | flush | flush |
  7924. * | MPDU | end | start | end | start |
  7925. * | ranges | seq num | seq num | seq num | seq num |
  7926. * |==========================================================================|
  7927. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7928. * |V|V| | rate | | | timestamp | RSSI |
  7929. * |--------------------------------------------------------------------------|
  7930. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7931. * |--------------------------------------------------------------------------|
  7932. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7933. * |--------------------------------------------------------------------------|
  7934. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7935. * |--------------------------------------------------------------------------|
  7936. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7937. * |--------------------------------------------------------------------------|
  7938. * | TSF LSBs |
  7939. * |--------------------------------------------------------------------------|
  7940. * | microsec timestamp |
  7941. * |--------------------------------------------------------------------------|
  7942. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7943. * |--------------------------------------------------------------------------|
  7944. * | service | HT-SIG / VHT-SIG-A2 |
  7945. * |==========================================================================|
  7946. * | reserved | FW rx desc bytes |
  7947. * |--------------------------------------------------------------------------|
  7948. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7949. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7950. * |--------------------------------------------------------------------------|
  7951. * : : :
  7952. * |--------------------------------------------------------------------------|
  7953. * | alignment | MSDU Rx |
  7954. * | padding | desc Bn |
  7955. * |--------------------------------------------------------------------------|
  7956. * | reserved | MPDU range status | MPDU count |
  7957. * |--------------------------------------------------------------------------|
  7958. * : reserved : MPDU range status : MPDU count :
  7959. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7960. *
  7961. * Header fields:
  7962. * - MSG_TYPE
  7963. * Bits 7:0
  7964. * Purpose: identifies this as an rx indication message
  7965. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7966. * - EXT_TID
  7967. * Bits 12:8
  7968. * Purpose: identify the traffic ID of the rx data, including
  7969. * special "extended" TID values for multicast, broadcast, and
  7970. * non-QoS data frames
  7971. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7972. * - FLUSH_VALID (FV)
  7973. * Bit 13
  7974. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7975. * is valid
  7976. * Value:
  7977. * 1 -> flush IE is valid and needs to be processed
  7978. * 0 -> flush IE is not valid and should be ignored
  7979. * - REL_VALID (RV)
  7980. * Bit 13
  7981. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7982. * is valid
  7983. * Value:
  7984. * 1 -> release IE is valid and needs to be processed
  7985. * 0 -> release IE is not valid and should be ignored
  7986. * - PEER_ID
  7987. * Bits 31:16
  7988. * Purpose: Identify, by ID, which peer sent the rx data
  7989. * Value: ID of the peer who sent the rx data
  7990. * - FLUSH_SEQ_NUM_START
  7991. * Bits 5:0
  7992. * Purpose: Indicate the start of a series of MPDUs to flush
  7993. * Not all MPDUs within this series are necessarily valid - the host
  7994. * must check each sequence number within this range to see if the
  7995. * corresponding MPDU is actually present.
  7996. * This field is only valid if the FV bit is set.
  7997. * Value:
  7998. * The sequence number for the first MPDUs to check to flush.
  7999. * The sequence number is masked by 0x3f.
  8000. * - FLUSH_SEQ_NUM_END
  8001. * Bits 11:6
  8002. * Purpose: Indicate the end of a series of MPDUs to flush
  8003. * Value:
  8004. * The sequence number one larger than the sequence number of the
  8005. * last MPDU to check to flush.
  8006. * The sequence number is masked by 0x3f.
  8007. * Not all MPDUs within this series are necessarily valid - the host
  8008. * must check each sequence number within this range to see if the
  8009. * corresponding MPDU is actually present.
  8010. * This field is only valid if the FV bit is set.
  8011. * - REL_SEQ_NUM_START
  8012. * Bits 17:12
  8013. * Purpose: Indicate the start of a series of MPDUs to release.
  8014. * All MPDUs within this series are present and valid - the host
  8015. * need not check each sequence number within this range to see if
  8016. * the corresponding MPDU is actually present.
  8017. * This field is only valid if the RV bit is set.
  8018. * Value:
  8019. * The sequence number for the first MPDUs to check to release.
  8020. * The sequence number is masked by 0x3f.
  8021. * - REL_SEQ_NUM_END
  8022. * Bits 23:18
  8023. * Purpose: Indicate the end of a series of MPDUs to release.
  8024. * Value:
  8025. * The sequence number one larger than the sequence number of the
  8026. * last MPDU to check to release.
  8027. * The sequence number is masked by 0x3f.
  8028. * All MPDUs within this series are present and valid - the host
  8029. * need not check each sequence number within this range to see if
  8030. * the corresponding MPDU is actually present.
  8031. * This field is only valid if the RV bit is set.
  8032. * - NUM_MPDU_RANGES
  8033. * Bits 31:24
  8034. * Purpose: Indicate how many ranges of MPDUs are present.
  8035. * Each MPDU range consists of a series of contiguous MPDUs within the
  8036. * rx frame sequence which all have the same MPDU status.
  8037. * Value: 1-63 (typically a small number, like 1-3)
  8038. *
  8039. * Rx PPDU descriptor fields:
  8040. * - RSSI_CMB
  8041. * Bits 7:0
  8042. * Purpose: Combined RSSI from all active rx chains, across the active
  8043. * bandwidth.
  8044. * Value: RSSI dB units w.r.t. noise floor
  8045. * - TIMESTAMP_SUBMICROSEC
  8046. * Bits 15:8
  8047. * Purpose: high-resolution timestamp
  8048. * Value:
  8049. * Sub-microsecond time of PPDU reception.
  8050. * This timestamp ranges from [0,MAC clock MHz).
  8051. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8052. * to form a high-resolution, large range rx timestamp.
  8053. * - PHY_ERR_CODE
  8054. * Bits 23:16
  8055. * Purpose:
  8056. * If the rx frame processing resulted in a PHY error, indicate what
  8057. * type of rx PHY error occurred.
  8058. * Value:
  8059. * This field is valid if the "P" (PHY_ERR) flag is set.
  8060. * TBD: document/specify the values for this field
  8061. * - PHY_ERR
  8062. * Bit 24
  8063. * Purpose: indicate whether the rx PPDU had a PHY error
  8064. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8065. * - LEGACY_RATE
  8066. * Bits 28:25
  8067. * Purpose:
  8068. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8069. * specify which rate was used.
  8070. * Value:
  8071. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8072. * flag.
  8073. * If LEGACY_RATE_SEL is 0:
  8074. * 0x8: OFDM 48 Mbps
  8075. * 0x9: OFDM 24 Mbps
  8076. * 0xA: OFDM 12 Mbps
  8077. * 0xB: OFDM 6 Mbps
  8078. * 0xC: OFDM 54 Mbps
  8079. * 0xD: OFDM 36 Mbps
  8080. * 0xE: OFDM 18 Mbps
  8081. * 0xF: OFDM 9 Mbps
  8082. * If LEGACY_RATE_SEL is 1:
  8083. * 0x8: CCK 11 Mbps long preamble
  8084. * 0x9: CCK 5.5 Mbps long preamble
  8085. * 0xA: CCK 2 Mbps long preamble
  8086. * 0xB: CCK 1 Mbps long preamble
  8087. * 0xC: CCK 11 Mbps short preamble
  8088. * 0xD: CCK 5.5 Mbps short preamble
  8089. * 0xE: CCK 2 Mbps short preamble
  8090. * - LEGACY_RATE_SEL
  8091. * Bit 29
  8092. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8093. * Value:
  8094. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8095. * used a legacy rate.
  8096. * 0 -> OFDM, 1 -> CCK
  8097. * - END_VALID
  8098. * Bit 30
  8099. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8100. * the start of the PPDU are valid. Specifically, the following
  8101. * fields are only valid if END_VALID is set:
  8102. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8103. * TIMESTAMP_SUBMICROSEC
  8104. * Value:
  8105. * 0 -> rx PPDU desc end fields are not valid
  8106. * 1 -> rx PPDU desc end fields are valid
  8107. * - START_VALID
  8108. * Bit 31
  8109. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8110. * the end of the PPDU are valid. Specifically, the following
  8111. * fields are only valid if START_VALID is set:
  8112. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8113. * VHT-SIG-A
  8114. * Value:
  8115. * 0 -> rx PPDU desc start fields are not valid
  8116. * 1 -> rx PPDU desc start fields are valid
  8117. * - RSSI0_PRI20
  8118. * Bits 7:0
  8119. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8120. * Value: RSSI dB units w.r.t. noise floor
  8121. *
  8122. * - RSSI0_EXT20
  8123. * Bits 7:0
  8124. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8125. * (if the rx bandwidth was >= 40 MHz)
  8126. * Value: RSSI dB units w.r.t. noise floor
  8127. * - RSSI0_EXT40
  8128. * Bits 7:0
  8129. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8130. * (if the rx bandwidth was >= 80 MHz)
  8131. * Value: RSSI dB units w.r.t. noise floor
  8132. * - RSSI0_EXT80
  8133. * Bits 7:0
  8134. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8135. * (if the rx bandwidth was >= 160 MHz)
  8136. * Value: RSSI dB units w.r.t. noise floor
  8137. *
  8138. * - RSSI1_PRI20
  8139. * Bits 7:0
  8140. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8141. * Value: RSSI dB units w.r.t. noise floor
  8142. * - RSSI1_EXT20
  8143. * Bits 7:0
  8144. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8145. * (if the rx bandwidth was >= 40 MHz)
  8146. * Value: RSSI dB units w.r.t. noise floor
  8147. * - RSSI1_EXT40
  8148. * Bits 7:0
  8149. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8150. * (if the rx bandwidth was >= 80 MHz)
  8151. * Value: RSSI dB units w.r.t. noise floor
  8152. * - RSSI1_EXT80
  8153. * Bits 7:0
  8154. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8155. * (if the rx bandwidth was >= 160 MHz)
  8156. * Value: RSSI dB units w.r.t. noise floor
  8157. *
  8158. * - RSSI2_PRI20
  8159. * Bits 7:0
  8160. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8161. * Value: RSSI dB units w.r.t. noise floor
  8162. * - RSSI2_EXT20
  8163. * Bits 7:0
  8164. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8165. * (if the rx bandwidth was >= 40 MHz)
  8166. * Value: RSSI dB units w.r.t. noise floor
  8167. * - RSSI2_EXT40
  8168. * Bits 7:0
  8169. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8170. * (if the rx bandwidth was >= 80 MHz)
  8171. * Value: RSSI dB units w.r.t. noise floor
  8172. * - RSSI2_EXT80
  8173. * Bits 7:0
  8174. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8175. * (if the rx bandwidth was >= 160 MHz)
  8176. * Value: RSSI dB units w.r.t. noise floor
  8177. *
  8178. * - RSSI3_PRI20
  8179. * Bits 7:0
  8180. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8181. * Value: RSSI dB units w.r.t. noise floor
  8182. * - RSSI3_EXT20
  8183. * Bits 7:0
  8184. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8185. * (if the rx bandwidth was >= 40 MHz)
  8186. * Value: RSSI dB units w.r.t. noise floor
  8187. * - RSSI3_EXT40
  8188. * Bits 7:0
  8189. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8190. * (if the rx bandwidth was >= 80 MHz)
  8191. * Value: RSSI dB units w.r.t. noise floor
  8192. * - RSSI3_EXT80
  8193. * Bits 7:0
  8194. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8195. * (if the rx bandwidth was >= 160 MHz)
  8196. * Value: RSSI dB units w.r.t. noise floor
  8197. *
  8198. * - TSF32
  8199. * Bits 31:0
  8200. * Purpose: specify the time the rx PPDU was received, in TSF units
  8201. * Value: 32 LSBs of the TSF
  8202. * - TIMESTAMP_MICROSEC
  8203. * Bits 31:0
  8204. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8205. * Value: PPDU rx time, in microseconds
  8206. * - VHT_SIG_A1
  8207. * Bits 23:0
  8208. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8209. * from the rx PPDU
  8210. * Value:
  8211. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8212. * VHT-SIG-A1 data.
  8213. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8214. * first 24 bits of the HT-SIG data.
  8215. * Otherwise, this field is invalid.
  8216. * Refer to the the 802.11 protocol for the definition of the
  8217. * HT-SIG and VHT-SIG-A1 fields
  8218. * - VHT_SIG_A2
  8219. * Bits 23:0
  8220. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8221. * from the rx PPDU
  8222. * Value:
  8223. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8224. * VHT-SIG-A2 data.
  8225. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8226. * last 24 bits of the HT-SIG data.
  8227. * Otherwise, this field is invalid.
  8228. * Refer to the the 802.11 protocol for the definition of the
  8229. * HT-SIG and VHT-SIG-A2 fields
  8230. * - PREAMBLE_TYPE
  8231. * Bits 31:24
  8232. * Purpose: indicate the PHY format of the received burst
  8233. * Value:
  8234. * 0x4: Legacy (OFDM/CCK)
  8235. * 0x8: HT
  8236. * 0x9: HT with TxBF
  8237. * 0xC: VHT
  8238. * 0xD: VHT with TxBF
  8239. * - SERVICE
  8240. * Bits 31:24
  8241. * Purpose: TBD
  8242. * Value: TBD
  8243. *
  8244. * Rx MSDU descriptor fields:
  8245. * - FW_RX_DESC_BYTES
  8246. * Bits 15:0
  8247. * Purpose: Indicate how many bytes in the Rx indication are used for
  8248. * FW Rx descriptors
  8249. *
  8250. * Payload fields:
  8251. * - MPDU_COUNT
  8252. * Bits 7:0
  8253. * Purpose: Indicate how many sequential MPDUs share the same status.
  8254. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8255. * - MPDU_STATUS
  8256. * Bits 15:8
  8257. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8258. * received successfully.
  8259. * Value:
  8260. * 0x1: success
  8261. * 0x2: FCS error
  8262. * 0x3: duplicate error
  8263. * 0x4: replay error
  8264. * 0x5: invalid peer
  8265. */
  8266. /* header fields */
  8267. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8268. #define HTT_RX_IND_EXT_TID_S 8
  8269. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8270. #define HTT_RX_IND_FLUSH_VALID_S 13
  8271. #define HTT_RX_IND_REL_VALID_M 0x4000
  8272. #define HTT_RX_IND_REL_VALID_S 14
  8273. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8274. #define HTT_RX_IND_PEER_ID_S 16
  8275. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8276. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8277. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8278. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8279. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8280. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8281. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8282. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8283. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8284. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8285. /* rx PPDU descriptor fields */
  8286. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8287. #define HTT_RX_IND_RSSI_CMB_S 0
  8288. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8289. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8290. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8291. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8292. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8293. #define HTT_RX_IND_PHY_ERR_S 24
  8294. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8295. #define HTT_RX_IND_LEGACY_RATE_S 25
  8296. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8297. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8298. #define HTT_RX_IND_END_VALID_M 0x40000000
  8299. #define HTT_RX_IND_END_VALID_S 30
  8300. #define HTT_RX_IND_START_VALID_M 0x80000000
  8301. #define HTT_RX_IND_START_VALID_S 31
  8302. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8303. #define HTT_RX_IND_RSSI_PRI20_S 0
  8304. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8305. #define HTT_RX_IND_RSSI_EXT20_S 8
  8306. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8307. #define HTT_RX_IND_RSSI_EXT40_S 16
  8308. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8309. #define HTT_RX_IND_RSSI_EXT80_S 24
  8310. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8311. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8312. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8313. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8314. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8315. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8316. #define HTT_RX_IND_SERVICE_M 0xff000000
  8317. #define HTT_RX_IND_SERVICE_S 24
  8318. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8319. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8320. /* rx MSDU descriptor fields */
  8321. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8322. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8323. /* payload fields */
  8324. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8325. #define HTT_RX_IND_MPDU_COUNT_S 0
  8326. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8327. #define HTT_RX_IND_MPDU_STATUS_S 8
  8328. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8329. do { \
  8330. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8331. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8332. } while (0)
  8333. #define HTT_RX_IND_EXT_TID_GET(word) \
  8334. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8335. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8336. do { \
  8337. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8338. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8339. } while (0)
  8340. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8341. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8342. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8343. do { \
  8344. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8345. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8346. } while (0)
  8347. #define HTT_RX_IND_REL_VALID_GET(word) \
  8348. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8349. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8352. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8353. } while (0)
  8354. #define HTT_RX_IND_PEER_ID_GET(word) \
  8355. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8356. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8357. do { \
  8358. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8359. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8360. } while (0)
  8361. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8362. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8363. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8364. do { \
  8365. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8366. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8367. } while (0)
  8368. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8369. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8370. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8371. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8372. do { \
  8373. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8374. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8375. } while (0)
  8376. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8377. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8378. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8379. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8380. do { \
  8381. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8382. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8383. } while (0)
  8384. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8385. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8386. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8387. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8390. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8391. } while (0)
  8392. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8393. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8394. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8395. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8396. do { \
  8397. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8398. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8399. } while (0)
  8400. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8401. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8402. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8403. /* FW rx PPDU descriptor fields */
  8404. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8405. do { \
  8406. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8407. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8408. } while (0)
  8409. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8410. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8411. HTT_RX_IND_RSSI_CMB_S)
  8412. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8413. do { \
  8414. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8415. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8416. } while (0)
  8417. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8418. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8419. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8420. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8421. do { \
  8422. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8423. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8424. } while (0)
  8425. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8426. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8427. HTT_RX_IND_PHY_ERR_CODE_S)
  8428. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8429. do { \
  8430. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8431. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8432. } while (0)
  8433. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8434. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8435. HTT_RX_IND_PHY_ERR_S)
  8436. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8437. do { \
  8438. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8439. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8440. } while (0)
  8441. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8442. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8443. HTT_RX_IND_LEGACY_RATE_S)
  8444. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8445. do { \
  8446. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8447. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8448. } while (0)
  8449. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8450. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8451. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8452. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8453. do { \
  8454. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8455. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8456. } while (0)
  8457. #define HTT_RX_IND_END_VALID_GET(word) \
  8458. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8459. HTT_RX_IND_END_VALID_S)
  8460. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8461. do { \
  8462. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8463. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8464. } while (0)
  8465. #define HTT_RX_IND_START_VALID_GET(word) \
  8466. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8467. HTT_RX_IND_START_VALID_S)
  8468. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8469. do { \
  8470. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8471. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8472. } while (0)
  8473. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8474. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8475. HTT_RX_IND_RSSI_PRI20_S)
  8476. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8477. do { \
  8478. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8479. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8480. } while (0)
  8481. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8482. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8483. HTT_RX_IND_RSSI_EXT20_S)
  8484. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8485. do { \
  8486. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8487. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8488. } while (0)
  8489. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8490. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8491. HTT_RX_IND_RSSI_EXT40_S)
  8492. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8493. do { \
  8494. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8495. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8496. } while (0)
  8497. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8498. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8499. HTT_RX_IND_RSSI_EXT80_S)
  8500. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8501. do { \
  8502. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8503. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8504. } while (0)
  8505. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8506. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8507. HTT_RX_IND_VHT_SIG_A1_S)
  8508. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8511. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8512. } while (0)
  8513. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8514. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8515. HTT_RX_IND_VHT_SIG_A2_S)
  8516. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8517. do { \
  8518. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8519. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8520. } while (0)
  8521. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8522. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8523. HTT_RX_IND_PREAMBLE_TYPE_S)
  8524. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8525. do { \
  8526. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8527. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8528. } while (0)
  8529. #define HTT_RX_IND_SERVICE_GET(word) \
  8530. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8531. HTT_RX_IND_SERVICE_S)
  8532. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8533. do { \
  8534. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8535. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8536. } while (0)
  8537. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8538. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8539. HTT_RX_IND_SA_ANT_MATRIX_S)
  8540. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8541. do { \
  8542. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8543. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8544. } while (0)
  8545. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8546. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8547. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8548. do { \
  8549. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8550. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8551. } while (0)
  8552. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8553. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8554. #define HTT_RX_IND_HL_BYTES \
  8555. (HTT_RX_IND_HDR_BYTES + \
  8556. 4 /* single FW rx MSDU descriptor */ + \
  8557. 4 /* single MPDU range information element */)
  8558. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8559. /* Could we use one macro entry? */
  8560. #define HTT_WORD_SET(word, field, value) \
  8561. do { \
  8562. HTT_CHECK_SET_VAL(field, value); \
  8563. (word) |= ((value) << field ## _S); \
  8564. } while (0)
  8565. #define HTT_WORD_GET(word, field) \
  8566. (((word) & field ## _M) >> field ## _S)
  8567. PREPACK struct hl_htt_rx_ind_base {
  8568. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8569. } POSTPACK;
  8570. /*
  8571. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8572. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8573. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8574. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8575. * htt_rx_ind_hl_rx_desc_t.
  8576. */
  8577. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8578. struct htt_rx_ind_hl_rx_desc_t {
  8579. A_UINT8 ver;
  8580. A_UINT8 len;
  8581. struct {
  8582. A_UINT8
  8583. first_msdu: 1,
  8584. last_msdu: 1,
  8585. c3_failed: 1,
  8586. c4_failed: 1,
  8587. ipv6: 1,
  8588. tcp: 1,
  8589. udp: 1,
  8590. reserved: 1;
  8591. } flags;
  8592. /* NOTE: no reserved space - don't append any new fields here */
  8593. };
  8594. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8595. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8596. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8597. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8598. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8599. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8600. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8601. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8602. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8603. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8604. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8605. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8606. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8607. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8608. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8609. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8610. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8611. /* This structure is used in HL, the basic descriptor information
  8612. * used by host. the structure is translated by FW from HW desc
  8613. * or generated by FW. But in HL monitor mode, the host would use
  8614. * the same structure with LL.
  8615. */
  8616. PREPACK struct hl_htt_rx_desc_base {
  8617. A_UINT32
  8618. seq_num:12,
  8619. encrypted:1,
  8620. chan_info_present:1,
  8621. resv0:2,
  8622. mcast_bcast:1,
  8623. fragment:1,
  8624. key_id_oct:8,
  8625. resv1:6;
  8626. A_UINT32
  8627. pn_31_0;
  8628. union {
  8629. struct {
  8630. A_UINT16 pn_47_32;
  8631. A_UINT16 pn_63_48;
  8632. } pn16;
  8633. A_UINT32 pn_63_32;
  8634. } u0;
  8635. A_UINT32
  8636. pn_95_64;
  8637. A_UINT32
  8638. pn_127_96;
  8639. } POSTPACK;
  8640. /*
  8641. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8642. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8643. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8644. * Please see htt_chan_change_t for description of the fields.
  8645. */
  8646. PREPACK struct htt_chan_info_t
  8647. {
  8648. A_UINT32 primary_chan_center_freq_mhz: 16,
  8649. contig_chan1_center_freq_mhz: 16;
  8650. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8651. phy_mode: 8,
  8652. reserved: 8;
  8653. } POSTPACK;
  8654. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8655. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8656. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8657. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8658. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8659. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8660. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8661. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8662. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8663. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8664. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8665. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8666. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8667. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8668. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8669. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8670. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8671. /* Channel information */
  8672. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8673. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8674. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8675. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8676. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8677. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8678. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8679. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8680. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8681. do { \
  8682. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8683. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8684. } while (0)
  8685. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8686. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8687. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8688. do { \
  8689. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8690. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8691. } while (0)
  8692. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8693. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8694. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8697. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8698. } while (0)
  8699. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8700. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8701. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8702. do { \
  8703. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8704. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8705. } while (0)
  8706. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8707. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8708. /*
  8709. * @brief target -> host message definition for FW offloaded pkts
  8710. *
  8711. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8712. *
  8713. * @details
  8714. * The following field definitions describe the format of the firmware
  8715. * offload deliver message sent from the target to the host.
  8716. *
  8717. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8718. *
  8719. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8720. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8721. * | reserved_1 | msg type |
  8722. * |--------------------------------------------------------------------------|
  8723. * | phy_timestamp_l32 |
  8724. * |--------------------------------------------------------------------------|
  8725. * | WORD2 (see below) |
  8726. * |--------------------------------------------------------------------------|
  8727. * | seqno | framectrl |
  8728. * |--------------------------------------------------------------------------|
  8729. * | reserved_3 | vdev_id | tid_num|
  8730. * |--------------------------------------------------------------------------|
  8731. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8732. * |--------------------------------------------------------------------------|
  8733. *
  8734. * where:
  8735. * STAT = status
  8736. * F = format (802.3 vs. 802.11)
  8737. *
  8738. * definition for word 2
  8739. *
  8740. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8741. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8742. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8743. * |--------------------------------------------------------------------------|
  8744. *
  8745. * where:
  8746. * PR = preamble
  8747. * BF = beamformed
  8748. */
  8749. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8750. {
  8751. A_UINT32 /* word 0 */
  8752. msg_type:8, /* [ 7: 0] */
  8753. reserved_1:24; /* [31: 8] */
  8754. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8755. A_UINT32 /* word 2 */
  8756. /* preamble:
  8757. * 0-OFDM,
  8758. * 1-CCk,
  8759. * 2-HT,
  8760. * 3-VHT
  8761. */
  8762. preamble: 2, /* [1:0] */
  8763. /* mcs:
  8764. * In case of HT preamble interpret
  8765. * MCS along with NSS.
  8766. * Valid values for HT are 0 to 7.
  8767. * HT mcs 0 with NSS 2 is mcs 8.
  8768. * Valid values for VHT are 0 to 9.
  8769. */
  8770. mcs: 4, /* [5:2] */
  8771. /* rate:
  8772. * This is applicable only for
  8773. * CCK and OFDM preamble type
  8774. * rate 0: OFDM 48 Mbps,
  8775. * 1: OFDM 24 Mbps,
  8776. * 2: OFDM 12 Mbps
  8777. * 3: OFDM 6 Mbps
  8778. * 4: OFDM 54 Mbps
  8779. * 5: OFDM 36 Mbps
  8780. * 6: OFDM 18 Mbps
  8781. * 7: OFDM 9 Mbps
  8782. * rate 0: CCK 11 Mbps Long
  8783. * 1: CCK 5.5 Mbps Long
  8784. * 2: CCK 2 Mbps Long
  8785. * 3: CCK 1 Mbps Long
  8786. * 4: CCK 11 Mbps Short
  8787. * 5: CCK 5.5 Mbps Short
  8788. * 6: CCK 2 Mbps Short
  8789. */
  8790. rate : 3, /* [ 8: 6] */
  8791. rssi : 8, /* [16: 9] units=dBm */
  8792. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8793. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8794. stbc : 1, /* [22] */
  8795. sgi : 1, /* [23] */
  8796. ldpc : 1, /* [24] */
  8797. beamformed: 1, /* [25] */
  8798. reserved_2: 6; /* [31:26] */
  8799. A_UINT32 /* word 3 */
  8800. framectrl:16, /* [15: 0] */
  8801. seqno:16; /* [31:16] */
  8802. A_UINT32 /* word 4 */
  8803. tid_num:5, /* [ 4: 0] actual TID number */
  8804. vdev_id:8, /* [12: 5] */
  8805. reserved_3:19; /* [31:13] */
  8806. A_UINT32 /* word 5 */
  8807. /* status:
  8808. * 0: tx_ok
  8809. * 1: retry
  8810. * 2: drop
  8811. * 3: filtered
  8812. * 4: abort
  8813. * 5: tid delete
  8814. * 6: sw abort
  8815. * 7: dropped by peer migration
  8816. */
  8817. status:3, /* [2:0] */
  8818. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8819. tx_mpdu_bytes:16, /* [19:4] */
  8820. /* Indicates retry count of offloaded/local generated Data tx frames */
  8821. tx_retry_cnt:6, /* [25:20] */
  8822. reserved_4:6; /* [31:26] */
  8823. } POSTPACK;
  8824. /* FW offload deliver ind message header fields */
  8825. /* DWORD one */
  8826. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8827. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8828. /* DWORD two */
  8829. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8830. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8831. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8832. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8833. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8834. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8835. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8836. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8837. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8838. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8839. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8840. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8841. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8842. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8843. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8844. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8845. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8846. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8847. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8848. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8849. /* DWORD three*/
  8850. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8851. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8852. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8853. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8854. /* DWORD four */
  8855. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8856. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8857. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8858. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8859. /* DWORD five */
  8860. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8861. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8862. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8863. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8864. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8865. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8866. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8867. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8868. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8869. do { \
  8870. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8871. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8872. } while (0)
  8873. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8874. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8875. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8876. do { \
  8877. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8878. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8879. } while (0)
  8880. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8881. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8882. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8883. do { \
  8884. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8885. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8886. } while (0)
  8887. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8888. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8889. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8890. do { \
  8891. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8892. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8893. } while (0)
  8894. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8895. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8896. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8897. do { \
  8898. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8899. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8900. } while (0)
  8901. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8902. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8903. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8904. do { \
  8905. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8906. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8907. } while (0)
  8908. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8909. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8910. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8911. do { \
  8912. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8913. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8914. } while (0)
  8915. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8916. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8917. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8918. do { \
  8919. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8920. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8921. } while (0)
  8922. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8923. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8924. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8925. do { \
  8926. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8927. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8928. } while (0)
  8929. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8930. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8931. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8932. do { \
  8933. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8934. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8935. } while (0)
  8936. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8937. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8938. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8941. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8942. } while (0)
  8943. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8944. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8945. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8946. do { \
  8947. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8948. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8949. } while (0)
  8950. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8951. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8952. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8953. do { \
  8954. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8955. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8956. } while (0)
  8957. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8958. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8959. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8960. do { \
  8961. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8962. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8963. } while (0)
  8964. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8965. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8966. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8967. do { \
  8968. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8969. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8970. } while (0)
  8971. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8972. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8973. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8974. do { \
  8975. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8976. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8977. } while (0)
  8978. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8979. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8980. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8981. do { \
  8982. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8983. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8984. } while (0)
  8985. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8986. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8987. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8988. do { \
  8989. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8990. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8991. } while (0)
  8992. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8993. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8994. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8997. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8998. } while (0)
  8999. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9000. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9001. /*
  9002. * @brief target -> host rx reorder flush message definition
  9003. *
  9004. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9005. *
  9006. * @details
  9007. * The following field definitions describe the format of the rx flush
  9008. * message sent from the target to the host.
  9009. * The message consists of a 4-octet header, followed by one or more
  9010. * 4-octet payload information elements.
  9011. *
  9012. * |31 24|23 8|7 0|
  9013. * |--------------------------------------------------------------|
  9014. * | TID | peer ID | msg type |
  9015. * |--------------------------------------------------------------|
  9016. * | seq num end | seq num start | MPDU status | reserved |
  9017. * |--------------------------------------------------------------|
  9018. * First DWORD:
  9019. * - MSG_TYPE
  9020. * Bits 7:0
  9021. * Purpose: identifies this as an rx flush message
  9022. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9023. * - PEER_ID
  9024. * Bits 23:8 (only bits 18:8 actually used)
  9025. * Purpose: identify which peer's rx data is being flushed
  9026. * Value: (rx) peer ID
  9027. * - TID
  9028. * Bits 31:24 (only bits 27:24 actually used)
  9029. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9030. * Value: traffic identifier
  9031. * Second DWORD:
  9032. * - MPDU_STATUS
  9033. * Bits 15:8
  9034. * Purpose:
  9035. * Indicate whether the flushed MPDUs should be discarded or processed.
  9036. * Value:
  9037. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9038. * stages of rx processing
  9039. * other: discard the MPDUs
  9040. * It is anticipated that flush messages will always have
  9041. * MPDU status == 1, but the status flag is included for
  9042. * flexibility.
  9043. * - SEQ_NUM_START
  9044. * Bits 23:16
  9045. * Purpose:
  9046. * Indicate the start of a series of consecutive MPDUs being flushed.
  9047. * Not all MPDUs within this range are necessarily valid - the host
  9048. * must check each sequence number within this range to see if the
  9049. * corresponding MPDU is actually present.
  9050. * Value:
  9051. * The sequence number for the first MPDU in the sequence.
  9052. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9053. * - SEQ_NUM_END
  9054. * Bits 30:24
  9055. * Purpose:
  9056. * Indicate the end of a series of consecutive MPDUs being flushed.
  9057. * Value:
  9058. * The sequence number one larger than the sequence number of the
  9059. * last MPDU being flushed.
  9060. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9061. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9062. * are to be released for further rx processing.
  9063. * Not all MPDUs within this range are necessarily valid - the host
  9064. * must check each sequence number within this range to see if the
  9065. * corresponding MPDU is actually present.
  9066. */
  9067. /* first DWORD */
  9068. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9069. #define HTT_RX_FLUSH_PEER_ID_S 8
  9070. #define HTT_RX_FLUSH_TID_M 0xff000000
  9071. #define HTT_RX_FLUSH_TID_S 24
  9072. /* second DWORD */
  9073. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9074. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9075. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9076. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9077. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9078. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9079. #define HTT_RX_FLUSH_BYTES 8
  9080. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9081. do { \
  9082. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9083. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9084. } while (0)
  9085. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9086. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9087. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9088. do { \
  9089. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9090. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9091. } while (0)
  9092. #define HTT_RX_FLUSH_TID_GET(word) \
  9093. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9094. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9095. do { \
  9096. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9097. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9098. } while (0)
  9099. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9100. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9101. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9102. do { \
  9103. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9104. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9105. } while (0)
  9106. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9107. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9108. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9109. do { \
  9110. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9111. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9112. } while (0)
  9113. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9114. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9115. /*
  9116. * @brief target -> host rx pn check indication message
  9117. *
  9118. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9119. *
  9120. * @details
  9121. * The following field definitions describe the format of the Rx PN check
  9122. * indication message sent from the target to the host.
  9123. * The message consists of a 4-octet header, followed by the start and
  9124. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9125. * IE is one octet containing the sequence number that failed the PN
  9126. * check.
  9127. *
  9128. * |31 24|23 8|7 0|
  9129. * |--------------------------------------------------------------|
  9130. * | TID | peer ID | msg type |
  9131. * |--------------------------------------------------------------|
  9132. * | Reserved | PN IE count | seq num end | seq num start|
  9133. * |--------------------------------------------------------------|
  9134. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9135. * |--------------------------------------------------------------|
  9136. * First DWORD:
  9137. * - MSG_TYPE
  9138. * Bits 7:0
  9139. * Purpose: Identifies this as an rx pn check indication message
  9140. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9141. * - PEER_ID
  9142. * Bits 23:8 (only bits 18:8 actually used)
  9143. * Purpose: identify which peer
  9144. * Value: (rx) peer ID
  9145. * - TID
  9146. * Bits 31:24 (only bits 27:24 actually used)
  9147. * Purpose: identify traffic identifier
  9148. * Value: traffic identifier
  9149. * Second DWORD:
  9150. * - SEQ_NUM_START
  9151. * Bits 7:0
  9152. * Purpose:
  9153. * Indicates the starting sequence number of the MPDU in this
  9154. * series of MPDUs that went though PN check.
  9155. * Value:
  9156. * The sequence number for the first MPDU in the sequence.
  9157. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9158. * - SEQ_NUM_END
  9159. * Bits 15:8
  9160. * Purpose:
  9161. * Indicates the ending sequence number of the MPDU in this
  9162. * series of MPDUs that went though PN check.
  9163. * Value:
  9164. * The sequence number one larger then the sequence number of the last
  9165. * MPDU being flushed.
  9166. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9167. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9168. * for invalid PN numbers and are ready to be released for further processing.
  9169. * Not all MPDUs within this range are necessarily valid - the host
  9170. * must check each sequence number within this range to see if the
  9171. * corresponding MPDU is actually present.
  9172. * - PN_IE_COUNT
  9173. * Bits 23:16
  9174. * Purpose:
  9175. * Used to determine the variable number of PN information elements in this
  9176. * message
  9177. *
  9178. * PN information elements:
  9179. * - PN_IE_x-
  9180. * Purpose:
  9181. * Each PN information element contains the sequence number of the MPDU that
  9182. * has failed the target PN check.
  9183. * Value:
  9184. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9185. * that failed the PN check.
  9186. */
  9187. /* first DWORD */
  9188. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9189. #define HTT_RX_PN_IND_PEER_ID_S 8
  9190. #define HTT_RX_PN_IND_TID_M 0xff000000
  9191. #define HTT_RX_PN_IND_TID_S 24
  9192. /* second DWORD */
  9193. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9194. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9195. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9196. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9197. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9198. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9199. #define HTT_RX_PN_IND_BYTES 8
  9200. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9201. do { \
  9202. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9203. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9204. } while (0)
  9205. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9206. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9207. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9208. do { \
  9209. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9210. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9211. } while (0)
  9212. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9213. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9214. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9217. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9218. } while (0)
  9219. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9220. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9221. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9222. do { \
  9223. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9224. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9225. } while (0)
  9226. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9227. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9228. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9231. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9232. } while (0)
  9233. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9234. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9235. /*
  9236. * @brief target -> host rx offload deliver message for LL system
  9237. *
  9238. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9239. *
  9240. * @details
  9241. * In a low latency system this message is sent whenever the offload
  9242. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9243. * The DMA of the actual packets into host memory is done before sending out
  9244. * this message. This message indicates only how many MSDUs to reap. The
  9245. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9246. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9247. * DMA'd by the MAC directly into host memory these packets do not contain
  9248. * the MAC descriptors in the header portion of the packet. Instead they contain
  9249. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9250. * message, the packets are delivered directly to the NW stack without going
  9251. * through the regular reorder buffering and PN checking path since it has
  9252. * already been done in target.
  9253. *
  9254. * |31 24|23 16|15 8|7 0|
  9255. * |-----------------------------------------------------------------------|
  9256. * | Total MSDU count | reserved | msg type |
  9257. * |-----------------------------------------------------------------------|
  9258. *
  9259. * @brief target -> host rx offload deliver message for HL system
  9260. *
  9261. * @details
  9262. * In a high latency system this message is sent whenever the offload manager
  9263. * flushes out the packets it has coalesced in its coalescing buffer. The
  9264. * actual packets are also carried along with this message. When the host
  9265. * receives this message, it is expected to deliver these packets to the NW
  9266. * stack directly instead of routing them through the reorder buffering and
  9267. * PN checking path since it has already been done in target.
  9268. *
  9269. * |31 24|23 16|15 8|7 0|
  9270. * |-----------------------------------------------------------------------|
  9271. * | Total MSDU count | reserved | msg type |
  9272. * |-----------------------------------------------------------------------|
  9273. * | peer ID | MSDU length |
  9274. * |-----------------------------------------------------------------------|
  9275. * | MSDU payload | FW Desc | tid | vdev ID |
  9276. * |-----------------------------------------------------------------------|
  9277. * | MSDU payload contd. |
  9278. * |-----------------------------------------------------------------------|
  9279. * | peer ID | MSDU length |
  9280. * |-----------------------------------------------------------------------|
  9281. * | MSDU payload | FW Desc | tid | vdev ID |
  9282. * |-----------------------------------------------------------------------|
  9283. * | MSDU payload contd. |
  9284. * |-----------------------------------------------------------------------|
  9285. *
  9286. */
  9287. /* first DWORD */
  9288. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9289. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9290. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9291. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9292. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9293. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9294. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9295. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9296. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9298. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9299. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9301. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9303. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9304. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9305. do { \
  9306. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9307. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9308. } while (0)
  9309. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9310. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9311. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9312. do { \
  9313. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9314. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9315. } while (0)
  9316. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9317. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9318. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9319. do { \
  9320. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9321. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9322. } while (0)
  9323. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9324. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9325. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9326. do { \
  9327. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9328. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9329. } while (0)
  9330. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9331. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9332. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9333. do { \
  9334. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9335. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9336. } while (0)
  9337. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9338. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9339. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9340. do { \
  9341. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9342. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9343. } while (0)
  9344. /**
  9345. * @brief target -> host rx peer map/unmap message definition
  9346. *
  9347. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9348. *
  9349. * @details
  9350. * The following diagram shows the format of the rx peer map message sent
  9351. * from the target to the host. This layout assumes the target operates
  9352. * as little-endian.
  9353. *
  9354. * This message always contains a SW peer ID. The main purpose of the
  9355. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9356. * with, so that the host can use that peer ID to determine which peer
  9357. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9358. * other purposes, such as identifying during tx completions which peer
  9359. * the tx frames in question were transmitted to.
  9360. *
  9361. * In certain generations of chips, the peer map message also contains
  9362. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9363. * to identify which peer the frame needs to be forwarded to (i.e. the
  9364. * peer assocated with the Destination MAC Address within the packet),
  9365. * and particularly which vdev needs to transmit the frame (for cases
  9366. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9367. * meaning as AST_INDEX_0.
  9368. * This DA-based peer ID that is provided for certain rx frames
  9369. * (the rx frames that need to be re-transmitted as tx frames)
  9370. * is the ID that the HW uses for referring to the peer in question,
  9371. * rather than the peer ID that the SW+FW use to refer to the peer.
  9372. *
  9373. *
  9374. * |31 24|23 16|15 8|7 0|
  9375. * |-----------------------------------------------------------------------|
  9376. * | SW peer ID | VDEV ID | msg type |
  9377. * |-----------------------------------------------------------------------|
  9378. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9379. * |-----------------------------------------------------------------------|
  9380. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9381. * |-----------------------------------------------------------------------|
  9382. *
  9383. *
  9384. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9385. *
  9386. * The following diagram shows the format of the rx peer unmap message sent
  9387. * from the target to the host.
  9388. *
  9389. * |31 24|23 16|15 8|7 0|
  9390. * |-----------------------------------------------------------------------|
  9391. * | SW peer ID | VDEV ID | msg type |
  9392. * |-----------------------------------------------------------------------|
  9393. *
  9394. * The following field definitions describe the format of the rx peer map
  9395. * and peer unmap messages sent from the target to the host.
  9396. * - MSG_TYPE
  9397. * Bits 7:0
  9398. * Purpose: identifies this as an rx peer map or peer unmap message
  9399. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9400. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9401. * - VDEV_ID
  9402. * Bits 15:8
  9403. * Purpose: Indicates which virtual device the peer is associated
  9404. * with.
  9405. * Value: vdev ID (used in the host to look up the vdev object)
  9406. * - PEER_ID (a.k.a. SW_PEER_ID)
  9407. * Bits 31:16
  9408. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9409. * freeing (unmap)
  9410. * Value: (rx) peer ID
  9411. * - MAC_ADDR_L32 (peer map only)
  9412. * Bits 31:0
  9413. * Purpose: Identifies which peer node the peer ID is for.
  9414. * Value: lower 4 bytes of peer node's MAC address
  9415. * - MAC_ADDR_U16 (peer map only)
  9416. * Bits 15:0
  9417. * Purpose: Identifies which peer node the peer ID is for.
  9418. * Value: upper 2 bytes of peer node's MAC address
  9419. * - HW_PEER_ID
  9420. * Bits 31:16
  9421. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9422. * address, so for rx frames marked for rx --> tx forwarding, the
  9423. * host can determine from the HW peer ID provided as meta-data with
  9424. * the rx frame which peer the frame is supposed to be forwarded to.
  9425. * Value: ID used by the MAC HW to identify the peer
  9426. */
  9427. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9428. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9429. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9430. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9431. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9432. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9433. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9434. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9435. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9436. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9437. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9438. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9439. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9440. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9441. do { \
  9442. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9443. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9444. } while (0)
  9445. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9446. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9447. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9448. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9449. do { \
  9450. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9451. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9452. } while (0)
  9453. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9454. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9455. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9456. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9457. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9458. do { \
  9459. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9460. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9461. } while (0)
  9462. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9463. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9464. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9465. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9466. #define HTT_RX_PEER_MAP_BYTES 12
  9467. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9468. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9469. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9470. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9471. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9472. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9473. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9474. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9475. #define HTT_RX_PEER_UNMAP_BYTES 4
  9476. /**
  9477. * @brief target -> host rx peer map V2 message definition
  9478. *
  9479. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9480. *
  9481. * @details
  9482. * The following diagram shows the format of the rx peer map v2 message sent
  9483. * from the target to the host. This layout assumes the target operates
  9484. * as little-endian.
  9485. *
  9486. * This message always contains a SW peer ID. The main purpose of the
  9487. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9488. * with, so that the host can use that peer ID to determine which peer
  9489. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9490. * other purposes, such as identifying during tx completions which peer
  9491. * the tx frames in question were transmitted to.
  9492. *
  9493. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9494. * is used during rx --> tx frame forwarding to identify which peer the
  9495. * frame needs to be forwarded to (i.e. the peer assocated with the
  9496. * Destination MAC Address within the packet), and particularly which vdev
  9497. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9498. * This DA-based peer ID that is provided for certain rx frames
  9499. * (the rx frames that need to be re-transmitted as tx frames)
  9500. * is the ID that the HW uses for referring to the peer in question,
  9501. * rather than the peer ID that the SW+FW use to refer to the peer.
  9502. *
  9503. * The HW peer id here is the same meaning as AST_INDEX_0.
  9504. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9505. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9506. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9507. * AST is valid.
  9508. *
  9509. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9510. * |-------------------------------------------------------------------------|
  9511. * | SW peer ID | VDEV ID | msg type |
  9512. * |-------------------------------------------------------------------------|
  9513. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9514. * |-------------------------------------------------------------------------|
  9515. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9516. * |-------------------------------------------------------------------------|
  9517. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9518. * |-------------------------------------------------------------------------|
  9519. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9520. * |-------------------------------------------------------------------------|
  9521. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9522. * |-------------------------------------------------------------------------|
  9523. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9524. * |-------------------------------------------------------------------------|
  9525. * | Reserved_2 |
  9526. * |-------------------------------------------------------------------------|
  9527. * Where:
  9528. * NH = Next Hop
  9529. * ASTVM = AST valid mask
  9530. * OA = on-chip AST valid bit
  9531. * ASTFM = AST flow mask
  9532. *
  9533. * The following field definitions describe the format of the rx peer map v2
  9534. * messages sent from the target to the host.
  9535. * - MSG_TYPE
  9536. * Bits 7:0
  9537. * Purpose: identifies this as an rx peer map v2 message
  9538. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9539. * - VDEV_ID
  9540. * Bits 15:8
  9541. * Purpose: Indicates which virtual device the peer is associated with.
  9542. * Value: vdev ID (used in the host to look up the vdev object)
  9543. * - SW_PEER_ID
  9544. * Bits 31:16
  9545. * Purpose: The peer ID (index) that WAL is allocating
  9546. * Value: (rx) peer ID
  9547. * - MAC_ADDR_L32
  9548. * Bits 31:0
  9549. * Purpose: Identifies which peer node the peer ID is for.
  9550. * Value: lower 4 bytes of peer node's MAC address
  9551. * - MAC_ADDR_U16
  9552. * Bits 15:0
  9553. * Purpose: Identifies which peer node the peer ID is for.
  9554. * Value: upper 2 bytes of peer node's MAC address
  9555. * - HW_PEER_ID / AST_INDEX_0
  9556. * Bits 31:16
  9557. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9558. * address, so for rx frames marked for rx --> tx forwarding, the
  9559. * host can determine from the HW peer ID provided as meta-data with
  9560. * the rx frame which peer the frame is supposed to be forwarded to.
  9561. * Value: ID used by the MAC HW to identify the peer
  9562. * - AST_HASH_VALUE
  9563. * Bits 15:0
  9564. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9565. * override feature.
  9566. * - NEXT_HOP
  9567. * Bit 16
  9568. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9569. * (Wireless Distribution System).
  9570. * - AST_VALID_MASK
  9571. * Bits 19:17
  9572. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9573. * - ONCHIP_AST_VALID_FLAG
  9574. * Bit 20
  9575. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9576. * is valid.
  9577. * - AST_INDEX_1
  9578. * Bits 15:0
  9579. * Purpose: indicate the second AST index for this peer
  9580. * - AST_0_FLOW_MASK
  9581. * Bits 19:16
  9582. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9583. * - AST_1_FLOW_MASK
  9584. * Bits 23:20
  9585. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9586. * - AST_2_FLOW_MASK
  9587. * Bits 27:24
  9588. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9589. * - AST_3_FLOW_MASK
  9590. * Bits 31:28
  9591. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9592. * - AST_INDEX_2
  9593. * Bits 15:0
  9594. * Purpose: indicate the third AST index for this peer
  9595. * - TID_VALID_HI_PRI
  9596. * Bits 23:16
  9597. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9598. * - TID_VALID_LOW_PRI
  9599. * Bits 31:24
  9600. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9601. * - AST_INDEX_3
  9602. * Bits 15:0
  9603. * Purpose: indicate the fourth AST index for this peer
  9604. * - ONCHIP_AST_IDX / RESERVED
  9605. * Bits 31:16
  9606. * Purpose: This field is valid only when split AST feature is enabled.
  9607. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9608. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9609. * address, this ast_idx is used for LMAC modules for RXPCU.
  9610. * Value: ID used by the LMAC HW to identify the peer
  9611. */
  9612. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9613. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9614. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9615. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9616. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9617. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9618. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9619. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9620. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9621. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9622. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9623. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9624. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9625. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9626. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9627. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9628. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9629. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9630. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9631. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9632. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9633. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9634. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9635. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9636. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9637. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9638. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9639. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9640. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9641. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9642. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9643. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9644. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9645. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9646. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9647. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9648. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9649. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9650. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9651. do { \
  9652. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9653. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9654. } while (0)
  9655. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9656. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9657. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9658. do { \
  9659. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9660. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9661. } while (0)
  9662. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9663. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9664. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9665. do { \
  9666. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9667. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9668. } while (0)
  9669. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9670. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9671. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9672. do { \
  9673. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9674. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9675. } while (0)
  9676. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9677. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9678. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9679. do { \
  9680. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9681. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9682. } while (0)
  9683. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9684. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9685. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9686. do { \
  9687. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9688. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9689. } while (0)
  9690. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9691. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9692. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9693. do { \
  9694. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9695. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9696. } while (0)
  9697. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9698. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9699. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9700. do { \
  9701. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9702. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9703. } while (0)
  9704. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9705. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9706. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9707. do { \
  9708. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9709. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9710. } while (0)
  9711. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9712. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9713. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9714. do { \
  9715. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9716. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9717. } while (0)
  9718. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9719. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9720. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9721. do { \
  9722. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9723. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9724. } while (0)
  9725. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9726. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9727. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9728. do { \
  9729. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9730. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9731. } while (0)
  9732. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9733. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9734. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9735. do { \
  9736. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9737. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9738. } while (0)
  9739. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9740. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9741. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9742. do { \
  9743. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9744. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9745. } while (0)
  9746. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9747. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9748. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9749. do { \
  9750. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9751. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9752. } while (0)
  9753. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9754. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9755. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9756. do { \
  9757. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9758. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9759. } while (0)
  9760. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9761. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9762. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9763. do { \
  9764. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9765. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9766. } while (0)
  9767. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9768. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9769. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9770. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9771. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9772. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9773. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9774. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9775. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9776. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9777. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9778. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9779. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9780. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9781. /**
  9782. * @brief target -> host rx peer map V3 message definition
  9783. *
  9784. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9785. *
  9786. * @details
  9787. * The following diagram shows the format of the rx peer map v3 message sent
  9788. * from the target to the host.
  9789. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9790. * This layout assumes the target operates as little-endian.
  9791. *
  9792. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9793. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9794. * | SW peer ID | VDEV ID | msg type |
  9795. * |-----------------+--------------------+-----------------+-----------------|
  9796. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9797. * |-----------------+--------------------+-----------------+-----------------|
  9798. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9799. * |-----------------+--------+-----------+-----------------+-----------------|
  9800. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9801. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9802. * | (8bits) | | (4bits) | |
  9803. * |-----------------+--------+--+--+--+--------------------------------------|
  9804. * | RESERVED |E |O | | |
  9805. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9806. * | |V |V | | |
  9807. * |-----------------+--------------------+-----------------------------------|
  9808. * | HTT_MSDU_IDX_ | RESERVED | |
  9809. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9810. * | (8bits) | | |
  9811. * |-----------------+--------------------+-----------------------------------|
  9812. * | Reserved_2 |
  9813. * |--------------------------------------------------------------------------|
  9814. * | Reserved_3 |
  9815. * |--------------------------------------------------------------------------|
  9816. *
  9817. * Where:
  9818. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9819. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9820. * NH = Next Hop
  9821. * The following field definitions describe the format of the rx peer map v3
  9822. * messages sent from the target to the host.
  9823. * - MSG_TYPE
  9824. * Bits 7:0
  9825. * Purpose: identifies this as a peer map v3 message
  9826. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9827. * - VDEV_ID
  9828. * Bits 15:8
  9829. * Purpose: Indicates which virtual device the peer is associated with.
  9830. * - SW_PEER_ID
  9831. * Bits 31:16
  9832. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9833. * - MAC_ADDR_L32
  9834. * Bits 31:0
  9835. * Purpose: Identifies which peer node the peer ID is for.
  9836. * Value: lower 4 bytes of peer node's MAC address
  9837. * - MAC_ADDR_U16
  9838. * Bits 15:0
  9839. * Purpose: Identifies which peer node the peer ID is for.
  9840. * Value: upper 2 bytes of peer node's MAC address
  9841. * - MULTICAST_SW_PEER_ID
  9842. * Bits 31:16
  9843. * Purpose: The multicast peer ID (index)
  9844. * Value: set to HTT_INVALID_PEER if not valid
  9845. * - HW_PEER_ID / AST_INDEX
  9846. * Bits 15:0
  9847. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9848. * address, so for rx frames marked for rx --> tx forwarding, the
  9849. * host can determine from the HW peer ID provided as meta-data with
  9850. * the rx frame which peer the frame is supposed to be forwarded to.
  9851. * - CACHE_SET_NUM
  9852. * Bits 19:16
  9853. * Purpose: Cache Set Number for AST_INDEX
  9854. * Cache set number that should be used to cache the index based
  9855. * search results, for address and flow search.
  9856. * This value should be equal to LSB 4 bits of the hash value
  9857. * of match data, in case of search index points to an entry which
  9858. * may be used in content based search also. The value can be
  9859. * anything when the entry pointed by search index will not be
  9860. * used for content based search.
  9861. * - HTT_MSDU_IDX_VALID_MASK
  9862. * Bits 31:24
  9863. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9864. * - ONCHIP_AST_IDX / RESERVED
  9865. * Bits 15:0
  9866. * Purpose: This field is valid only when split AST feature is enabled.
  9867. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9868. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9869. * address, this ast_idx is used for LMAC modules for RXPCU.
  9870. * - NEXT_HOP
  9871. * Bits 16
  9872. * Purpose: Flag indicates next_hop AST entry used for WDS
  9873. * (Wireless Distribution System).
  9874. * - ONCHIP_AST_VALID
  9875. * Bits 17
  9876. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9877. * - EXT_AST_VALID
  9878. * Bits 18
  9879. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9880. * - EXT_AST_INDEX
  9881. * Bits 15:0
  9882. * Purpose: This field describes Extended AST index
  9883. * Valid if EXT_AST_VALID flag set
  9884. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9885. * Bits 31:24
  9886. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9887. */
  9888. /* dword 0 */
  9889. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9890. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9891. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9892. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9893. /* dword 1 */
  9894. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9895. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9896. /* dword 2 */
  9897. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9898. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9899. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9900. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9901. /* dword 3 */
  9902. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9903. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9904. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9905. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9906. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9907. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9908. /* dword 4 */
  9909. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9910. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9911. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9912. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9913. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9914. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9915. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9916. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9917. /* dword 5 */
  9918. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9919. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9920. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9921. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9922. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9925. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9926. } while (0)
  9927. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9928. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9929. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9930. do { \
  9931. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9932. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9933. } while (0)
  9934. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9935. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9936. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9937. do { \
  9938. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9939. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9940. } while (0)
  9941. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9942. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9943. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9946. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9947. } while (0)
  9948. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9949. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9950. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9953. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9954. } while (0)
  9955. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9956. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9957. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9958. do { \
  9959. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9960. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9961. } while (0)
  9962. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9963. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9964. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9965. do { \
  9966. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9967. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9968. } while (0)
  9969. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9970. (((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)
  9971. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9972. do { \
  9973. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9974. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9975. } while (0)
  9976. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9977. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9978. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9981. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9982. } while (0)
  9983. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9984. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9985. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9986. do { \
  9987. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9988. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9989. } while (0)
  9990. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9991. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9992. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9993. do { \
  9994. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  9995. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  9996. } while (0)
  9997. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  9998. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  9999. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10000. do { \
  10001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10002. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10003. } while (0)
  10004. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10005. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10006. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10007. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10008. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10009. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10010. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10011. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10012. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10013. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10014. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10015. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10016. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10018. /**
  10019. * @brief target -> host rx peer unmap V2 message definition
  10020. *
  10021. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10022. *
  10023. * The following diagram shows the format of the rx peer unmap message sent
  10024. * from the target to the host.
  10025. *
  10026. * |31 24|23 16|15 8|7 0|
  10027. * |-----------------------------------------------------------------------|
  10028. * | SW peer ID | VDEV ID | msg type |
  10029. * |-----------------------------------------------------------------------|
  10030. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10031. * |-----------------------------------------------------------------------|
  10032. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10033. * |-----------------------------------------------------------------------|
  10034. * | Peer Delete Duration |
  10035. * |-----------------------------------------------------------------------|
  10036. * | Reserved_0 | WDS Free Count |
  10037. * |-----------------------------------------------------------------------|
  10038. * | Reserved_1 |
  10039. * |-----------------------------------------------------------------------|
  10040. * | Reserved_2 |
  10041. * |-----------------------------------------------------------------------|
  10042. *
  10043. *
  10044. * The following field definitions describe the format of the rx peer unmap
  10045. * messages sent from the target to the host.
  10046. * - MSG_TYPE
  10047. * Bits 7:0
  10048. * Purpose: identifies this as an rx peer unmap v2 message
  10049. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10050. * - VDEV_ID
  10051. * Bits 15:8
  10052. * Purpose: Indicates which virtual device the peer is associated
  10053. * with.
  10054. * Value: vdev ID (used in the host to look up the vdev object)
  10055. * - SW_PEER_ID
  10056. * Bits 31:16
  10057. * Purpose: The peer ID (index) that WAL is freeing
  10058. * Value: (rx) peer ID
  10059. * - MAC_ADDR_L32
  10060. * Bits 31:0
  10061. * Purpose: Identifies which peer node the peer ID is for.
  10062. * Value: lower 4 bytes of peer node's MAC address
  10063. * - MAC_ADDR_U16
  10064. * Bits 15:0
  10065. * Purpose: Identifies which peer node the peer ID is for.
  10066. * Value: upper 2 bytes of peer node's MAC address
  10067. * - NEXT_HOP
  10068. * Bits 16
  10069. * Purpose: Bit indicates next_hop AST entry used for WDS
  10070. * (Wireless Distribution System).
  10071. * - PEER_DELETE_DURATION
  10072. * Bits 31:0
  10073. * Purpose: Time taken to delete peer, in msec,
  10074. * Used for monitoring / debugging PEER delete response delay
  10075. * - PEER_WDS_FREE_COUNT
  10076. * Bits 15:0
  10077. * Purpose: Count of WDS entries deleted associated to peer deleted
  10078. */
  10079. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10080. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10081. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10082. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10083. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10084. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10085. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10086. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10087. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10088. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10089. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10090. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10091. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10092. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10093. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10094. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10095. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10096. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10097. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10098. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10099. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10100. do { \
  10101. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10102. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10103. } while (0)
  10104. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10105. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10106. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10107. do { \
  10108. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10109. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10110. } while (0)
  10111. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10112. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10113. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10114. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10115. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10116. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10117. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10118. /**
  10119. * @brief target -> host rx peer mlo map message definition
  10120. *
  10121. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10122. *
  10123. * @details
  10124. * The following diagram shows the format of the rx mlo peer map message sent
  10125. * from the target to the host. This layout assumes the target operates
  10126. * as little-endian.
  10127. *
  10128. * MCC:
  10129. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10130. *
  10131. * WIN:
  10132. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10133. * It will be sent on the Assoc Link.
  10134. *
  10135. * This message always contains a MLO peer ID. The main purpose of the
  10136. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10137. * with, so that the host can use that MLO peer ID to determine which peer
  10138. * transmitted the rx frame.
  10139. *
  10140. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10141. * |-------------------------------------------------------------------------|
  10142. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10143. * |-------------------------------------------------------------------------|
  10144. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10145. * |-------------------------------------------------------------------------|
  10146. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10147. * |-------------------------------------------------------------------------|
  10148. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10149. * |-------------------------------------------------------------------------|
  10150. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10151. * |-------------------------------------------------------------------------|
  10152. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10153. * |-------------------------------------------------------------------------|
  10154. * |RSVD |
  10155. * |-------------------------------------------------------------------------|
  10156. * |RSVD |
  10157. * |-------------------------------------------------------------------------|
  10158. * | htt_tlv_hdr_t |
  10159. * |-------------------------------------------------------------------------|
  10160. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10161. * |-------------------------------------------------------------------------|
  10162. * | htt_tlv_hdr_t |
  10163. * |-------------------------------------------------------------------------|
  10164. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10165. * |-------------------------------------------------------------------------|
  10166. * | htt_tlv_hdr_t |
  10167. * |-------------------------------------------------------------------------|
  10168. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10169. * |-------------------------------------------------------------------------|
  10170. *
  10171. * Where:
  10172. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10173. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10174. * V (valid) - 1 Bit Bit17
  10175. * CHIPID - 3 Bits
  10176. * TIDMASK - 8 Bits
  10177. * CACHE_SET_NUM - 8 Bits
  10178. *
  10179. * The following field definitions describe the format of the rx MLO peer map
  10180. * messages sent from the target to the host.
  10181. * - MSG_TYPE
  10182. * Bits 7:0
  10183. * Purpose: identifies this as an rx mlo peer map message
  10184. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10185. *
  10186. * - MLO_PEER_ID
  10187. * Bits 23:8
  10188. * Purpose: The MLO peer ID (index).
  10189. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10190. * Value: MLO peer ID
  10191. *
  10192. * - NUMLINK
  10193. * Bits: 26:24 (3Bits)
  10194. * Purpose: Indicate the max number of logical links supported per client.
  10195. * Value: number of logical links
  10196. *
  10197. * - PRC
  10198. * Bits: 29:27 (3Bits)
  10199. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10200. * if there is migration of the primary chip.
  10201. * Value: Primary REO CHIPID
  10202. *
  10203. * - MAC_ADDR_L32
  10204. * Bits 31:0
  10205. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10206. * Value: lower 4 bytes of peer node's MAC address
  10207. *
  10208. * - MAC_ADDR_U16
  10209. * Bits 15:0
  10210. * Purpose: Identifies which peer node the peer ID is for.
  10211. * Value: upper 2 bytes of peer node's MAC address
  10212. *
  10213. * - PRIMARY_TCL_AST_IDX
  10214. * Bits 15:0
  10215. * Purpose: Primary TCL AST index for this peer.
  10216. *
  10217. * - V
  10218. * 1 Bit Position 16
  10219. * Purpose: If the ast idx is valid.
  10220. *
  10221. * - CHIPID
  10222. * Bits 19:17
  10223. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10224. *
  10225. * - TIDMASK
  10226. * Bits 27:20
  10227. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10228. *
  10229. * - CACHE_SET_NUM
  10230. * Bits 31:28
  10231. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10232. * Cache set number that should be used to cache the index based
  10233. * search results, for address and flow search.
  10234. * This value should be equal to LSB four bits of the hash value
  10235. * of match data, in case of search index points to an entry which
  10236. * may be used in content based search also. The value can be
  10237. * anything when the entry pointed by search index will not be
  10238. * used for content based search.
  10239. *
  10240. * - htt_tlv_hdr_t
  10241. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10242. *
  10243. * Bits 11:0
  10244. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10245. *
  10246. * Bits 23:12
  10247. * Purpose: Length, Length of the value that follows the header
  10248. *
  10249. * Bits 31:28
  10250. * Purpose: Reserved.
  10251. *
  10252. *
  10253. * - SW_PEER_ID
  10254. * Bits 15:0
  10255. * Purpose: The peer ID (index) that WAL is allocating
  10256. * Value: (rx) peer ID
  10257. *
  10258. * - VDEV_ID
  10259. * Bits 23:16
  10260. * Purpose: Indicates which virtual device the peer is associated with.
  10261. * Value: vdev ID (used in the host to look up the vdev object)
  10262. *
  10263. * - CHIPID
  10264. * Bits 26:24
  10265. * Purpose: Indicates which Chip id the peer is associated with.
  10266. * Value: chip ID (Provided by Host as part of QMI exchange)
  10267. */
  10268. typedef enum {
  10269. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10270. } MLO_PEER_MAP_TLV_TAG_ID;
  10271. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10272. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10273. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10274. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10275. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10276. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10277. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10278. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10279. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10280. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10281. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10282. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10283. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10284. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10285. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10286. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10287. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10288. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10289. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10290. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10291. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10292. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10293. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10294. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10295. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10296. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10297. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10298. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10299. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10300. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10301. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10302. do { \
  10303. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10304. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10305. } while (0)
  10306. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10307. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10308. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10309. do { \
  10310. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10311. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10312. } while (0)
  10313. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10314. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10315. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10316. do { \
  10317. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10318. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10319. } while (0)
  10320. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10321. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10322. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10323. do { \
  10324. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10325. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10326. } while (0)
  10327. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10328. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10329. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10330. do { \
  10331. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10332. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10333. } while (0)
  10334. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10335. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10336. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10337. do { \
  10338. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10339. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10340. } while (0)
  10341. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10342. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10343. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10344. do { \
  10345. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10346. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10347. } while (0)
  10348. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10349. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10350. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10351. do { \
  10352. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10353. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10354. } while (0)
  10355. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10356. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10357. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10358. do { \
  10359. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10360. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10361. } while (0)
  10362. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10363. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10364. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10365. do { \
  10366. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10367. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10368. } while (0)
  10369. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10370. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10371. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10372. do { \
  10373. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10374. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10375. } while (0)
  10376. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10377. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10378. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10379. do { \
  10380. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10381. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10382. } while (0)
  10383. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10384. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10385. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10386. do { \
  10387. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10388. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10389. } while (0)
  10390. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10391. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10392. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10393. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10394. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10395. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10396. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10397. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10398. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10399. *
  10400. * The following diagram shows the format of the rx mlo peer unmap message sent
  10401. * from the target to the host.
  10402. *
  10403. * |31 24|23 16|15 8|7 0|
  10404. * |-----------------------------------------------------------------------|
  10405. * | RSVD_24_31 | MLO peer ID | msg type |
  10406. * |-----------------------------------------------------------------------|
  10407. */
  10408. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10409. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10410. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10411. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10412. /**
  10413. * @brief target -> host message specifying security parameters
  10414. *
  10415. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10416. *
  10417. * @details
  10418. * The following diagram shows the format of the security specification
  10419. * message sent from the target to the host.
  10420. * This security specification message tells the host whether a PN check is
  10421. * necessary on rx data frames, and if so, how large the PN counter is.
  10422. * This message also tells the host about the security processing to apply
  10423. * to defragmented rx frames - specifically, whether a Message Integrity
  10424. * Check is required, and the Michael key to use.
  10425. *
  10426. * |31 24|23 16|15|14 8|7 0|
  10427. * |-----------------------------------------------------------------------|
  10428. * | peer ID | U| security type | msg type |
  10429. * |-----------------------------------------------------------------------|
  10430. * | Michael Key K0 |
  10431. * |-----------------------------------------------------------------------|
  10432. * | Michael Key K1 |
  10433. * |-----------------------------------------------------------------------|
  10434. * | WAPI RSC Low0 |
  10435. * |-----------------------------------------------------------------------|
  10436. * | WAPI RSC Low1 |
  10437. * |-----------------------------------------------------------------------|
  10438. * | WAPI RSC Hi0 |
  10439. * |-----------------------------------------------------------------------|
  10440. * | WAPI RSC Hi1 |
  10441. * |-----------------------------------------------------------------------|
  10442. *
  10443. * The following field definitions describe the format of the security
  10444. * indication message sent from the target to the host.
  10445. * - MSG_TYPE
  10446. * Bits 7:0
  10447. * Purpose: identifies this as a security specification message
  10448. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10449. * - SEC_TYPE
  10450. * Bits 14:8
  10451. * Purpose: specifies which type of security applies to the peer
  10452. * Value: htt_sec_type enum value
  10453. * - UNICAST
  10454. * Bit 15
  10455. * Purpose: whether this security is applied to unicast or multicast data
  10456. * Value: 1 -> unicast, 0 -> multicast
  10457. * - PEER_ID
  10458. * Bits 31:16
  10459. * Purpose: The ID number for the peer the security specification is for
  10460. * Value: peer ID
  10461. * - MICHAEL_KEY_K0
  10462. * Bits 31:0
  10463. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10464. * Value: Michael Key K0 (if security type is TKIP)
  10465. * - MICHAEL_KEY_K1
  10466. * Bits 31:0
  10467. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10468. * Value: Michael Key K1 (if security type is TKIP)
  10469. * - WAPI_RSC_LOW0
  10470. * Bits 31:0
  10471. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10472. * Value: WAPI RSC Low0 (if security type is WAPI)
  10473. * - WAPI_RSC_LOW1
  10474. * Bits 31:0
  10475. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10476. * Value: WAPI RSC Low1 (if security type is WAPI)
  10477. * - WAPI_RSC_HI0
  10478. * Bits 31:0
  10479. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10480. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10481. * - WAPI_RSC_HI1
  10482. * Bits 31:0
  10483. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10484. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10485. */
  10486. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10487. #define HTT_SEC_IND_SEC_TYPE_S 8
  10488. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10489. #define HTT_SEC_IND_UNICAST_S 15
  10490. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10491. #define HTT_SEC_IND_PEER_ID_S 16
  10492. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10493. do { \
  10494. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10495. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10496. } while (0)
  10497. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10498. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10499. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10500. do { \
  10501. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10502. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10503. } while (0)
  10504. #define HTT_SEC_IND_UNICAST_GET(word) \
  10505. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10506. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10507. do { \
  10508. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10509. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10510. } while (0)
  10511. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10512. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10513. #define HTT_SEC_IND_BYTES 28
  10514. /**
  10515. * @brief target -> host rx ADDBA / DELBA message definitions
  10516. *
  10517. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10518. *
  10519. * @details
  10520. * The following diagram shows the format of the rx ADDBA message sent
  10521. * from the target to the host:
  10522. *
  10523. * |31 20|19 16|15 8|7 0|
  10524. * |---------------------------------------------------------------------|
  10525. * | peer ID | TID | window size | msg type |
  10526. * |---------------------------------------------------------------------|
  10527. *
  10528. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10529. *
  10530. * The following diagram shows the format of the rx DELBA message sent
  10531. * from the target to the host:
  10532. *
  10533. * |31 20|19 16|15 10|9 8|7 0|
  10534. * |---------------------------------------------------------------------|
  10535. * | peer ID | TID | window size | IR| msg type |
  10536. * |---------------------------------------------------------------------|
  10537. *
  10538. * The following field definitions describe the format of the rx ADDBA
  10539. * and DELBA messages sent from the target to the host.
  10540. * - MSG_TYPE
  10541. * Bits 7:0
  10542. * Purpose: identifies this as an rx ADDBA or DELBA message
  10543. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10544. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10545. * - IR (initiator / recipient)
  10546. * Bits 9:8 (DELBA only)
  10547. * Purpose: specify whether the DELBA handshake was initiated by the
  10548. * local STA/AP, or by the peer STA/AP
  10549. * Value:
  10550. * 0 - unspecified
  10551. * 1 - initiator (a.k.a. originator)
  10552. * 2 - recipient (a.k.a. responder)
  10553. * 3 - unused / reserved
  10554. * - WIN_SIZE
  10555. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10556. * Purpose: Specifies the length of the block ack window (max = 64).
  10557. * Value:
  10558. * block ack window length specified by the received ADDBA/DELBA
  10559. * management message.
  10560. * - TID
  10561. * Bits 19:16
  10562. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10563. * Value:
  10564. * TID specified by the received ADDBA or DELBA management message.
  10565. * - PEER_ID
  10566. * Bits 31:20
  10567. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10568. * Value:
  10569. * ID (hash value) used by the host for fast, direct lookup of
  10570. * host SW peer info, including rx reorder states.
  10571. */
  10572. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10573. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10574. #define HTT_RX_ADDBA_TID_M 0xf0000
  10575. #define HTT_RX_ADDBA_TID_S 16
  10576. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10577. #define HTT_RX_ADDBA_PEER_ID_S 20
  10578. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10579. do { \
  10580. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10581. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10582. } while (0)
  10583. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10584. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10585. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10588. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10589. } while (0)
  10590. #define HTT_RX_ADDBA_TID_GET(word) \
  10591. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10592. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10595. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10596. } while (0)
  10597. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10598. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10599. #define HTT_RX_ADDBA_BYTES 4
  10600. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10601. #define HTT_RX_DELBA_INITIATOR_S 8
  10602. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10603. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10604. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10605. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10606. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10607. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10608. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10609. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10610. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10611. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10612. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10613. do { \
  10614. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10615. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10616. } while (0)
  10617. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10618. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10619. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10620. do { \
  10621. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10622. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10623. } while (0)
  10624. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10625. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10626. #define HTT_RX_DELBA_BYTES 4
  10627. /**
  10628. * @brief tx queue group information element definition
  10629. *
  10630. * @details
  10631. * The following diagram shows the format of the tx queue group
  10632. * information element, which can be included in target --> host
  10633. * messages to specify the number of tx "credits" (tx descriptors
  10634. * for LL, or tx buffers for HL) available to a particular group
  10635. * of host-side tx queues, and which host-side tx queues belong to
  10636. * the group.
  10637. *
  10638. * |31|30 24|23 16|15|14|13 0|
  10639. * |------------------------------------------------------------------------|
  10640. * | X| reserved | tx queue grp ID | A| S| credit count |
  10641. * |------------------------------------------------------------------------|
  10642. * | vdev ID mask | AC mask |
  10643. * |------------------------------------------------------------------------|
  10644. *
  10645. * The following definitions describe the fields within the tx queue group
  10646. * information element:
  10647. * - credit_count
  10648. * Bits 13:1
  10649. * Purpose: specify how many tx credits are available to the tx queue group
  10650. * Value: An absolute or relative, positive or negative credit value
  10651. * The 'A' bit specifies whether the value is absolute or relative.
  10652. * The 'S' bit specifies whether the value is positive or negative.
  10653. * A negative value can only be relative, not absolute.
  10654. * An absolute value replaces any prior credit value the host has for
  10655. * the tx queue group in question.
  10656. * A relative value is added to the prior credit value the host has for
  10657. * the tx queue group in question.
  10658. * - sign
  10659. * Bit 14
  10660. * Purpose: specify whether the credit count is positive or negative
  10661. * Value: 0 -> positive, 1 -> negative
  10662. * - absolute
  10663. * Bit 15
  10664. * Purpose: specify whether the credit count is absolute or relative
  10665. * Value: 0 -> relative, 1 -> absolute
  10666. * - txq_group_id
  10667. * Bits 23:16
  10668. * Purpose: indicate which tx queue group's credit and/or membership are
  10669. * being specified
  10670. * Value: 0 to max_tx_queue_groups-1
  10671. * - reserved
  10672. * Bits 30:16
  10673. * Value: 0x0
  10674. * - eXtension
  10675. * Bit 31
  10676. * Purpose: specify whether another tx queue group info element follows
  10677. * Value: 0 -> no more tx queue group information elements
  10678. * 1 -> another tx queue group information element immediately follows
  10679. * - ac_mask
  10680. * Bits 15:0
  10681. * Purpose: specify which Access Categories belong to the tx queue group
  10682. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10683. * the tx queue group.
  10684. * The AC bit-mask values are obtained by left-shifting by the
  10685. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10686. * - vdev_id_mask
  10687. * Bits 31:16
  10688. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10689. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10690. * belong to the tx queue group.
  10691. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10692. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10693. */
  10694. PREPACK struct htt_txq_group {
  10695. A_UINT32
  10696. credit_count: 14,
  10697. sign: 1,
  10698. absolute: 1,
  10699. tx_queue_group_id: 8,
  10700. reserved0: 7,
  10701. extension: 1;
  10702. A_UINT32
  10703. ac_mask: 16,
  10704. vdev_id_mask: 16;
  10705. } POSTPACK;
  10706. /* first word */
  10707. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10708. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10709. #define HTT_TXQ_GROUP_SIGN_S 14
  10710. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10711. #define HTT_TXQ_GROUP_ABS_S 15
  10712. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10713. #define HTT_TXQ_GROUP_ID_S 16
  10714. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10715. #define HTT_TXQ_GROUP_EXT_S 31
  10716. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10717. /* second word */
  10718. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10719. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10720. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10721. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10722. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10723. do { \
  10724. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10725. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10726. } while (0)
  10727. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10728. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10729. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10730. do { \
  10731. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10732. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10733. } while (0)
  10734. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10735. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10736. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10737. do { \
  10738. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10739. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10740. } while (0)
  10741. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10742. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10743. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10744. do { \
  10745. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10746. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10747. } while (0)
  10748. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10749. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10750. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10751. do { \
  10752. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10753. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10754. } while (0)
  10755. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10756. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10757. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10758. do { \
  10759. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10760. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10761. } while (0)
  10762. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10763. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10764. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10765. do { \
  10766. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10767. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10768. } while (0)
  10769. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10770. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10771. /**
  10772. * @brief target -> host TX completion indication message definition
  10773. *
  10774. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10775. *
  10776. * @details
  10777. * The following diagram shows the format of the TX completion indication sent
  10778. * from the target to the host
  10779. *
  10780. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10781. * |-------------------------------------------------------------------|
  10782. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10783. * |-------------------------------------------------------------------|
  10784. * payload:| MSDU1 ID | MSDU0 ID |
  10785. * |-------------------------------------------------------------------|
  10786. * : MSDU3 ID | MSDU2 ID :
  10787. * |-------------------------------------------------------------------|
  10788. * | struct htt_tx_compl_ind_append_retries |
  10789. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10790. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10791. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10792. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10793. * |-------------------------------------------------------------------|
  10794. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10795. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10796. * | MSDU0 tx_tsf64_low |
  10797. * |-------------------------------------------------------------------|
  10798. * | MSDU0 tx_tsf64_high |
  10799. * |-------------------------------------------------------------------|
  10800. * | MSDU1 tx_tsf64_low |
  10801. * |-------------------------------------------------------------------|
  10802. * | MSDU1 tx_tsf64_high |
  10803. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10804. * | phy_timestamp |
  10805. * |-------------------------------------------------------------------|
  10806. * | rate specs (see below) |
  10807. * |-------------------------------------------------------------------|
  10808. * | seqctrl | framectrl |
  10809. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10810. * Where:
  10811. * A0 = append (a.k.a. append0)
  10812. * A1 = append1
  10813. * TP = MSDU tx power presence
  10814. * A2 = append2
  10815. * A3 = append3
  10816. * A4 = append4
  10817. *
  10818. * The following field definitions describe the format of the TX completion
  10819. * indication sent from the target to the host
  10820. * Header fields:
  10821. * - msg_type
  10822. * Bits 7:0
  10823. * Purpose: identifies this as HTT TX completion indication
  10824. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10825. * - status
  10826. * Bits 10:8
  10827. * Purpose: the TX completion status of payload fragmentations descriptors
  10828. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10829. * - tid
  10830. * Bits 14:11
  10831. * Purpose: the tid associated with those fragmentation descriptors. It is
  10832. * valid or not, depending on the tid_invalid bit.
  10833. * Value: 0 to 15
  10834. * - tid_invalid
  10835. * Bits 15:15
  10836. * Purpose: this bit indicates whether the tid field is valid or not
  10837. * Value: 0 indicates valid; 1 indicates invalid
  10838. * - num
  10839. * Bits 23:16
  10840. * Purpose: the number of payload in this indication
  10841. * Value: 1 to 255
  10842. * - append (a.k.a. append0)
  10843. * Bits 24:24
  10844. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10845. * the number of tx retries for one MSDU at the end of this message
  10846. * Value: 0 indicates no appending; 1 indicates appending
  10847. * - append1
  10848. * Bits 25:25
  10849. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10850. * contains the timestamp info for each TX msdu id in payload.
  10851. * The order of the timestamps matches the order of the MSDU IDs.
  10852. * Note that a big-endian host needs to account for the reordering
  10853. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10854. * conversion) when determining which tx timestamp corresponds to
  10855. * which MSDU ID.
  10856. * Value: 0 indicates no appending; 1 indicates appending
  10857. * - msdu_tx_power_presence
  10858. * Bits 26:26
  10859. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10860. * for each MSDU referenced by the TX_COMPL_IND message.
  10861. * The tx power is reported in 0.5 dBm units.
  10862. * The order of the per-MSDU tx power reports matches the order
  10863. * of the MSDU IDs.
  10864. * Note that a big-endian host needs to account for the reordering
  10865. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10866. * conversion) when determining which Tx Power corresponds to
  10867. * which MSDU ID.
  10868. * Value: 0 indicates MSDU tx power reports are not appended,
  10869. * 1 indicates MSDU tx power reports are appended
  10870. * - append2
  10871. * Bits 27:27
  10872. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10873. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10874. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10875. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10876. * for each MSDU, for convenience.
  10877. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10878. * this append2 bit is set).
  10879. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10880. * dB above the noise floor.
  10881. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10882. * 1 indicates MSDU ACK RSSI values are appended.
  10883. * - append3
  10884. * Bits 28:28
  10885. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10886. * contains the tx tsf info based on wlan global TSF for
  10887. * each TX msdu id in payload.
  10888. * The order of the tx tsf matches the order of the MSDU IDs.
  10889. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10890. * values to indicate the the lower 32 bits and higher 32 bits of
  10891. * the tx tsf.
  10892. * The tx_tsf64 here represents the time MSDU was acked and the
  10893. * tx_tsf64 has microseconds units.
  10894. * Value: 0 indicates no appending; 1 indicates appending
  10895. * - append4
  10896. * Bits 29:29
  10897. * Purpose: Indicate whether data frame control fields and fields required
  10898. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10899. * message. The order of the this message matches the order of
  10900. * the MSDU IDs.
  10901. * Value: 0 indicates frame control fields and fields required for
  10902. * radio tap header values are not appended,
  10903. * 1 indicates frame control fields and fields required for
  10904. * radio tap header values are appended.
  10905. * Payload fields:
  10906. * - hmsdu_id
  10907. * Bits 15:0
  10908. * Purpose: this ID is used to track the Tx buffer in host
  10909. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10910. */
  10911. PREPACK struct htt_tx_data_hdr_information {
  10912. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10913. A_UINT32 /* word 1 */
  10914. /* preamble:
  10915. * 0-OFDM,
  10916. * 1-CCk,
  10917. * 2-HT,
  10918. * 3-VHT
  10919. */
  10920. preamble: 2, /* [1:0] */
  10921. /* mcs:
  10922. * In case of HT preamble interpret
  10923. * MCS along with NSS.
  10924. * Valid values for HT are 0 to 7.
  10925. * HT mcs 0 with NSS 2 is mcs 8.
  10926. * Valid values for VHT are 0 to 9.
  10927. */
  10928. mcs: 4, /* [5:2] */
  10929. /* rate:
  10930. * This is applicable only for
  10931. * CCK and OFDM preamble type
  10932. * rate 0: OFDM 48 Mbps,
  10933. * 1: OFDM 24 Mbps,
  10934. * 2: OFDM 12 Mbps
  10935. * 3: OFDM 6 Mbps
  10936. * 4: OFDM 54 Mbps
  10937. * 5: OFDM 36 Mbps
  10938. * 6: OFDM 18 Mbps
  10939. * 7: OFDM 9 Mbps
  10940. * rate 0: CCK 11 Mbps Long
  10941. * 1: CCK 5.5 Mbps Long
  10942. * 2: CCK 2 Mbps Long
  10943. * 3: CCK 1 Mbps Long
  10944. * 4: CCK 11 Mbps Short
  10945. * 5: CCK 5.5 Mbps Short
  10946. * 6: CCK 2 Mbps Short
  10947. */
  10948. rate : 3, /* [ 8: 6] */
  10949. rssi : 8, /* [16: 9] units=dBm */
  10950. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10951. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10952. stbc : 1, /* [22] */
  10953. sgi : 1, /* [23] */
  10954. ldpc : 1, /* [24] */
  10955. beamformed: 1, /* [25] */
  10956. /* tx_retry_cnt:
  10957. * Indicates retry count of data tx frames provided by the host.
  10958. */
  10959. tx_retry_cnt: 6; /* [31:26] */
  10960. A_UINT32 /* word 2 */
  10961. framectrl:16, /* [15: 0] */
  10962. seqno:16; /* [31:16] */
  10963. } POSTPACK;
  10964. #define HTT_TX_COMPL_IND_STATUS_S 8
  10965. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10966. #define HTT_TX_COMPL_IND_TID_S 11
  10967. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10968. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10969. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10970. #define HTT_TX_COMPL_IND_NUM_S 16
  10971. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10972. #define HTT_TX_COMPL_IND_APPEND_S 24
  10973. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10974. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10975. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10976. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10977. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10978. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10979. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10980. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10981. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10982. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10983. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10984. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10985. do { \
  10986. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10987. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10988. } while (0)
  10989. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10990. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10991. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10992. do { \
  10993. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10994. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  10995. } while (0)
  10996. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  10997. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  10998. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  10999. do { \
  11000. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11001. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11002. } while (0)
  11003. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11004. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11005. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11006. do { \
  11007. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11008. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11009. } while (0)
  11010. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11011. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11012. HTT_TX_COMPL_IND_TID_INV_S)
  11013. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11014. do { \
  11015. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11016. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11017. } while (0)
  11018. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11019. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11020. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11021. do { \
  11022. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11023. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11024. } while (0)
  11025. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11026. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11027. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11028. do { \
  11029. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11030. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11031. } while (0)
  11032. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11033. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11034. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11037. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11038. } while (0)
  11039. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11040. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11041. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11042. do { \
  11043. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11044. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11045. } while (0)
  11046. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11047. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11048. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11049. do { \
  11050. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11051. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11052. } while (0)
  11053. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11054. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11055. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11056. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11057. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11058. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11059. #define HTT_TX_COMPL_IND_STAT_OK 0
  11060. /* DISCARD:
  11061. * current meaning:
  11062. * MSDUs were queued for transmission but filtered by HW or SW
  11063. * without any over the air attempts
  11064. * legacy meaning (HL Rome):
  11065. * MSDUs were discarded by the target FW without any over the air
  11066. * attempts due to lack of space
  11067. */
  11068. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11069. /* NO_ACK:
  11070. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11071. */
  11072. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11073. /* POSTPONE:
  11074. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11075. * be downloaded again later (in the appropriate order), when they are
  11076. * deliverable.
  11077. */
  11078. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11079. /*
  11080. * The PEER_DEL tx completion status is used for HL cases
  11081. * where the peer the frame is for has been deleted.
  11082. * The host has already discarded its copy of the frame, but
  11083. * it still needs the tx completion to restore its credit.
  11084. */
  11085. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11086. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11087. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11088. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11089. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11090. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11091. PREPACK struct htt_tx_compl_ind_base {
  11092. A_UINT32 hdr;
  11093. A_UINT16 payload[1/*or more*/];
  11094. } POSTPACK;
  11095. PREPACK struct htt_tx_compl_ind_append_retries {
  11096. A_UINT16 msdu_id;
  11097. A_UINT8 tx_retries;
  11098. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11099. 0: this is the last append_retries struct */
  11100. } POSTPACK;
  11101. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11102. A_UINT32 timestamp[1/*or more*/];
  11103. } POSTPACK;
  11104. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11105. A_UINT32 tx_tsf64_low;
  11106. A_UINT32 tx_tsf64_high;
  11107. } POSTPACK;
  11108. /* htt_tx_data_hdr_information payload extension fields: */
  11109. /* DWORD zero */
  11110. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11111. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11112. /* DWORD one */
  11113. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11114. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11115. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11116. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11117. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11118. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11119. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11120. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11121. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11122. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11123. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11124. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11125. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11126. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11127. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11128. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11129. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11130. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11131. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11132. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11133. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11134. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11135. /* DWORD two */
  11136. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11137. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11138. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11139. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11140. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11141. do { \
  11142. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11143. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11144. } while (0)
  11145. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11146. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11147. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11148. do { \
  11149. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11150. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11151. } while (0)
  11152. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11153. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11154. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11155. do { \
  11156. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11157. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11158. } while (0)
  11159. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11160. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11161. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11162. do { \
  11163. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11164. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11165. } while (0)
  11166. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11167. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11168. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11169. do { \
  11170. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11171. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11172. } while (0)
  11173. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11174. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11175. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11176. do { \
  11177. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11178. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11179. } while (0)
  11180. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11181. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11182. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11183. do { \
  11184. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11185. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11186. } while (0)
  11187. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11188. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11189. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11190. do { \
  11191. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11192. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11193. } while (0)
  11194. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11195. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11196. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11199. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11200. } while (0)
  11201. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11202. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11203. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11204. do { \
  11205. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11206. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11207. } while (0)
  11208. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11209. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11210. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11211. do { \
  11212. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11213. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11214. } while (0)
  11215. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11216. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11217. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11218. do { \
  11219. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11220. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11221. } while (0)
  11222. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11223. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11224. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11225. do { \
  11226. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11227. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11228. } while (0)
  11229. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11230. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11231. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11232. do { \
  11233. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11234. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11235. } while (0)
  11236. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11237. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11238. /**
  11239. * @brief target -> host rate-control update indication message
  11240. *
  11241. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11242. *
  11243. * @details
  11244. * The following diagram shows the format of the RC Update message
  11245. * sent from the target to the host, while processing the tx-completion
  11246. * of a transmitted PPDU.
  11247. *
  11248. * |31 24|23 16|15 8|7 0|
  11249. * |-------------------------------------------------------------|
  11250. * | peer ID | vdev ID | msg_type |
  11251. * |-------------------------------------------------------------|
  11252. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11253. * |-------------------------------------------------------------|
  11254. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11255. * |-------------------------------------------------------------|
  11256. * | : |
  11257. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11258. * | : |
  11259. * |-------------------------------------------------------------|
  11260. * | : |
  11261. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11262. * | : |
  11263. * |-------------------------------------------------------------|
  11264. * : :
  11265. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11266. *
  11267. */
  11268. typedef struct {
  11269. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11270. A_UINT32 rate_code_flags;
  11271. A_UINT32 flags; /* Encodes information such as excessive
  11272. retransmission, aggregate, some info
  11273. from .11 frame control,
  11274. STBC, LDPC, (SGI and Tx Chain Mask
  11275. are encoded in ptx_rc->flags field),
  11276. AMPDU truncation (BT/time based etc.),
  11277. RTS/CTS attempt */
  11278. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11279. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11280. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11281. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11282. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11283. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11284. } HTT_RC_TX_DONE_PARAMS;
  11285. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11286. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11287. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11288. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11289. #define HTT_RC_UPDATE_VDEVID_S 8
  11290. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11291. #define HTT_RC_UPDATE_PEERID_S 16
  11292. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11293. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11294. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11295. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11296. do { \
  11297. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11298. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11299. } while (0)
  11300. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11301. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11302. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11303. do { \
  11304. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11305. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11306. } while (0)
  11307. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11308. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11309. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11310. do { \
  11311. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11312. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11313. } while (0)
  11314. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11315. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11316. /**
  11317. * @brief target -> host rx fragment indication message definition
  11318. *
  11319. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11320. *
  11321. * @details
  11322. * The following field definitions describe the format of the rx fragment
  11323. * indication message sent from the target to the host.
  11324. * The rx fragment indication message shares the format of the
  11325. * rx indication message, but not all fields from the rx indication message
  11326. * are relevant to the rx fragment indication message.
  11327. *
  11328. *
  11329. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11330. * |-----------+-------------------+---------------------+-------------|
  11331. * | peer ID | |FV| ext TID | msg type |
  11332. * |-------------------------------------------------------------------|
  11333. * | | flush | flush |
  11334. * | | end | start |
  11335. * | | seq num | seq num |
  11336. * |-------------------------------------------------------------------|
  11337. * | reserved | FW rx desc bytes |
  11338. * |-------------------------------------------------------------------|
  11339. * | | FW MSDU Rx |
  11340. * | | desc B0 |
  11341. * |-------------------------------------------------------------------|
  11342. * Header fields:
  11343. * - MSG_TYPE
  11344. * Bits 7:0
  11345. * Purpose: identifies this as an rx fragment indication message
  11346. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11347. * - EXT_TID
  11348. * Bits 12:8
  11349. * Purpose: identify the traffic ID of the rx data, including
  11350. * special "extended" TID values for multicast, broadcast, and
  11351. * non-QoS data frames
  11352. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11353. * - FLUSH_VALID (FV)
  11354. * Bit 13
  11355. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11356. * is valid
  11357. * Value:
  11358. * 1 -> flush IE is valid and needs to be processed
  11359. * 0 -> flush IE is not valid and should be ignored
  11360. * - PEER_ID
  11361. * Bits 31:16
  11362. * Purpose: Identify, by ID, which peer sent the rx data
  11363. * Value: ID of the peer who sent the rx data
  11364. * - FLUSH_SEQ_NUM_START
  11365. * Bits 5:0
  11366. * Purpose: Indicate the start of a series of MPDUs to flush
  11367. * Not all MPDUs within this series are necessarily valid - the host
  11368. * must check each sequence number within this range to see if the
  11369. * corresponding MPDU is actually present.
  11370. * This field is only valid if the FV bit is set.
  11371. * Value:
  11372. * The sequence number for the first MPDUs to check to flush.
  11373. * The sequence number is masked by 0x3f.
  11374. * - FLUSH_SEQ_NUM_END
  11375. * Bits 11:6
  11376. * Purpose: Indicate the end of a series of MPDUs to flush
  11377. * Value:
  11378. * The sequence number one larger than the sequence number of the
  11379. * last MPDU to check to flush.
  11380. * The sequence number is masked by 0x3f.
  11381. * Not all MPDUs within this series are necessarily valid - the host
  11382. * must check each sequence number within this range to see if the
  11383. * corresponding MPDU is actually present.
  11384. * This field is only valid if the FV bit is set.
  11385. * Rx descriptor fields:
  11386. * - FW_RX_DESC_BYTES
  11387. * Bits 15:0
  11388. * Purpose: Indicate how many bytes in the Rx indication are used for
  11389. * FW Rx descriptors
  11390. * Value: 1
  11391. */
  11392. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11393. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11394. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11395. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11396. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11397. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11398. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11399. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11400. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11401. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11402. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11403. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11404. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11405. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11406. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11407. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11408. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11409. #define HTT_RX_FRAG_IND_BYTES \
  11410. (4 /* msg hdr */ + \
  11411. 4 /* flush spec */ + \
  11412. 4 /* (unused) FW rx desc bytes spec */ + \
  11413. 4 /* FW rx desc */)
  11414. /**
  11415. * @brief target -> host test message definition
  11416. *
  11417. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11418. *
  11419. * @details
  11420. * The following field definitions describe the format of the test
  11421. * message sent from the target to the host.
  11422. * The message consists of a 4-octet header, followed by a variable
  11423. * number of 32-bit integer values, followed by a variable number
  11424. * of 8-bit character values.
  11425. *
  11426. * |31 16|15 8|7 0|
  11427. * |-----------------------------------------------------------|
  11428. * | num chars | num ints | msg type |
  11429. * |-----------------------------------------------------------|
  11430. * | int 0 |
  11431. * |-----------------------------------------------------------|
  11432. * | int 1 |
  11433. * |-----------------------------------------------------------|
  11434. * | ... |
  11435. * |-----------------------------------------------------------|
  11436. * | char 3 | char 2 | char 1 | char 0 |
  11437. * |-----------------------------------------------------------|
  11438. * | | | ... | char 4 |
  11439. * |-----------------------------------------------------------|
  11440. * - MSG_TYPE
  11441. * Bits 7:0
  11442. * Purpose: identifies this as a test message
  11443. * Value: HTT_MSG_TYPE_TEST
  11444. * - NUM_INTS
  11445. * Bits 15:8
  11446. * Purpose: indicate how many 32-bit integers follow the message header
  11447. * - NUM_CHARS
  11448. * Bits 31:16
  11449. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11450. */
  11451. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11452. #define HTT_RX_TEST_NUM_INTS_S 8
  11453. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11454. #define HTT_RX_TEST_NUM_CHARS_S 16
  11455. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11456. do { \
  11457. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11458. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11459. } while (0)
  11460. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11461. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11462. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11463. do { \
  11464. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11465. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11466. } while (0)
  11467. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11468. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11469. /**
  11470. * @brief target -> host packet log message
  11471. *
  11472. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11473. *
  11474. * @details
  11475. * The following field definitions describe the format of the packet log
  11476. * message sent from the target to the host.
  11477. * The message consists of a 4-octet header,followed by a variable number
  11478. * of 32-bit character values.
  11479. *
  11480. * |31 16|15 12|11 10|9 8|7 0|
  11481. * |------------------------------------------------------------------|
  11482. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11483. * |------------------------------------------------------------------|
  11484. * | payload |
  11485. * |------------------------------------------------------------------|
  11486. * - MSG_TYPE
  11487. * Bits 7:0
  11488. * Purpose: identifies this as a pktlog message
  11489. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11490. * - mac_id
  11491. * Bits 9:8
  11492. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11493. * Value: 0-3
  11494. * - pdev_id
  11495. * Bits 11:10
  11496. * Purpose: pdev_id
  11497. * Value: 0-3
  11498. * 0 (for rings at SOC level),
  11499. * 1/2/3 PDEV -> 0/1/2
  11500. * - payload_size
  11501. * Bits 31:16
  11502. * Purpose: explicitly specify the payload size
  11503. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11504. */
  11505. PREPACK struct htt_pktlog_msg {
  11506. A_UINT32 header;
  11507. A_UINT32 payload[1/* or more */];
  11508. } POSTPACK;
  11509. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11510. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11511. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11512. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11513. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11514. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11515. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11516. do { \
  11517. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11518. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11519. } while (0)
  11520. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11521. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11522. HTT_T2H_PKTLOG_MAC_ID_S)
  11523. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11524. do { \
  11525. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11526. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11527. } while (0)
  11528. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11529. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11530. HTT_T2H_PKTLOG_PDEV_ID_S)
  11531. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11532. do { \
  11533. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11534. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11535. } while (0)
  11536. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11537. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11538. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11539. /*
  11540. * Rx reorder statistics
  11541. * NB: all the fields must be defined in 4 octets size.
  11542. */
  11543. struct rx_reorder_stats {
  11544. /* Non QoS MPDUs received */
  11545. A_UINT32 deliver_non_qos;
  11546. /* MPDUs received in-order */
  11547. A_UINT32 deliver_in_order;
  11548. /* Flush due to reorder timer expired */
  11549. A_UINT32 deliver_flush_timeout;
  11550. /* Flush due to move out of window */
  11551. A_UINT32 deliver_flush_oow;
  11552. /* Flush due to DELBA */
  11553. A_UINT32 deliver_flush_delba;
  11554. /* MPDUs dropped due to FCS error */
  11555. A_UINT32 fcs_error;
  11556. /* MPDUs dropped due to monitor mode non-data packet */
  11557. A_UINT32 mgmt_ctrl;
  11558. /* Unicast-data MPDUs dropped due to invalid peer */
  11559. A_UINT32 invalid_peer;
  11560. /* MPDUs dropped due to duplication (non aggregation) */
  11561. A_UINT32 dup_non_aggr;
  11562. /* MPDUs dropped due to processed before */
  11563. A_UINT32 dup_past;
  11564. /* MPDUs dropped due to duplicate in reorder queue */
  11565. A_UINT32 dup_in_reorder;
  11566. /* Reorder timeout happened */
  11567. A_UINT32 reorder_timeout;
  11568. /* invalid bar ssn */
  11569. A_UINT32 invalid_bar_ssn;
  11570. /* reorder reset due to bar ssn */
  11571. A_UINT32 ssn_reset;
  11572. /* Flush due to delete peer */
  11573. A_UINT32 deliver_flush_delpeer;
  11574. /* Flush due to offload*/
  11575. A_UINT32 deliver_flush_offload;
  11576. /* Flush due to out of buffer*/
  11577. A_UINT32 deliver_flush_oob;
  11578. /* MPDUs dropped due to PN check fail */
  11579. A_UINT32 pn_fail;
  11580. /* MPDUs dropped due to unable to allocate memory */
  11581. A_UINT32 store_fail;
  11582. /* Number of times the tid pool alloc succeeded */
  11583. A_UINT32 tid_pool_alloc_succ;
  11584. /* Number of times the MPDU pool alloc succeeded */
  11585. A_UINT32 mpdu_pool_alloc_succ;
  11586. /* Number of times the MSDU pool alloc succeeded */
  11587. A_UINT32 msdu_pool_alloc_succ;
  11588. /* Number of times the tid pool alloc failed */
  11589. A_UINT32 tid_pool_alloc_fail;
  11590. /* Number of times the MPDU pool alloc failed */
  11591. A_UINT32 mpdu_pool_alloc_fail;
  11592. /* Number of times the MSDU pool alloc failed */
  11593. A_UINT32 msdu_pool_alloc_fail;
  11594. /* Number of times the tid pool freed */
  11595. A_UINT32 tid_pool_free;
  11596. /* Number of times the MPDU pool freed */
  11597. A_UINT32 mpdu_pool_free;
  11598. /* Number of times the MSDU pool freed */
  11599. A_UINT32 msdu_pool_free;
  11600. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11601. A_UINT32 msdu_queued;
  11602. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11603. A_UINT32 msdu_recycled;
  11604. /* Number of MPDUs with invalid peer but A2 found in AST */
  11605. A_UINT32 invalid_peer_a2_in_ast;
  11606. /* Number of MPDUs with invalid peer but A3 found in AST */
  11607. A_UINT32 invalid_peer_a3_in_ast;
  11608. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11609. A_UINT32 invalid_peer_bmc_mpdus;
  11610. /* Number of MSDUs with err attention word */
  11611. A_UINT32 rxdesc_err_att;
  11612. /* Number of MSDUs with flag of peer_idx_invalid */
  11613. A_UINT32 rxdesc_err_peer_idx_inv;
  11614. /* Number of MSDUs with flag of peer_idx_timeout */
  11615. A_UINT32 rxdesc_err_peer_idx_to;
  11616. /* Number of MSDUs with flag of overflow */
  11617. A_UINT32 rxdesc_err_ov;
  11618. /* Number of MSDUs with flag of msdu_length_err */
  11619. A_UINT32 rxdesc_err_msdu_len;
  11620. /* Number of MSDUs with flag of mpdu_length_err */
  11621. A_UINT32 rxdesc_err_mpdu_len;
  11622. /* Number of MSDUs with flag of tkip_mic_err */
  11623. A_UINT32 rxdesc_err_tkip_mic;
  11624. /* Number of MSDUs with flag of decrypt_err */
  11625. A_UINT32 rxdesc_err_decrypt;
  11626. /* Number of MSDUs with flag of fcs_err */
  11627. A_UINT32 rxdesc_err_fcs;
  11628. /* Number of Unicast (bc_mc bit is not set in attention word)
  11629. * frames with invalid peer handler
  11630. */
  11631. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11632. /* Number of unicast frame directly (direct bit is set in attention word)
  11633. * to DUT with invalid peer handler
  11634. */
  11635. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11636. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11637. * frames with invalid peer handler
  11638. */
  11639. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11640. /* Number of MSDUs dropped due to no first MSDU flag */
  11641. A_UINT32 rxdesc_no_1st_msdu;
  11642. /* Number of MSDUs droped due to ring overflow */
  11643. A_UINT32 msdu_drop_ring_ov;
  11644. /* Number of MSDUs dropped due to FC mismatch */
  11645. A_UINT32 msdu_drop_fc_mismatch;
  11646. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11647. A_UINT32 msdu_drop_mgmt_remote_ring;
  11648. /* Number of MSDUs dropped due to errors not reported in attention word */
  11649. A_UINT32 msdu_drop_misc;
  11650. /* Number of MSDUs go to offload before reorder */
  11651. A_UINT32 offload_msdu_wal;
  11652. /* Number of data frame dropped by offload after reorder */
  11653. A_UINT32 offload_msdu_reorder;
  11654. /* Number of MPDUs with sequence number in the past and within the BA window */
  11655. A_UINT32 dup_past_within_window;
  11656. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11657. A_UINT32 dup_past_outside_window;
  11658. /* Number of MSDUs with decrypt/MIC error */
  11659. A_UINT32 rxdesc_err_decrypt_mic;
  11660. /* Number of data MSDUs received on both local and remote rings */
  11661. A_UINT32 data_msdus_on_both_rings;
  11662. /* MPDUs never filled */
  11663. A_UINT32 holes_not_filled;
  11664. };
  11665. /*
  11666. * Rx Remote buffer statistics
  11667. * NB: all the fields must be defined in 4 octets size.
  11668. */
  11669. struct rx_remote_buffer_mgmt_stats {
  11670. /* Total number of MSDUs reaped for Rx processing */
  11671. A_UINT32 remote_reaped;
  11672. /* MSDUs recycled within firmware */
  11673. A_UINT32 remote_recycled;
  11674. /* MSDUs stored by Data Rx */
  11675. A_UINT32 data_rx_msdus_stored;
  11676. /* Number of HTT indications from WAL Rx MSDU */
  11677. A_UINT32 wal_rx_ind;
  11678. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11679. A_UINT32 wal_rx_ind_unconsumed;
  11680. /* Number of HTT indications from Data Rx MSDU */
  11681. A_UINT32 data_rx_ind;
  11682. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11683. A_UINT32 data_rx_ind_unconsumed;
  11684. /* Number of HTT indications from ATHBUF */
  11685. A_UINT32 athbuf_rx_ind;
  11686. /* Number of remote buffers requested for refill */
  11687. A_UINT32 refill_buf_req;
  11688. /* Number of remote buffers filled by the host */
  11689. A_UINT32 refill_buf_rsp;
  11690. /* Number of times MAC hw_index = f/w write_index */
  11691. A_INT32 mac_no_bufs;
  11692. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11693. A_INT32 fw_indices_equal;
  11694. /* Number of times f/w finds no buffers to post */
  11695. A_INT32 host_no_bufs;
  11696. };
  11697. /*
  11698. * TXBF MU/SU packets and NDPA statistics
  11699. * NB: all the fields must be defined in 4 octets size.
  11700. */
  11701. struct rx_txbf_musu_ndpa_pkts_stats {
  11702. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11703. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11704. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11705. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11706. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11707. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11708. };
  11709. /*
  11710. * htt_dbg_stats_status -
  11711. * present - The requested stats have been delivered in full.
  11712. * This indicates that either the stats information was contained
  11713. * in its entirety within this message, or else this message
  11714. * completes the delivery of the requested stats info that was
  11715. * partially delivered through earlier STATS_CONF messages.
  11716. * partial - The requested stats have been delivered in part.
  11717. * One or more subsequent STATS_CONF messages with the same
  11718. * cookie value will be sent to deliver the remainder of the
  11719. * information.
  11720. * error - The requested stats could not be delivered, for example due
  11721. * to a shortage of memory to construct a message holding the
  11722. * requested stats.
  11723. * invalid - The requested stat type is either not recognized, or the
  11724. * target is configured to not gather the stats type in question.
  11725. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11726. * series_done - This special value indicates that no further stats info
  11727. * elements are present within a series of stats info elems
  11728. * (within a stats upload confirmation message).
  11729. */
  11730. enum htt_dbg_stats_status {
  11731. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11732. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11733. HTT_DBG_STATS_STATUS_ERROR = 2,
  11734. HTT_DBG_STATS_STATUS_INVALID = 3,
  11735. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11736. };
  11737. /**
  11738. * @brief target -> host statistics upload
  11739. *
  11740. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11741. *
  11742. * @details
  11743. * The following field definitions describe the format of the HTT target
  11744. * to host stats upload confirmation message.
  11745. * The message contains a cookie echoed from the HTT host->target stats
  11746. * upload request, which identifies which request the confirmation is
  11747. * for, and a series of tag-length-value stats information elements.
  11748. * The tag-length header for each stats info element also includes a
  11749. * status field, to indicate whether the request for the stat type in
  11750. * question was fully met, partially met, unable to be met, or invalid
  11751. * (if the stat type in question is disabled in the target).
  11752. * A special value of all 1's in this status field is used to indicate
  11753. * the end of the series of stats info elements.
  11754. *
  11755. *
  11756. * |31 16|15 8|7 5|4 0|
  11757. * |------------------------------------------------------------|
  11758. * | reserved | msg type |
  11759. * |------------------------------------------------------------|
  11760. * | cookie LSBs |
  11761. * |------------------------------------------------------------|
  11762. * | cookie MSBs |
  11763. * |------------------------------------------------------------|
  11764. * | stats entry length | reserved | S |stat type|
  11765. * |------------------------------------------------------------|
  11766. * | |
  11767. * | type-specific stats info |
  11768. * | |
  11769. * |------------------------------------------------------------|
  11770. * | stats entry length | reserved | S |stat type|
  11771. * |------------------------------------------------------------|
  11772. * | |
  11773. * | type-specific stats info |
  11774. * | |
  11775. * |------------------------------------------------------------|
  11776. * | n/a | reserved | 111 | n/a |
  11777. * |------------------------------------------------------------|
  11778. * Header fields:
  11779. * - MSG_TYPE
  11780. * Bits 7:0
  11781. * Purpose: identifies this is a statistics upload confirmation message
  11782. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11783. * - COOKIE_LSBS
  11784. * Bits 31:0
  11785. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11786. * message with its preceding host->target stats request message.
  11787. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11788. * - COOKIE_MSBS
  11789. * Bits 31:0
  11790. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11791. * message with its preceding host->target stats request message.
  11792. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11793. *
  11794. * Stats Information Element tag-length header fields:
  11795. * - STAT_TYPE
  11796. * Bits 4:0
  11797. * Purpose: identifies the type of statistics info held in the
  11798. * following information element
  11799. * Value: htt_dbg_stats_type
  11800. * - STATUS
  11801. * Bits 7:5
  11802. * Purpose: indicate whether the requested stats are present
  11803. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11804. * the completion of the stats entry series
  11805. * - LENGTH
  11806. * Bits 31:16
  11807. * Purpose: indicate the stats information size
  11808. * Value: This field specifies the number of bytes of stats information
  11809. * that follows the element tag-length header.
  11810. * It is expected but not required that this length is a multiple of
  11811. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11812. * subsequent stats entry header will begin on a 4-byte aligned
  11813. * boundary.
  11814. */
  11815. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11816. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11817. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11818. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11819. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11820. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11821. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11822. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11823. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11824. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11825. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11826. do { \
  11827. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11828. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11829. } while (0)
  11830. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11831. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11832. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11833. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11834. do { \
  11835. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11836. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11837. } while (0)
  11838. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11839. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11840. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11841. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11844. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11845. } while (0)
  11846. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11847. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11848. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11849. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11850. #define HTT_MAX_AGGR 64
  11851. #define HTT_HL_MAX_AGGR 18
  11852. /**
  11853. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11854. *
  11855. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11856. *
  11857. * @details
  11858. * The following field definitions describe the format of the HTT host
  11859. * to target frag_desc/msdu_ext bank configuration message.
  11860. * The message contains the based address and the min and max id of the
  11861. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11862. * MSDU_EXT/FRAG_DESC.
  11863. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11864. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11865. * the hardware does the mapping/translation.
  11866. *
  11867. * Total banks that can be configured is configured to 16.
  11868. *
  11869. * This should be called before any TX has be initiated by the HTT
  11870. *
  11871. * |31 16|15 8|7 5|4 0|
  11872. * |------------------------------------------------------------|
  11873. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11874. * |------------------------------------------------------------|
  11875. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11876. #if HTT_PADDR64
  11877. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11878. #endif
  11879. * |------------------------------------------------------------|
  11880. * | ... |
  11881. * |------------------------------------------------------------|
  11882. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11883. #if HTT_PADDR64
  11884. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11885. #endif
  11886. * |------------------------------------------------------------|
  11887. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11888. * |------------------------------------------------------------|
  11889. * | ... |
  11890. * |------------------------------------------------------------|
  11891. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11892. * |------------------------------------------------------------|
  11893. * Header fields:
  11894. * - MSG_TYPE
  11895. * Bits 7:0
  11896. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11897. * for systems with 64-bit format for bus addresses:
  11898. * - BANKx_BASE_ADDRESS_LO
  11899. * Bits 31:0
  11900. * Purpose: Provide a mechanism to specify the base address of the
  11901. * MSDU_EXT bank physical/bus address.
  11902. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11903. * - BANKx_BASE_ADDRESS_HI
  11904. * Bits 31:0
  11905. * Purpose: Provide a mechanism to specify the base address of the
  11906. * MSDU_EXT bank physical/bus address.
  11907. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11908. * for systems with 32-bit format for bus addresses:
  11909. * - BANKx_BASE_ADDRESS
  11910. * Bits 31:0
  11911. * Purpose: Provide a mechanism to specify the base address of the
  11912. * MSDU_EXT bank physical/bus address.
  11913. * Value: MSDU_EXT bank physical / bus address
  11914. * - BANKx_MIN_ID
  11915. * Bits 15:0
  11916. * Purpose: Provide a mechanism to specify the min index that needs to
  11917. * mapped.
  11918. * - BANKx_MAX_ID
  11919. * Bits 31:16
  11920. * Purpose: Provide a mechanism to specify the max index that needs to
  11921. * mapped.
  11922. *
  11923. */
  11924. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11925. * safe value.
  11926. * @note MAX supported banks is 16.
  11927. */
  11928. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11929. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11930. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11931. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11932. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11933. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11934. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11935. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11936. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11937. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11938. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11939. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11940. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11941. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11942. do { \
  11943. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11944. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11945. } while (0)
  11946. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11947. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11948. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11949. do { \
  11950. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11951. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11952. } while (0)
  11953. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11954. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11955. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11956. do { \
  11957. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11958. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11959. } while (0)
  11960. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11961. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11962. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11963. do { \
  11964. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11965. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11966. } while (0)
  11967. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11968. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11969. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11970. do { \
  11971. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11972. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11973. } while (0)
  11974. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11975. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11976. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11977. do { \
  11978. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11979. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11980. } while (0)
  11981. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11982. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11983. /*
  11984. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11985. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11986. * addresses are stored in a XXX-bit field.
  11987. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11988. * htt_tx_frag_desc64_bank_cfg_t structs.
  11989. */
  11990. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11991. _paddr_bits_, \
  11992. _paddr__bank_base_address_) \
  11993. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11994. /** word 0 \
  11995. * msg_type: 8, \
  11996. * pdev_id: 2, \
  11997. * swap: 1, \
  11998. * reserved0: 5, \
  11999. * num_banks: 8, \
  12000. * desc_size: 8; \
  12001. */ \
  12002. A_UINT32 word0; \
  12003. /* \
  12004. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12005. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12006. * the second A_UINT32). \
  12007. */ \
  12008. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12009. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12010. } POSTPACK
  12011. /* define htt_tx_frag_desc32_bank_cfg_t */
  12012. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12013. /* define htt_tx_frag_desc64_bank_cfg_t */
  12014. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12015. /*
  12016. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12017. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12018. */
  12019. #if HTT_PADDR64
  12020. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12021. #else
  12022. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12023. #endif
  12024. /**
  12025. * @brief target -> host HTT TX Credit total count update message definition
  12026. *
  12027. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12028. *
  12029. *|31 16|15|14 9| 8 |7 0 |
  12030. *|---------------------+--+----------+-------+----------|
  12031. *|cur htt credit delta | Q| reserved | sign | msg type |
  12032. *|------------------------------------------------------|
  12033. *
  12034. * Header fields:
  12035. * - MSG_TYPE
  12036. * Bits 7:0
  12037. * Purpose: identifies this as a htt tx credit delta update message
  12038. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12039. * - SIGN
  12040. * Bits 8
  12041. * identifies whether credit delta is positive or negative
  12042. * Value:
  12043. * - 0x0: credit delta is positive, rebalance in some buffers
  12044. * - 0x1: credit delta is negative, rebalance out some buffers
  12045. * - reserved
  12046. * Bits 14:9
  12047. * Value: 0x0
  12048. * - TXQ_GRP
  12049. * Bit 15
  12050. * Purpose: indicates whether any tx queue group information elements
  12051. * are appended to the tx credit update message
  12052. * Value: 0 -> no tx queue group information element is present
  12053. * 1 -> a tx queue group information element immediately follows
  12054. * - DELTA_COUNT
  12055. * Bits 31:16
  12056. * Purpose: Specify current htt credit delta absolute count
  12057. */
  12058. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12059. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12060. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12061. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12062. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12063. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12064. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12065. do { \
  12066. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12067. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12068. } while (0)
  12069. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12070. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12071. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12074. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12075. } while (0)
  12076. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12077. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12078. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12079. do { \
  12080. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12081. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12082. } while (0)
  12083. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12084. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12085. #define HTT_TX_CREDIT_MSG_BYTES 4
  12086. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12087. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12088. /**
  12089. * @brief HTT WDI_IPA Operation Response Message
  12090. *
  12091. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12092. *
  12093. * @details
  12094. * HTT WDI_IPA Operation Response message is sent by target
  12095. * to host confirming suspend or resume operation.
  12096. * |31 24|23 16|15 8|7 0|
  12097. * |----------------+----------------+----------------+----------------|
  12098. * | op_code | Rsvd | msg_type |
  12099. * |-------------------------------------------------------------------|
  12100. * | Rsvd | Response len |
  12101. * |-------------------------------------------------------------------|
  12102. * | |
  12103. * | Response-type specific info |
  12104. * | |
  12105. * | |
  12106. * |-------------------------------------------------------------------|
  12107. * Header fields:
  12108. * - MSG_TYPE
  12109. * Bits 7:0
  12110. * Purpose: Identifies this as WDI_IPA Operation Response message
  12111. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12112. * - OP_CODE
  12113. * Bits 31:16
  12114. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12115. * value: = enum htt_wdi_ipa_op_code
  12116. * - RSP_LEN
  12117. * Bits 16:0
  12118. * Purpose: length for the response-type specific info
  12119. * value: = length in bytes for response-type specific info
  12120. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12121. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12122. */
  12123. PREPACK struct htt_wdi_ipa_op_response_t
  12124. {
  12125. /* DWORD 0: flags and meta-data */
  12126. A_UINT32
  12127. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12128. reserved1: 8,
  12129. op_code: 16;
  12130. A_UINT32
  12131. rsp_len: 16,
  12132. reserved2: 16;
  12133. } POSTPACK;
  12134. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12135. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12136. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12137. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12138. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12139. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12140. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12141. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12142. do { \
  12143. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12144. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12145. } while (0)
  12146. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12147. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12148. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12149. do { \
  12150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12151. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12152. } while (0)
  12153. enum htt_phy_mode {
  12154. htt_phy_mode_11a = 0,
  12155. htt_phy_mode_11g = 1,
  12156. htt_phy_mode_11b = 2,
  12157. htt_phy_mode_11g_only = 3,
  12158. htt_phy_mode_11na_ht20 = 4,
  12159. htt_phy_mode_11ng_ht20 = 5,
  12160. htt_phy_mode_11na_ht40 = 6,
  12161. htt_phy_mode_11ng_ht40 = 7,
  12162. htt_phy_mode_11ac_vht20 = 8,
  12163. htt_phy_mode_11ac_vht40 = 9,
  12164. htt_phy_mode_11ac_vht80 = 10,
  12165. htt_phy_mode_11ac_vht20_2g = 11,
  12166. htt_phy_mode_11ac_vht40_2g = 12,
  12167. htt_phy_mode_11ac_vht80_2g = 13,
  12168. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12169. htt_phy_mode_11ac_vht160 = 15,
  12170. htt_phy_mode_max,
  12171. };
  12172. /**
  12173. * @brief target -> host HTT channel change indication
  12174. *
  12175. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12176. *
  12177. * @details
  12178. * Specify when a channel change occurs.
  12179. * This allows the host to precisely determine which rx frames arrived
  12180. * on the old channel and which rx frames arrived on the new channel.
  12181. *
  12182. *|31 |7 0 |
  12183. *|-------------------------------------------+----------|
  12184. *| reserved | msg type |
  12185. *|------------------------------------------------------|
  12186. *| primary_chan_center_freq_mhz |
  12187. *|------------------------------------------------------|
  12188. *| contiguous_chan1_center_freq_mhz |
  12189. *|------------------------------------------------------|
  12190. *| contiguous_chan2_center_freq_mhz |
  12191. *|------------------------------------------------------|
  12192. *| phy_mode |
  12193. *|------------------------------------------------------|
  12194. *
  12195. * Header fields:
  12196. * - MSG_TYPE
  12197. * Bits 7:0
  12198. * Purpose: identifies this as a htt channel change indication message
  12199. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12200. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12201. * Bits 31:0
  12202. * Purpose: identify the (center of the) new 20 MHz primary channel
  12203. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12204. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12205. * Bits 31:0
  12206. * Purpose: identify the (center of the) contiguous frequency range
  12207. * comprising the new channel.
  12208. * For example, if the new channel is a 80 MHz channel extending
  12209. * 60 MHz beyond the primary channel, this field would be 30 larger
  12210. * than the primary channel center frequency field.
  12211. * Value: center frequency of the contiguous frequency range comprising
  12212. * the full channel in MHz units
  12213. * (80+80 channels also use the CONTIG_CHAN2 field)
  12214. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12215. * Bits 31:0
  12216. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12217. * within a VHT 80+80 channel.
  12218. * This field is only relevant for VHT 80+80 channels.
  12219. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12220. * channel (arbitrary value for cases besides VHT 80+80)
  12221. * - PHY_MODE
  12222. * Bits 31:0
  12223. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12224. * and band
  12225. * Value: htt_phy_mode enum value
  12226. */
  12227. PREPACK struct htt_chan_change_t
  12228. {
  12229. /* DWORD 0: flags and meta-data */
  12230. A_UINT32
  12231. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12232. reserved1: 24;
  12233. A_UINT32 primary_chan_center_freq_mhz;
  12234. A_UINT32 contig_chan1_center_freq_mhz;
  12235. A_UINT32 contig_chan2_center_freq_mhz;
  12236. A_UINT32 phy_mode;
  12237. } POSTPACK;
  12238. /*
  12239. * Due to historical / backwards-compatibility reasons, maintain the
  12240. * below htt_chan_change_msg struct definition, which needs to be
  12241. * consistent with the above htt_chan_change_t struct definition
  12242. * (aside from the htt_chan_change_t definition including the msg_type
  12243. * dword within the message, and the htt_chan_change_msg only containing
  12244. * the payload of the message that follows the msg_type dword).
  12245. */
  12246. PREPACK struct htt_chan_change_msg {
  12247. A_UINT32 chan_mhz; /* frequency in mhz */
  12248. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12249. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12250. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12251. } POSTPACK;
  12252. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12253. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12254. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12255. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12256. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12257. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12258. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12259. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12260. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12261. do { \
  12262. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12263. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12264. } while (0)
  12265. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12266. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12267. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12268. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12269. do { \
  12270. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12271. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12272. } while (0)
  12273. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12274. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12275. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12276. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12277. do { \
  12278. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12279. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12280. } while (0)
  12281. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12282. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12283. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12284. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12285. do { \
  12286. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12287. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12288. } while (0)
  12289. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12290. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12291. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12292. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12293. /**
  12294. * @brief rx offload packet error message
  12295. *
  12296. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12297. *
  12298. * @details
  12299. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12300. * of target payload like mic err.
  12301. *
  12302. * |31 24|23 16|15 8|7 0|
  12303. * |----------------+----------------+----------------+----------------|
  12304. * | tid | vdev_id | msg_sub_type | msg_type |
  12305. * |-------------------------------------------------------------------|
  12306. * : (sub-type dependent content) :
  12307. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12308. * Header fields:
  12309. * - msg_type
  12310. * Bits 7:0
  12311. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12312. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12313. * - msg_sub_type
  12314. * Bits 15:8
  12315. * Purpose: Identifies which type of rx error is reported by this message
  12316. * value: htt_rx_ofld_pkt_err_type
  12317. * - vdev_id
  12318. * Bits 23:16
  12319. * Purpose: Identifies which vdev received the erroneous rx frame
  12320. * value:
  12321. * - tid
  12322. * Bits 31:24
  12323. * Purpose: Identifies the traffic type of the rx frame
  12324. * value:
  12325. *
  12326. * - The payload fields used if the sub-type == MIC error are shown below.
  12327. * Note - MIC err is per MSDU, while PN is per MPDU.
  12328. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12329. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12330. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12331. * instead of sending separate HTT messages for each wrong MSDU within
  12332. * the MPDU.
  12333. *
  12334. * |31 24|23 16|15 8|7 0|
  12335. * |----------------+----------------+----------------+----------------|
  12336. * | Rsvd | key_id | peer_id |
  12337. * |-------------------------------------------------------------------|
  12338. * | receiver MAC addr 31:0 |
  12339. * |-------------------------------------------------------------------|
  12340. * | Rsvd | receiver MAC addr 47:32 |
  12341. * |-------------------------------------------------------------------|
  12342. * | transmitter MAC addr 31:0 |
  12343. * |-------------------------------------------------------------------|
  12344. * | Rsvd | transmitter MAC addr 47:32 |
  12345. * |-------------------------------------------------------------------|
  12346. * | PN 31:0 |
  12347. * |-------------------------------------------------------------------|
  12348. * | Rsvd | PN 47:32 |
  12349. * |-------------------------------------------------------------------|
  12350. * - peer_id
  12351. * Bits 15:0
  12352. * Purpose: identifies which peer is frame is from
  12353. * value:
  12354. * - key_id
  12355. * Bits 23:16
  12356. * Purpose: identifies key_id of rx frame
  12357. * value:
  12358. * - RA_31_0 (receiver MAC addr 31:0)
  12359. * Bits 31:0
  12360. * Purpose: identifies by MAC address which vdev received the frame
  12361. * value: MAC address lower 4 bytes
  12362. * - RA_47_32 (receiver MAC addr 47:32)
  12363. * Bits 15:0
  12364. * Purpose: identifies by MAC address which vdev received the frame
  12365. * value: MAC address upper 2 bytes
  12366. * - TA_31_0 (transmitter MAC addr 31:0)
  12367. * Bits 31:0
  12368. * Purpose: identifies by MAC address which peer transmitted the frame
  12369. * value: MAC address lower 4 bytes
  12370. * - TA_47_32 (transmitter MAC addr 47:32)
  12371. * Bits 15:0
  12372. * Purpose: identifies by MAC address which peer transmitted the frame
  12373. * value: MAC address upper 2 bytes
  12374. * - PN_31_0
  12375. * Bits 31:0
  12376. * Purpose: Identifies pn of rx frame
  12377. * value: PN lower 4 bytes
  12378. * - PN_47_32
  12379. * Bits 15:0
  12380. * Purpose: Identifies pn of rx frame
  12381. * value:
  12382. * TKIP or CCMP: PN upper 2 bytes
  12383. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12384. */
  12385. enum htt_rx_ofld_pkt_err_type {
  12386. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12387. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12388. };
  12389. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12390. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12391. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12392. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12393. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12394. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12395. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12396. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12397. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12398. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12399. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12400. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12401. do { \
  12402. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12403. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12404. } while (0)
  12405. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12406. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12407. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12408. do { \
  12409. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12410. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12411. } while (0)
  12412. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12413. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12414. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12415. do { \
  12416. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12417. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12418. } while (0)
  12419. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12420. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12421. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12422. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12423. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12424. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12425. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12426. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12438. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12439. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12441. do { \
  12442. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12443. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12444. } while (0)
  12445. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12446. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12447. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12448. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12449. do { \
  12450. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12451. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12452. } while (0)
  12453. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12454. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12455. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12456. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12457. do { \
  12458. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12459. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12460. } while (0)
  12461. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12462. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12463. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12464. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12465. do { \
  12466. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12467. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12468. } while (0)
  12469. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12470. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12471. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12472. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12473. do { \
  12474. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12475. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12476. } while (0)
  12477. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12478. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12479. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12480. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12481. do { \
  12482. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12483. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12484. } while (0)
  12485. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12486. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12487. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12488. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12489. do { \
  12490. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12491. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12492. } while (0)
  12493. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12494. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12495. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12496. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12497. do { \
  12498. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12499. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12500. } while (0)
  12501. /**
  12502. * @brief target -> host peer rate report message
  12503. *
  12504. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12505. *
  12506. * @details
  12507. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12508. * justified rate of all the peers.
  12509. *
  12510. * |31 24|23 16|15 8|7 0|
  12511. * |----------------+----------------+----------------+----------------|
  12512. * | peer_count | | msg_type |
  12513. * |-------------------------------------------------------------------|
  12514. * : Payload (variant number of peer rate report) :
  12515. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12516. * Header fields:
  12517. * - msg_type
  12518. * Bits 7:0
  12519. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12520. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12521. * - reserved
  12522. * Bits 15:8
  12523. * Purpose:
  12524. * value:
  12525. * - peer_count
  12526. * Bits 31:16
  12527. * Purpose: Specify how many peer rate report elements are present in the payload.
  12528. * value:
  12529. *
  12530. * Payload:
  12531. * There are variant number of peer rate report follow the first 32 bits.
  12532. * The peer rate report is defined as follows.
  12533. *
  12534. * |31 20|19 16|15 0|
  12535. * |-----------------------+---------+---------------------------------|-
  12536. * | reserved | phy | peer_id | \
  12537. * |-------------------------------------------------------------------| -> report #0
  12538. * | rate | /
  12539. * |-----------------------+---------+---------------------------------|-
  12540. * | reserved | phy | peer_id | \
  12541. * |-------------------------------------------------------------------| -> report #1
  12542. * | rate | /
  12543. * |-----------------------+---------+---------------------------------|-
  12544. * | reserved | phy | peer_id | \
  12545. * |-------------------------------------------------------------------| -> report #2
  12546. * | rate | /
  12547. * |-------------------------------------------------------------------|-
  12548. * : :
  12549. * : :
  12550. * : :
  12551. * :-------------------------------------------------------------------:
  12552. *
  12553. * - peer_id
  12554. * Bits 15:0
  12555. * Purpose: identify the peer
  12556. * value:
  12557. * - phy
  12558. * Bits 19:16
  12559. * Purpose: identify which phy is in use
  12560. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12561. * Please see enum htt_peer_report_phy_type for detail.
  12562. * - reserved
  12563. * Bits 31:20
  12564. * Purpose:
  12565. * value:
  12566. * - rate
  12567. * Bits 31:0
  12568. * Purpose: represent the justified rate of the peer specified by peer_id
  12569. * value:
  12570. */
  12571. enum htt_peer_rate_report_phy_type {
  12572. HTT_PEER_RATE_REPORT_11B = 0,
  12573. HTT_PEER_RATE_REPORT_11A_G,
  12574. HTT_PEER_RATE_REPORT_11N,
  12575. HTT_PEER_RATE_REPORT_11AC,
  12576. };
  12577. #define HTT_PEER_RATE_REPORT_SIZE 8
  12578. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12579. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12580. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12581. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12582. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12583. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12584. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12585. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12586. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12587. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12588. do { \
  12589. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12590. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12591. } while (0)
  12592. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12593. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12594. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12595. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12596. do { \
  12597. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12598. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12599. } while (0)
  12600. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12601. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12602. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12603. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12604. do { \
  12605. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12606. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12607. } while (0)
  12608. /**
  12609. * @brief target -> host flow pool map message
  12610. *
  12611. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12612. *
  12613. * @details
  12614. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12615. * a flow of descriptors.
  12616. *
  12617. * This message is in TLV format and indicates the parameters to be setup a
  12618. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12619. * receive descriptors from a specified pool.
  12620. *
  12621. * The message would appear as follows:
  12622. *
  12623. * |31 24|23 16|15 8|7 0|
  12624. * |----------------+----------------+----------------+----------------|
  12625. * header | reserved | num_flows | msg_type |
  12626. * |-------------------------------------------------------------------|
  12627. * | |
  12628. * : payload :
  12629. * | |
  12630. * |-------------------------------------------------------------------|
  12631. *
  12632. * The header field is one DWORD long and is interpreted as follows:
  12633. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12634. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12635. * this message
  12636. * b'16-31 - reserved: These bits are reserved for future use
  12637. *
  12638. * Payload:
  12639. * The payload would contain multiple objects of the following structure. Each
  12640. * object represents a flow.
  12641. *
  12642. * |31 24|23 16|15 8|7 0|
  12643. * |----------------+----------------+----------------+----------------|
  12644. * header | reserved | num_flows | msg_type |
  12645. * |-------------------------------------------------------------------|
  12646. * payload0| flow_type |
  12647. * |-------------------------------------------------------------------|
  12648. * | flow_id |
  12649. * |-------------------------------------------------------------------|
  12650. * | reserved0 | flow_pool_id |
  12651. * |-------------------------------------------------------------------|
  12652. * | reserved1 | flow_pool_size |
  12653. * |-------------------------------------------------------------------|
  12654. * | reserved2 |
  12655. * |-------------------------------------------------------------------|
  12656. * payload1| flow_type |
  12657. * |-------------------------------------------------------------------|
  12658. * | flow_id |
  12659. * |-------------------------------------------------------------------|
  12660. * | reserved0 | flow_pool_id |
  12661. * |-------------------------------------------------------------------|
  12662. * | reserved1 | flow_pool_size |
  12663. * |-------------------------------------------------------------------|
  12664. * | reserved2 |
  12665. * |-------------------------------------------------------------------|
  12666. * | . |
  12667. * | . |
  12668. * | . |
  12669. * |-------------------------------------------------------------------|
  12670. *
  12671. * Each payload is 5 DWORDS long and is interpreted as follows:
  12672. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12673. * this flow is associated. It can be VDEV, peer,
  12674. * or tid (AC). Based on enum htt_flow_type.
  12675. *
  12676. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12677. * object. For flow_type vdev it is set to the
  12678. * vdevid, for peer it is peerid and for tid, it is
  12679. * tid_num.
  12680. *
  12681. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12682. * in the host for this flow
  12683. * b'16:31 - reserved0: This field in reserved for the future. In case
  12684. * we have a hierarchical implementation (HCM) of
  12685. * pools, it can be used to indicate the ID of the
  12686. * parent-pool.
  12687. *
  12688. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12689. * Descriptors for this flow will be
  12690. * allocated from this pool in the host.
  12691. * b'16:31 - reserved1: This field in reserved for the future. In case
  12692. * we have a hierarchical implementation of pools,
  12693. * it can be used to indicate the max number of
  12694. * descriptors in the pool. The b'0:15 can be used
  12695. * to indicate min number of descriptors in the
  12696. * HCM scheme.
  12697. *
  12698. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12699. * we have a hierarchical implementation of pools,
  12700. * b'0:15 can be used to indicate the
  12701. * priority-based borrowing (PBB) threshold of
  12702. * the flow's pool. The b'16:31 are still left
  12703. * reserved.
  12704. */
  12705. enum htt_flow_type {
  12706. FLOW_TYPE_VDEV = 0,
  12707. /* Insert new flow types above this line */
  12708. };
  12709. PREPACK struct htt_flow_pool_map_payload_t {
  12710. A_UINT32 flow_type;
  12711. A_UINT32 flow_id;
  12712. A_UINT32 flow_pool_id:16,
  12713. reserved0:16;
  12714. A_UINT32 flow_pool_size:16,
  12715. reserved1:16;
  12716. A_UINT32 reserved2;
  12717. } POSTPACK;
  12718. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12719. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12720. (sizeof(struct htt_flow_pool_map_payload_t))
  12721. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12722. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12723. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12724. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12725. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12726. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12727. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12728. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12729. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12730. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12731. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12732. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12733. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12734. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12735. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12736. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12737. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12738. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12739. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12740. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12741. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12742. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12743. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12744. do { \
  12745. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12746. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12747. } while (0)
  12748. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12749. do { \
  12750. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12751. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12752. } while (0)
  12753. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12754. do { \
  12755. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12756. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12757. } while (0)
  12758. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12759. do { \
  12760. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12761. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12762. } while (0)
  12763. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12764. do { \
  12765. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12766. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12767. } while (0)
  12768. /**
  12769. * @brief target -> host flow pool unmap message
  12770. *
  12771. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12772. *
  12773. * @details
  12774. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12775. * down a flow of descriptors.
  12776. * This message indicates that for the flow (whose ID is provided) is wanting
  12777. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12778. * pool of descriptors from where descriptors are being allocated for this
  12779. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12780. * be unmapped by the host.
  12781. *
  12782. * The message would appear as follows:
  12783. *
  12784. * |31 24|23 16|15 8|7 0|
  12785. * |----------------+----------------+----------------+----------------|
  12786. * | reserved0 | msg_type |
  12787. * |-------------------------------------------------------------------|
  12788. * | flow_type |
  12789. * |-------------------------------------------------------------------|
  12790. * | flow_id |
  12791. * |-------------------------------------------------------------------|
  12792. * | reserved1 | flow_pool_id |
  12793. * |-------------------------------------------------------------------|
  12794. *
  12795. * The message is interpreted as follows:
  12796. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12797. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12798. * b'8:31 - reserved0: Reserved for future use
  12799. *
  12800. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12801. * this flow is associated. It can be VDEV, peer,
  12802. * or tid (AC). Based on enum htt_flow_type.
  12803. *
  12804. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12805. * object. For flow_type vdev it is set to the
  12806. * vdevid, for peer it is peerid and for tid, it is
  12807. * tid_num.
  12808. *
  12809. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12810. * used in the host for this flow
  12811. * b'16:31 - reserved0: This field in reserved for the future.
  12812. *
  12813. */
  12814. PREPACK struct htt_flow_pool_unmap_t {
  12815. A_UINT32 msg_type:8,
  12816. reserved0:24;
  12817. A_UINT32 flow_type;
  12818. A_UINT32 flow_id;
  12819. A_UINT32 flow_pool_id:16,
  12820. reserved1:16;
  12821. } POSTPACK;
  12822. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12823. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12824. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12825. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12826. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12827. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12828. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12829. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12830. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12831. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12832. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12833. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12834. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12835. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12836. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12837. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12838. do { \
  12839. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12840. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12841. } while (0)
  12842. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12843. do { \
  12844. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12845. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12846. } while (0)
  12847. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12848. do { \
  12849. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12850. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12851. } while (0)
  12852. /**
  12853. * @brief target -> host SRING setup done message
  12854. *
  12855. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12856. *
  12857. * @details
  12858. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12859. * SRNG ring setup is done
  12860. *
  12861. * This message indicates whether the last setup operation is successful.
  12862. * It will be sent to host when host set respose_required bit in
  12863. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12864. * The message would appear as follows:
  12865. *
  12866. * |31 24|23 16|15 8|7 0|
  12867. * |--------------- +----------------+----------------+----------------|
  12868. * | setup_status | ring_id | pdev_id | msg_type |
  12869. * |-------------------------------------------------------------------|
  12870. *
  12871. * The message is interpreted as follows:
  12872. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12873. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12874. * b'8:15 - pdev_id:
  12875. * 0 (for rings at SOC/UMAC level),
  12876. * 1/2/3 mac id (for rings at LMAC level)
  12877. * b'16:23 - ring_id: Identify the ring which is set up
  12878. * More details can be got from enum htt_srng_ring_id
  12879. * b'24:31 - setup_status: Indicate status of setup operation
  12880. * Refer to htt_ring_setup_status
  12881. */
  12882. PREPACK struct htt_sring_setup_done_t {
  12883. A_UINT32 msg_type: 8,
  12884. pdev_id: 8,
  12885. ring_id: 8,
  12886. setup_status: 8;
  12887. } POSTPACK;
  12888. enum htt_ring_setup_status {
  12889. htt_ring_setup_status_ok = 0,
  12890. htt_ring_setup_status_error,
  12891. };
  12892. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12893. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12894. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12895. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12896. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12897. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12898. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12899. do { \
  12900. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12901. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12902. } while (0)
  12903. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12904. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12905. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12906. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12907. HTT_SRING_SETUP_DONE_RING_ID_S)
  12908. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12909. do { \
  12910. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12911. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12912. } while (0)
  12913. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12914. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12915. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12916. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12917. HTT_SRING_SETUP_DONE_STATUS_S)
  12918. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12919. do { \
  12920. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12921. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12922. } while (0)
  12923. /**
  12924. * @brief target -> flow map flow info
  12925. *
  12926. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12927. *
  12928. * @details
  12929. * HTT TX map flow entry with tqm flow pointer
  12930. * Sent from firmware to host to add tqm flow pointer in corresponding
  12931. * flow search entry. Flow metadata is replayed back to host as part of this
  12932. * struct to enable host to find the specific flow search entry
  12933. *
  12934. * The message would appear as follows:
  12935. *
  12936. * |31 28|27 18|17 14|13 8|7 0|
  12937. * |-------+------------------------------------------+----------------|
  12938. * | rsvd0 | fse_hsh_idx | msg_type |
  12939. * |-------------------------------------------------------------------|
  12940. * | rsvd1 | tid | peer_id |
  12941. * |-------------------------------------------------------------------|
  12942. * | tqm_flow_pntr_lo |
  12943. * |-------------------------------------------------------------------|
  12944. * | tqm_flow_pntr_hi |
  12945. * |-------------------------------------------------------------------|
  12946. * | fse_meta_data |
  12947. * |-------------------------------------------------------------------|
  12948. *
  12949. * The message is interpreted as follows:
  12950. *
  12951. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12952. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12953. *
  12954. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12955. * for this flow entry
  12956. *
  12957. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12958. *
  12959. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12960. *
  12961. * dword1 - b'14:17 - tid
  12962. *
  12963. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12964. *
  12965. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12966. *
  12967. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12968. *
  12969. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12970. * given by host
  12971. */
  12972. PREPACK struct htt_tx_map_flow_info {
  12973. A_UINT32
  12974. msg_type: 8,
  12975. fse_hsh_idx: 20,
  12976. rsvd0: 4;
  12977. A_UINT32
  12978. peer_id: 14,
  12979. tid: 4,
  12980. rsvd1: 14;
  12981. A_UINT32 tqm_flow_pntr_lo;
  12982. A_UINT32 tqm_flow_pntr_hi;
  12983. struct htt_tx_flow_metadata fse_meta_data;
  12984. } POSTPACK;
  12985. /* DWORD 0 */
  12986. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12987. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12988. /* DWORD 1 */
  12989. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12990. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12991. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12992. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12993. /* DWORD 0 */
  12994. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  12995. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  12996. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  12997. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  12998. do { \
  12999. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13000. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13001. } while (0)
  13002. /* DWORD 1 */
  13003. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13004. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13005. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13006. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13007. do { \
  13008. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13009. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13010. } while (0)
  13011. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13012. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13013. HTT_TX_MAP_FLOW_INFO_TID_S)
  13014. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13015. do { \
  13016. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13017. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13018. } while (0)
  13019. /*
  13020. * htt_dbg_ext_stats_status -
  13021. * present - The requested stats have been delivered in full.
  13022. * This indicates that either the stats information was contained
  13023. * in its entirety within this message, or else this message
  13024. * completes the delivery of the requested stats info that was
  13025. * partially delivered through earlier STATS_CONF messages.
  13026. * partial - The requested stats have been delivered in part.
  13027. * One or more subsequent STATS_CONF messages with the same
  13028. * cookie value will be sent to deliver the remainder of the
  13029. * information.
  13030. * error - The requested stats could not be delivered, for example due
  13031. * to a shortage of memory to construct a message holding the
  13032. * requested stats.
  13033. * invalid - The requested stat type is either not recognized, or the
  13034. * target is configured to not gather the stats type in question.
  13035. */
  13036. enum htt_dbg_ext_stats_status {
  13037. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13038. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13039. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13040. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13041. };
  13042. /**
  13043. * @brief target -> host ppdu stats upload
  13044. *
  13045. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13046. *
  13047. * @details
  13048. * The following field definitions describe the format of the HTT target
  13049. * to host ppdu stats indication message.
  13050. *
  13051. *
  13052. * |31 16|15 12|11 10|9 8|7 0 |
  13053. * |----------------------------------------------------------------------|
  13054. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13055. * |----------------------------------------------------------------------|
  13056. * | ppdu_id |
  13057. * |----------------------------------------------------------------------|
  13058. * | Timestamp in us |
  13059. * |----------------------------------------------------------------------|
  13060. * | reserved |
  13061. * |----------------------------------------------------------------------|
  13062. * | type-specific stats info |
  13063. * | (see htt_ppdu_stats.h) |
  13064. * |----------------------------------------------------------------------|
  13065. * Header fields:
  13066. * - MSG_TYPE
  13067. * Bits 7:0
  13068. * Purpose: Identifies this is a PPDU STATS indication
  13069. * message.
  13070. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13071. * - mac_id
  13072. * Bits 9:8
  13073. * Purpose: mac_id of this ppdu_id
  13074. * Value: 0-3
  13075. * - pdev_id
  13076. * Bits 11:10
  13077. * Purpose: pdev_id of this ppdu_id
  13078. * Value: 0-3
  13079. * 0 (for rings at SOC level),
  13080. * 1/2/3 PDEV -> 0/1/2
  13081. * - payload_size
  13082. * Bits 31:16
  13083. * Purpose: total tlv size
  13084. * Value: payload_size in bytes
  13085. */
  13086. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13087. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13088. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13089. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13090. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13091. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13092. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13093. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13094. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13095. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13096. do { \
  13097. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13098. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13099. } while (0)
  13100. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13101. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13102. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13103. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13104. do { \
  13105. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13106. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13107. } while (0)
  13108. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13109. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13110. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13111. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13112. do { \
  13113. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13114. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13115. } while (0)
  13116. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13117. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13118. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13119. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13120. do { \
  13121. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13122. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13123. } while (0)
  13124. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13125. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13126. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13127. /* htt_t2h_ppdu_stats_ind_hdr_t
  13128. * This struct contains the fields within the header of the
  13129. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13130. * stats info.
  13131. * This struct assumes little-endian layout, and thus is only
  13132. * suitable for use within processors known to be little-endian
  13133. * (such as the target).
  13134. * In contrast, the above macros provide endian-portable methods
  13135. * to get and set the bitfields within this PPDU_STATS_IND header.
  13136. */
  13137. typedef struct {
  13138. A_UINT32 msg_type: 8, /* bits 7:0 */
  13139. mac_id: 2, /* bits 9:8 */
  13140. pdev_id: 2, /* bits 11:10 */
  13141. reserved1: 4, /* bits 15:12 */
  13142. payload_size: 16; /* bits 31:16 */
  13143. A_UINT32 ppdu_id;
  13144. A_UINT32 timestamp_us;
  13145. A_UINT32 reserved2;
  13146. } htt_t2h_ppdu_stats_ind_hdr_t;
  13147. /**
  13148. * @brief target -> host extended statistics upload
  13149. *
  13150. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13151. *
  13152. * @details
  13153. * The following field definitions describe the format of the HTT target
  13154. * to host stats upload confirmation message.
  13155. * The message contains a cookie echoed from the HTT host->target stats
  13156. * upload request, which identifies which request the confirmation is
  13157. * for, and a single stats can span over multiple HTT stats indication
  13158. * due to the HTT message size limitation so every HTT ext stats indication
  13159. * will have tag-length-value stats information elements.
  13160. * The tag-length header for each HTT stats IND message also includes a
  13161. * status field, to indicate whether the request for the stat type in
  13162. * question was fully met, partially met, unable to be met, or invalid
  13163. * (if the stat type in question is disabled in the target).
  13164. * A Done bit 1's indicate the end of the of stats info elements.
  13165. *
  13166. *
  13167. * |31 16|15 12|11|10 8|7 5|4 0|
  13168. * |--------------------------------------------------------------|
  13169. * | reserved | msg type |
  13170. * |--------------------------------------------------------------|
  13171. * | cookie LSBs |
  13172. * |--------------------------------------------------------------|
  13173. * | cookie MSBs |
  13174. * |--------------------------------------------------------------|
  13175. * | stats entry length | rsvd | D| S | stat type |
  13176. * |--------------------------------------------------------------|
  13177. * | type-specific stats info |
  13178. * | (see htt_stats.h) |
  13179. * |--------------------------------------------------------------|
  13180. * Header fields:
  13181. * - MSG_TYPE
  13182. * Bits 7:0
  13183. * Purpose: Identifies this is a extended statistics upload confirmation
  13184. * message.
  13185. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13186. * - COOKIE_LSBS
  13187. * Bits 31:0
  13188. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13189. * message with its preceding host->target stats request message.
  13190. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13191. * - COOKIE_MSBS
  13192. * Bits 31:0
  13193. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13194. * message with its preceding host->target stats request message.
  13195. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13196. *
  13197. * Stats Information Element tag-length header fields:
  13198. * - STAT_TYPE
  13199. * Bits 7:0
  13200. * Purpose: identifies the type of statistics info held in the
  13201. * following information element
  13202. * Value: htt_dbg_ext_stats_type
  13203. * - STATUS
  13204. * Bits 10:8
  13205. * Purpose: indicate whether the requested stats are present
  13206. * Value: htt_dbg_ext_stats_status
  13207. * - DONE
  13208. * Bits 11
  13209. * Purpose:
  13210. * Indicates the completion of the stats entry, this will be the last
  13211. * stats conf HTT segment for the requested stats type.
  13212. * Value:
  13213. * 0 -> the stats retrieval is ongoing
  13214. * 1 -> the stats retrieval is complete
  13215. * - LENGTH
  13216. * Bits 31:16
  13217. * Purpose: indicate the stats information size
  13218. * Value: This field specifies the number of bytes of stats information
  13219. * that follows the element tag-length header.
  13220. * It is expected but not required that this length is a multiple of
  13221. * 4 bytes.
  13222. */
  13223. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13224. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13225. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13226. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13227. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13228. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13229. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13230. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13231. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13232. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13233. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13234. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13235. do { \
  13236. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13237. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13238. } while (0)
  13239. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13240. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13241. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13242. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13243. do { \
  13244. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13245. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13246. } while (0)
  13247. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13248. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13249. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13250. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13251. do { \
  13252. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13253. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13254. } while (0)
  13255. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13256. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13257. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13258. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13259. do { \
  13260. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13261. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13262. } while (0)
  13263. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13264. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13265. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13266. typedef enum {
  13267. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13268. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13269. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13270. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13271. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13272. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13273. /* Reserved from 128 - 255 for target internal use.*/
  13274. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13275. } HTT_PEER_TYPE;
  13276. /** macro to convert MAC address from char array to HTT word format */
  13277. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13278. (phtt_mac_addr)->mac_addr31to0 = \
  13279. (((c_macaddr)[0] << 0) | \
  13280. ((c_macaddr)[1] << 8) | \
  13281. ((c_macaddr)[2] << 16) | \
  13282. ((c_macaddr)[3] << 24)); \
  13283. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13284. } while (0)
  13285. /**
  13286. * @brief target -> host monitor mac header indication message
  13287. *
  13288. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13289. *
  13290. * @details
  13291. * The following diagram shows the format of the monitor mac header message
  13292. * sent from the target to the host.
  13293. * This message is primarily sent when promiscuous rx mode is enabled.
  13294. * One message is sent per rx PPDU.
  13295. *
  13296. * |31 24|23 16|15 8|7 0|
  13297. * |-------------------------------------------------------------|
  13298. * | peer_id | reserved0 | msg_type |
  13299. * |-------------------------------------------------------------|
  13300. * | reserved1 | num_mpdu |
  13301. * |-------------------------------------------------------------|
  13302. * | struct hw_rx_desc |
  13303. * | (see wal_rx_desc.h) |
  13304. * |-------------------------------------------------------------|
  13305. * | struct ieee80211_frame_addr4 |
  13306. * | (see ieee80211_defs.h) |
  13307. * |-------------------------------------------------------------|
  13308. * | struct ieee80211_frame_addr4 |
  13309. * | (see ieee80211_defs.h) |
  13310. * |-------------------------------------------------------------|
  13311. * | ...... |
  13312. * |-------------------------------------------------------------|
  13313. *
  13314. * Header fields:
  13315. * - msg_type
  13316. * Bits 7:0
  13317. * Purpose: Identifies this is a monitor mac header indication message.
  13318. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13319. * - peer_id
  13320. * Bits 31:16
  13321. * Purpose: Software peer id given by host during association,
  13322. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13323. * for rx PPDUs received from unassociated peers.
  13324. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13325. * - num_mpdu
  13326. * Bits 15:0
  13327. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13328. * delivered within the message.
  13329. * Value: 1 to 32
  13330. * num_mpdu is limited to a maximum value of 32, due to buffer
  13331. * size limits. For PPDUs with more than 32 MPDUs, only the
  13332. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13333. * the PPDU will be provided.
  13334. */
  13335. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13336. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13337. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13338. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13339. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13340. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13341. do { \
  13342. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13343. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13344. } while (0)
  13345. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13346. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13347. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13348. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13349. do { \
  13350. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13351. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13352. } while (0)
  13353. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13354. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13355. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13356. /**
  13357. * @brief target -> host flow pool resize Message
  13358. *
  13359. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13360. *
  13361. * @details
  13362. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13363. * the flow pool associated with the specified ID is resized
  13364. *
  13365. * The message would appear as follows:
  13366. *
  13367. * |31 16|15 8|7 0|
  13368. * |---------------------------------+----------------+----------------|
  13369. * | reserved0 | Msg type |
  13370. * |-------------------------------------------------------------------|
  13371. * | flow pool new size | flow pool ID |
  13372. * |-------------------------------------------------------------------|
  13373. *
  13374. * The message is interpreted as follows:
  13375. * b'0:7 - msg_type: This will be set to 0x21
  13376. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13377. *
  13378. * b'0:15 - flow pool ID: Existing flow pool ID
  13379. *
  13380. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13381. *
  13382. */
  13383. PREPACK struct htt_flow_pool_resize_t {
  13384. A_UINT32 msg_type:8,
  13385. reserved0:24;
  13386. A_UINT32 flow_pool_id:16,
  13387. flow_pool_new_size:16;
  13388. } POSTPACK;
  13389. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13390. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13391. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13392. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13393. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13394. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13395. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13396. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13397. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13398. do { \
  13399. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13400. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13401. } while (0)
  13402. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13403. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13404. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13405. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13406. do { \
  13407. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13408. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13409. } while (0)
  13410. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13411. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13412. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13413. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13414. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13415. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13416. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13417. /*
  13418. * The read and write indices point to the data within the host buffer.
  13419. * Because the first 4 bytes of the host buffer is used for the read index and
  13420. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13421. * The read index and write index are the byte offsets from the base of the
  13422. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13423. * Refer the ASCII text picture below.
  13424. */
  13425. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13426. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13427. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13428. /*
  13429. ***************************************************************************
  13430. *
  13431. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13432. *
  13433. ***************************************************************************
  13434. *
  13435. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13436. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13437. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13438. * written into the Host memory region mentioned below.
  13439. *
  13440. * Read index is updated by the Host. At any point of time, the read index will
  13441. * indicate the index that will next be read by the Host. The read index is
  13442. * in units of bytes offset from the base of the meta-data buffer.
  13443. *
  13444. * Write index is updated by the FW. At any point of time, the write index will
  13445. * indicate from where the FW can start writing any new data. The write index is
  13446. * in units of bytes offset from the base of the meta-data buffer.
  13447. *
  13448. * If the Host is not fast enough in reading the CFR data, any new capture data
  13449. * would be dropped if there is no space left to write the new captures.
  13450. *
  13451. * The last 4 bytes of the memory region will have the magic pattern
  13452. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13453. * not overrun the host buffer.
  13454. *
  13455. * ,--------------------. read and write indices store the
  13456. * | | byte offset from the base of the
  13457. * | ,--------+--------. meta-data buffer to the next
  13458. * | | | | location within the data buffer
  13459. * | | v v that will be read / written
  13460. * ************************************************************************
  13461. * * Read * Write * * Magic *
  13462. * * index * index * CFR data1 ...... CFR data N * pattern *
  13463. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13464. * ************************************************************************
  13465. * |<---------- data buffer ---------->|
  13466. *
  13467. * |<----------------- meta-data buffer allocated in Host ----------------|
  13468. *
  13469. * Note:
  13470. * - Considering the 4 bytes needed to store the Read index (R) and the
  13471. * Write index (W), the initial value is as follows:
  13472. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13473. * - Buffer empty condition:
  13474. * R = W
  13475. *
  13476. * Regarding CFR data format:
  13477. * --------------------------
  13478. *
  13479. * Each CFR tone is stored in HW as 16-bits with the following format:
  13480. * {bits[15:12], bits[11:6], bits[5:0]} =
  13481. * {unsigned exponent (4 bits),
  13482. * signed mantissa_real (6 bits),
  13483. * signed mantissa_imag (6 bits)}
  13484. *
  13485. * CFR_real = mantissa_real * 2^(exponent-5)
  13486. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13487. *
  13488. *
  13489. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13490. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13491. *
  13492. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13493. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13494. * .
  13495. * .
  13496. * .
  13497. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13498. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13499. */
  13500. /* Bandwidth of peer CFR captures */
  13501. typedef enum {
  13502. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13503. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13504. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13505. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13506. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13507. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13508. } HTT_PEER_CFR_CAPTURE_BW;
  13509. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13510. * was captured
  13511. */
  13512. typedef enum {
  13513. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13514. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13515. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13516. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13517. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13518. } HTT_PEER_CFR_CAPTURE_MODE;
  13519. typedef enum {
  13520. /* This message type is currently used for the below purpose:
  13521. *
  13522. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13523. * wmi_peer_cfr_capture_cmd.
  13524. * If payload_present bit is set to 0 then the associated memory region
  13525. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13526. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13527. * message; the CFR dump will be present at the end of the message,
  13528. * after the chan_phy_mode.
  13529. */
  13530. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13531. /* Always keep this last */
  13532. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13533. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13534. /**
  13535. * @brief target -> host CFR dump completion indication message definition
  13536. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13537. *
  13538. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13539. *
  13540. * @details
  13541. * The following diagram shows the format of the Channel Frequency Response
  13542. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13543. * the channel capture of a peer is copied by Firmware into the Host memory
  13544. *
  13545. * **************************************************************************
  13546. *
  13547. * Message format when the CFR capture message type is
  13548. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13549. *
  13550. * **************************************************************************
  13551. *
  13552. * |31 16|15 |8|7 0|
  13553. * |----------------------------------------------------------------|
  13554. * header: | reserved |P| msg_type |
  13555. * word 0 | | | |
  13556. * |----------------------------------------------------------------|
  13557. * payload: | cfr_capture_msg_type |
  13558. * word 1 | |
  13559. * |----------------------------------------------------------------|
  13560. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13561. * word 2 | | | | | | | | |
  13562. * |----------------------------------------------------------------|
  13563. * | mac_addr31to0 |
  13564. * word 3 | |
  13565. * |----------------------------------------------------------------|
  13566. * | unused / reserved | mac_addr47to32 |
  13567. * word 4 | | |
  13568. * |----------------------------------------------------------------|
  13569. * | index |
  13570. * word 5 | |
  13571. * |----------------------------------------------------------------|
  13572. * | length |
  13573. * word 6 | |
  13574. * |----------------------------------------------------------------|
  13575. * | timestamp |
  13576. * word 7 | |
  13577. * |----------------------------------------------------------------|
  13578. * | counter |
  13579. * word 8 | |
  13580. * |----------------------------------------------------------------|
  13581. * | chan_mhz |
  13582. * word 9 | |
  13583. * |----------------------------------------------------------------|
  13584. * | band_center_freq1 |
  13585. * word 10 | |
  13586. * |----------------------------------------------------------------|
  13587. * | band_center_freq2 |
  13588. * word 11 | |
  13589. * |----------------------------------------------------------------|
  13590. * | chan_phy_mode |
  13591. * word 12 | |
  13592. * |----------------------------------------------------------------|
  13593. * where,
  13594. * P - payload present bit (payload_present explained below)
  13595. * req_id - memory request id (mem_req_id explained below)
  13596. * S - status field (status explained below)
  13597. * capbw - capture bandwidth (capture_bw explained below)
  13598. * mode - mode of capture (mode explained below)
  13599. * sts - space time streams (sts_count explained below)
  13600. * chbw - channel bandwidth (channel_bw explained below)
  13601. * captype - capture type (cap_type explained below)
  13602. *
  13603. * The following field definitions describe the format of the CFR dump
  13604. * completion indication sent from the target to the host
  13605. *
  13606. * Header fields:
  13607. *
  13608. * Word 0
  13609. * - msg_type
  13610. * Bits 7:0
  13611. * Purpose: Identifies this as CFR TX completion indication
  13612. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13613. * - payload_present
  13614. * Bit 8
  13615. * Purpose: Identifies how CFR data is sent to host
  13616. * Value: 0 - If CFR Payload is written to host memory
  13617. * 1 - If CFR Payload is sent as part of HTT message
  13618. * (This is the requirement for SDIO/USB where it is
  13619. * not possible to write CFR data to host memory)
  13620. * - reserved
  13621. * Bits 31:9
  13622. * Purpose: Reserved
  13623. * Value: 0
  13624. *
  13625. * Payload fields:
  13626. *
  13627. * Word 1
  13628. * - cfr_capture_msg_type
  13629. * Bits 31:0
  13630. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13631. * to specify the format used for the remainder of the message
  13632. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13633. * (currently only MSG_TYPE_1 is defined)
  13634. *
  13635. * Word 2
  13636. * - mem_req_id
  13637. * Bits 6:0
  13638. * Purpose: Contain the mem request id of the region where the CFR capture
  13639. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13640. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13641. this value is invalid)
  13642. * - status
  13643. * Bit 7
  13644. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13645. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13646. * - capture_bw
  13647. * Bits 10:8
  13648. * Purpose: Carry the bandwidth of the CFR capture
  13649. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13650. * - mode
  13651. * Bits 13:11
  13652. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13653. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13654. * - sts_count
  13655. * Bits 16:14
  13656. * Purpose: Carry the number of space time streams
  13657. * Value: Number of space time streams
  13658. * - channel_bw
  13659. * Bits 19:17
  13660. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13661. * measurement
  13662. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13663. * - cap_type
  13664. * Bits 23:20
  13665. * Purpose: Carry the type of the capture
  13666. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13667. * - vdev_id
  13668. * Bits 31:24
  13669. * Purpose: Carry the virtual device id
  13670. * Value: vdev ID
  13671. *
  13672. * Word 3
  13673. * - mac_addr31to0
  13674. * Bits 31:0
  13675. * Purpose: Contain the bits 31:0 of the peer MAC address
  13676. * Value: Bits 31:0 of the peer MAC address
  13677. *
  13678. * Word 4
  13679. * - mac_addr47to32
  13680. * Bits 15:0
  13681. * Purpose: Contain the bits 47:32 of the peer MAC address
  13682. * Value: Bits 47:32 of the peer MAC address
  13683. *
  13684. * Word 5
  13685. * - index
  13686. * Bits 31:0
  13687. * Purpose: Contain the index at which this CFR dump was written in the Host
  13688. * allocated memory. This index is the number of bytes from the base address.
  13689. * Value: Index position
  13690. *
  13691. * Word 6
  13692. * - length
  13693. * Bits 31:0
  13694. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13695. * Value: Length of the CFR capture of the peer
  13696. *
  13697. * Word 7
  13698. * - timestamp
  13699. * Bits 31:0
  13700. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13701. * clock used for this timestamp is private to the target and not visible to
  13702. * the host i.e., Host can interpret only the relative timestamp deltas from
  13703. * one message to the next, but can't interpret the absolute timestamp from a
  13704. * single message.
  13705. * Value: Timestamp in microseconds
  13706. *
  13707. * Word 8
  13708. * - counter
  13709. * Bits 31:0
  13710. * Purpose: Carry the count of the current CFR capture from FW. This is
  13711. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13712. * in host memory)
  13713. * Value: Count of the current CFR capture
  13714. *
  13715. * Word 9
  13716. * - chan_mhz
  13717. * Bits 31:0
  13718. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13719. * Value: Primary 20 channel frequency
  13720. *
  13721. * Word 10
  13722. * - band_center_freq1
  13723. * Bits 31:0
  13724. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13725. * Value: Center frequency 1 in MHz
  13726. *
  13727. * Word 11
  13728. * - band_center_freq2
  13729. * Bits 31:0
  13730. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13731. * the VDEV
  13732. * 80plus80 mode
  13733. * Value: Center frequency 2 in MHz
  13734. *
  13735. * Word 12
  13736. * - chan_phy_mode
  13737. * Bits 31:0
  13738. * Purpose: Carry the phy mode of the channel, of the VDEV
  13739. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13740. */
  13741. PREPACK struct htt_cfr_dump_ind_type_1 {
  13742. A_UINT32 mem_req_id:7,
  13743. status:1,
  13744. capture_bw:3,
  13745. mode:3,
  13746. sts_count:3,
  13747. channel_bw:3,
  13748. cap_type:4,
  13749. vdev_id:8;
  13750. htt_mac_addr addr;
  13751. A_UINT32 index;
  13752. A_UINT32 length;
  13753. A_UINT32 timestamp;
  13754. A_UINT32 counter;
  13755. struct htt_chan_change_msg chan;
  13756. } POSTPACK;
  13757. PREPACK struct htt_cfr_dump_compl_ind {
  13758. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13759. union {
  13760. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13761. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13762. /* If there is a need to change the memory layout and its associated
  13763. * HTT indication format, a new CFR capture message type can be
  13764. * introduced and added into this union.
  13765. */
  13766. };
  13767. } POSTPACK;
  13768. /*
  13769. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13770. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13771. */
  13772. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13773. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13774. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13775. do { \
  13776. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13777. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13778. } while(0)
  13779. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13780. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13781. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13782. /*
  13783. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13784. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13785. */
  13786. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13787. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13788. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13789. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13790. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13791. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13792. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13793. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13794. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13795. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13796. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13797. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13798. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13799. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13800. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13803. do { \
  13804. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13805. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13806. } while (0)
  13807. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13808. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13809. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13810. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13811. do { \
  13812. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13813. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13814. } while (0)
  13815. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13816. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13817. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13818. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13819. do { \
  13820. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13821. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13822. } while (0)
  13823. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13824. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13825. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13826. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13827. do { \
  13828. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13829. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13830. } while (0)
  13831. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13832. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13833. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13834. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13835. do { \
  13836. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13837. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13838. } while (0)
  13839. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13840. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13841. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13842. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13843. do { \
  13844. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13845. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13846. } while (0)
  13847. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13848. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13849. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13850. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13851. do { \
  13852. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13853. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13854. } while (0)
  13855. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13856. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13857. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13858. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13859. do { \
  13860. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13861. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13862. } while (0)
  13863. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13864. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13865. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13866. /**
  13867. * @brief target -> host peer (PPDU) stats message
  13868. *
  13869. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13870. *
  13871. * @details
  13872. * This message is generated by FW when FW is sending stats to host
  13873. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13874. * This message is sent autonomously by the target rather than upon request
  13875. * by the host.
  13876. * The following field definitions describe the format of the HTT target
  13877. * to host peer stats indication message.
  13878. *
  13879. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13880. * or more PPDU stats records.
  13881. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13882. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13883. * then the message would start with the
  13884. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13885. * below.
  13886. *
  13887. * |31 16|15|14|13 11|10 9|8|7 0|
  13888. * |-------------------------------------------------------------|
  13889. * | reserved |MSG_TYPE |
  13890. * |-------------------------------------------------------------|
  13891. * rec 0 | TLV header |
  13892. * rec 0 |-------------------------------------------------------------|
  13893. * rec 0 | ppdu successful bytes |
  13894. * rec 0 |-------------------------------------------------------------|
  13895. * rec 0 | ppdu retry bytes |
  13896. * rec 0 |-------------------------------------------------------------|
  13897. * rec 0 | ppdu failed bytes |
  13898. * rec 0 |-------------------------------------------------------------|
  13899. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13900. * rec 0 |-------------------------------------------------------------|
  13901. * rec 0 | retried MSDUs | successful MSDUs |
  13902. * rec 0 |-------------------------------------------------------------|
  13903. * rec 0 | TX duration | failed MSDUs |
  13904. * rec 0 |-------------------------------------------------------------|
  13905. * ...
  13906. * |-------------------------------------------------------------|
  13907. * rec N | TLV header |
  13908. * rec N |-------------------------------------------------------------|
  13909. * rec N | ppdu successful bytes |
  13910. * rec N |-------------------------------------------------------------|
  13911. * rec N | ppdu retry bytes |
  13912. * rec N |-------------------------------------------------------------|
  13913. * rec N | ppdu failed bytes |
  13914. * rec N |-------------------------------------------------------------|
  13915. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13916. * rec N |-------------------------------------------------------------|
  13917. * rec N | retried MSDUs | successful MSDUs |
  13918. * rec N |-------------------------------------------------------------|
  13919. * rec N | TX duration | failed MSDUs |
  13920. * rec N |-------------------------------------------------------------|
  13921. *
  13922. * where:
  13923. * A = is A-MPDU flag
  13924. * BA = block-ack failure flags
  13925. * BW = bandwidth spec
  13926. * SG = SGI enabled spec
  13927. * S = skipped rate ctrl
  13928. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13929. *
  13930. * Header
  13931. * ------
  13932. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13933. * dword0 - b'8:31 - reserved : Reserved for future use
  13934. *
  13935. * payload include below peer_stats information
  13936. * --------------------------------------------
  13937. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13938. * @tx_success_bytes : total successful bytes in the PPDU.
  13939. * @tx_retry_bytes : total retried bytes in the PPDU.
  13940. * @tx_failed_bytes : total failed bytes in the PPDU.
  13941. * @tx_ratecode : rate code used for the PPDU.
  13942. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13943. * @ba_ack_failed : BA/ACK failed for this PPDU
  13944. * b00 -> BA received
  13945. * b01 -> BA failed once
  13946. * b10 -> BA failed twice, when HW retry is enabled.
  13947. * @bw : BW
  13948. * b00 -> 20 MHz
  13949. * b01 -> 40 MHz
  13950. * b10 -> 80 MHz
  13951. * b11 -> 160 MHz (or 80+80)
  13952. * @sg : SGI enabled
  13953. * @s : skipped ratectrl
  13954. * @peer_id : peer id
  13955. * @tx_success_msdus : successful MSDUs
  13956. * @tx_retry_msdus : retried MSDUs
  13957. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13958. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13959. */
  13960. /**
  13961. * @brief target -> host backpressure event
  13962. *
  13963. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13964. *
  13965. * @details
  13966. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13967. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13968. * This message will only be sent if the backpressure condition has existed
  13969. * continuously for an initial period (100 ms).
  13970. * Repeat messages with updated information will be sent after each
  13971. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13972. * This message indicates the ring id along with current head and tail index
  13973. * locations (i.e. write and read indices).
  13974. * The backpressure time indicates the time in ms for which continous
  13975. * backpressure has been observed in the ring.
  13976. *
  13977. * The message format is as follows:
  13978. *
  13979. * |31 24|23 16|15 8|7 0|
  13980. * |----------------+----------------+----------------+----------------|
  13981. * | ring_id | ring_type | pdev_id | msg_type |
  13982. * |-------------------------------------------------------------------|
  13983. * | tail_idx | head_idx |
  13984. * |-------------------------------------------------------------------|
  13985. * | backpressure_time_ms |
  13986. * |-------------------------------------------------------------------|
  13987. *
  13988. * The message is interpreted as follows:
  13989. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13990. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13991. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13992. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13993. the msg is for LMAC ring.
  13994. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  13995. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  13996. * htt_backpressure_lmac_ring_id. This represents
  13997. * the ring id for which continous backpressure is seen
  13998. *
  13999. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14000. * the ring indicated by the ring_id
  14001. *
  14002. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14003. * the ring indicated by the ring id
  14004. *
  14005. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14006. * backpressure has been seen in the ring
  14007. * indicated by the ring_id.
  14008. * Units = milliseconds
  14009. */
  14010. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14011. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14012. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14013. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14014. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14015. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14016. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14017. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14018. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14019. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14020. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14021. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14022. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14023. do { \
  14024. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14025. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14026. } while (0)
  14027. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14028. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14029. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14030. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14031. do { \
  14032. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14033. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14034. } while (0)
  14035. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14036. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14037. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14038. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14039. do { \
  14040. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14041. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14042. } while (0)
  14043. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14044. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14045. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14046. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14047. do { \
  14048. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14049. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14050. } while (0)
  14051. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14052. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14053. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14054. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14055. do { \
  14056. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14057. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14058. } while (0)
  14059. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14060. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14061. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14062. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14063. do { \
  14064. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14065. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14066. } while (0)
  14067. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14068. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14069. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14070. enum htt_backpressure_ring_type {
  14071. HTT_SW_RING_TYPE_UMAC,
  14072. HTT_SW_RING_TYPE_LMAC,
  14073. HTT_SW_RING_TYPE_MAX,
  14074. };
  14075. /* Ring id for which the message is sent to host */
  14076. enum htt_backpressure_umac_ringid {
  14077. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14078. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14079. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14080. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14081. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14082. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14083. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14084. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14085. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14086. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14087. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14088. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14089. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14090. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14091. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14092. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14093. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14094. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14095. HTT_SW_UMAC_RING_IDX_MAX,
  14096. };
  14097. enum htt_backpressure_lmac_ringid {
  14098. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14099. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14100. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14101. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14102. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14103. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14104. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14105. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14106. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14107. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14108. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14109. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14110. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14111. HTT_SW_LMAC_RING_IDX_MAX,
  14112. };
  14113. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14114. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14115. pdev_id: 8,
  14116. ring_type: 8, /* htt_backpressure_ring_type */
  14117. /*
  14118. * ring_id holds an enum value from either
  14119. * htt_backpressure_umac_ringid or
  14120. * htt_backpressure_lmac_ringid, based on
  14121. * the ring_type setting.
  14122. */
  14123. ring_id: 8;
  14124. A_UINT16 head_idx;
  14125. A_UINT16 tail_idx;
  14126. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14127. } POSTPACK;
  14128. /*
  14129. * Defines two 32 bit words that can be used by the target to indicate a per
  14130. * user RU allocation and rate information.
  14131. *
  14132. * This information is currently provided in the "sw_response_reference_ptr"
  14133. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14134. * "rx_ppdu_end_user_stats" TLV.
  14135. *
  14136. * VALID:
  14137. * The consumer of these words must explicitly check the valid bit,
  14138. * and only attempt interpretation of any of the remaining fields if
  14139. * the valid bit is set to 1.
  14140. *
  14141. * VERSION:
  14142. * The consumer of these words must also explicitly check the version bit,
  14143. * and only use the V0 definition if the VERSION field is set to 0.
  14144. *
  14145. * Version 1 is currently undefined, with the exception of the VALID and
  14146. * VERSION fields.
  14147. *
  14148. * Version 0:
  14149. *
  14150. * The fields below are duplicated per BW.
  14151. *
  14152. * The consumer must determine which BW field to use, based on the UL OFDMA
  14153. * PPDU BW indicated by HW.
  14154. *
  14155. * RU_START: RU26 start index for the user.
  14156. * Note that this is always using the RU26 index, regardless
  14157. * of the actual RU assigned to the user
  14158. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14159. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14160. *
  14161. * For example, 20MHz (the value in the top row is RU_START)
  14162. *
  14163. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14164. * RU Size 1 (52): | | | | | |
  14165. * RU Size 2 (106): | | | |
  14166. * RU Size 3 (242): | |
  14167. *
  14168. * RU_SIZE: Indicates the RU size, as defined by enum
  14169. * htt_ul_ofdma_user_info_ru_size.
  14170. *
  14171. * LDPC: LDPC enabled (if 0, BCC is used)
  14172. *
  14173. * DCM: DCM enabled
  14174. *
  14175. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14176. * |---------------------------------+--------------------------------|
  14177. * |Ver|Valid| FW internal |
  14178. * |---------------------------------+--------------------------------|
  14179. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14180. * |---------------------------------+--------------------------------|
  14181. */
  14182. enum htt_ul_ofdma_user_info_ru_size {
  14183. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14184. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14185. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14186. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14187. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14188. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14189. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14190. };
  14191. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14192. struct htt_ul_ofdma_user_info_v0 {
  14193. A_UINT32 word0;
  14194. A_UINT32 word1;
  14195. };
  14196. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14197. A_UINT32 w0_fw_rsvd:30; \
  14198. A_UINT32 w0_valid:1; \
  14199. A_UINT32 w0_version:1;
  14200. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14201. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14202. };
  14203. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14204. A_UINT32 w1_nss:3; \
  14205. A_UINT32 w1_mcs:4; \
  14206. A_UINT32 w1_ldpc:1; \
  14207. A_UINT32 w1_dcm:1; \
  14208. A_UINT32 w1_ru_start:7; \
  14209. A_UINT32 w1_ru_size:3; \
  14210. A_UINT32 w1_trig_type:4; \
  14211. A_UINT32 w1_unused:9;
  14212. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14213. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14214. };
  14215. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14216. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14217. union {
  14218. A_UINT32 word0;
  14219. struct {
  14220. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14221. };
  14222. };
  14223. union {
  14224. A_UINT32 word1;
  14225. struct {
  14226. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14227. };
  14228. };
  14229. } POSTPACK;
  14230. enum HTT_UL_OFDMA_TRIG_TYPE {
  14231. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14232. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14233. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14234. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14235. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14236. };
  14237. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14238. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14239. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14240. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14241. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14242. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14243. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14244. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14245. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14246. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14247. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14248. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14249. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14250. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14251. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14260. /*--- word 0 ---*/
  14261. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14262. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14263. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14264. do { \
  14265. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14266. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14267. } while (0)
  14268. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14269. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14270. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14271. do { \
  14272. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14273. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14274. } while (0)
  14275. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14276. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14277. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14278. do { \
  14279. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14280. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14281. } while (0)
  14282. /*--- word 1 ---*/
  14283. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14284. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14285. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14286. do { \
  14287. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14288. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14289. } while (0)
  14290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14291. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14292. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14293. do { \
  14294. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14295. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14296. } while (0)
  14297. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14298. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14299. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14300. do { \
  14301. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14302. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14303. } while (0)
  14304. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14305. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14306. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14307. do { \
  14308. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14309. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14310. } while (0)
  14311. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14312. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14313. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14314. do { \
  14315. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14316. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14317. } while (0)
  14318. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14319. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14320. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14321. do { \
  14322. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14323. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14324. } while (0)
  14325. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14326. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14327. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14328. do { \
  14329. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14330. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14331. } while (0)
  14332. /**
  14333. * @brief target -> host channel calibration data message
  14334. *
  14335. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14336. *
  14337. * @brief host -> target channel calibration data message
  14338. *
  14339. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14340. *
  14341. * @details
  14342. * The following field definitions describe the format of the channel
  14343. * calibration data message sent from the target to the host when
  14344. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14345. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14346. * The message is defined as htt_chan_caldata_msg followed by a variable
  14347. * number of 32-bit character values.
  14348. *
  14349. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14350. * |------------------------------------------------------------------|
  14351. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14352. * |------------------------------------------------------------------|
  14353. * | payload size | mhz |
  14354. * |------------------------------------------------------------------|
  14355. * | center frequency 2 | center frequency 1 |
  14356. * |------------------------------------------------------------------|
  14357. * | check sum |
  14358. * |------------------------------------------------------------------|
  14359. * | payload |
  14360. * |------------------------------------------------------------------|
  14361. * message info field:
  14362. * - MSG_TYPE
  14363. * Bits 7:0
  14364. * Purpose: identifies this as a channel calibration data message
  14365. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14366. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14367. * - SUB_TYPE
  14368. * Bits 11:8
  14369. * Purpose: T2H: indicates whether target is providing chan cal data
  14370. * to the host to store, or requesting that the host
  14371. * download previously-stored data.
  14372. * H2T: indicates whether the host is providing the requested
  14373. * channel cal data, or if it is rejecting the data
  14374. * request because it does not have the requested data.
  14375. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14376. * - CHKSUM_VALID
  14377. * Bit 12
  14378. * Purpose: indicates if the checksum field is valid
  14379. * value:
  14380. * - FRAG
  14381. * Bit 19:16
  14382. * Purpose: indicates the fragment index for message
  14383. * value: 0 for first fragment, 1 for second fragment, ...
  14384. * - APPEND
  14385. * Bit 20
  14386. * Purpose: indicates if this is the last fragment
  14387. * value: 0 = final fragment, 1 = more fragments will be appended
  14388. *
  14389. * channel and payload size field
  14390. * - MHZ
  14391. * Bits 15:0
  14392. * Purpose: indicates the channel primary frequency
  14393. * Value:
  14394. * - PAYLOAD_SIZE
  14395. * Bits 31:16
  14396. * Purpose: indicates the bytes of calibration data in payload
  14397. * Value:
  14398. *
  14399. * center frequency field
  14400. * - CENTER FREQUENCY 1
  14401. * Bits 15:0
  14402. * Purpose: indicates the channel center frequency
  14403. * Value: channel center frequency, in MHz units
  14404. * - CENTER FREQUENCY 2
  14405. * Bits 31:16
  14406. * Purpose: indicates the secondary channel center frequency,
  14407. * only for 11acvht 80plus80 mode
  14408. * Value: secondary channel center frequeny, in MHz units, if applicable
  14409. *
  14410. * checksum field
  14411. * - CHECK_SUM
  14412. * Bits 31:0
  14413. * Purpose: check the payload data, it is just for this fragment.
  14414. * This is intended for the target to check that the channel
  14415. * calibration data returned by the host is the unmodified data
  14416. * that was previously provided to the host by the target.
  14417. * value: checksum of fragment payload
  14418. */
  14419. PREPACK struct htt_chan_caldata_msg {
  14420. /* DWORD 0: message info */
  14421. A_UINT32
  14422. msg_type: 8,
  14423. sub_type: 4 ,
  14424. chksum_valid: 1, /** 1:valid, 0:invalid */
  14425. reserved1: 3,
  14426. frag_idx: 4, /** fragment index for calibration data */
  14427. appending: 1, /** 0: no fragment appending,
  14428. * 1: extra fragment appending */
  14429. reserved2: 11;
  14430. /* DWORD 1: channel and payload size */
  14431. A_UINT32
  14432. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14433. payload_size: 16; /** unit: bytes */
  14434. /* DWORD 2: center frequency */
  14435. A_UINT32
  14436. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14437. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14438. * valid only for 11acvht 80plus80 mode */
  14439. /* DWORD 3: check sum */
  14440. A_UINT32 chksum;
  14441. /* variable length for calibration data */
  14442. A_UINT32 payload[1/* or more */];
  14443. } POSTPACK;
  14444. /* T2H SUBTYPE */
  14445. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14446. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14447. /* H2T SUBTYPE */
  14448. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14449. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14450. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14451. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14452. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14453. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14454. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14455. do { \
  14456. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14457. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14458. } while (0)
  14459. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14460. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14461. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14462. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14463. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14464. do { \
  14465. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14466. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14467. } while (0)
  14468. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14469. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14470. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14471. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14472. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14473. do { \
  14474. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14475. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14476. } while (0)
  14477. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14478. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14479. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14480. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14481. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14482. do { \
  14483. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14484. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14485. } while (0)
  14486. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14487. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14488. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14489. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14490. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14491. do { \
  14492. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14493. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14494. } while (0)
  14495. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14496. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14497. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14498. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14499. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14500. do { \
  14501. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14502. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14503. } while (0)
  14504. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14505. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14506. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14507. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14508. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14509. do { \
  14510. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14511. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14512. } while (0)
  14513. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14514. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14515. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14516. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14517. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14518. do { \
  14519. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14520. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14521. } while (0)
  14522. /**
  14523. * @brief target -> host FSE CMEM based send
  14524. *
  14525. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14526. *
  14527. * @details
  14528. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14529. * FSE placement in CMEM is enabled.
  14530. *
  14531. * This message sends the non-secure CMEM base address.
  14532. * It will be sent to host in response to message
  14533. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14534. * The message would appear as follows:
  14535. *
  14536. * |31 24|23 16|15 8|7 0|
  14537. * |----------------+----------------+----------------+----------------|
  14538. * | reserved | num_entries | msg_type |
  14539. * |----------------+----------------+----------------+----------------|
  14540. * | base_address_lo |
  14541. * |----------------+----------------+----------------+----------------|
  14542. * | base_address_hi |
  14543. * |-------------------------------------------------------------------|
  14544. *
  14545. * The message is interpreted as follows:
  14546. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14547. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14548. * b'8:15 - number_entries: Indicated the number of entries
  14549. * programmed.
  14550. * b'16:31 - reserved.
  14551. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14552. * CMEM base address
  14553. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14554. * CMEM base address
  14555. */
  14556. PREPACK struct htt_cmem_base_send_t {
  14557. A_UINT32 msg_type: 8,
  14558. num_entries: 8,
  14559. reserved: 16;
  14560. A_UINT32 base_address_lo;
  14561. A_UINT32 base_address_hi;
  14562. } POSTPACK;
  14563. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14564. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14565. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14566. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14567. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14568. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14569. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14570. do { \
  14571. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14572. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14573. } while (0)
  14574. /**
  14575. * @brief - HTT PPDU ID format
  14576. *
  14577. * @details
  14578. * The following field definitions describe the format of the PPDU ID.
  14579. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14580. *
  14581. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14582. * +--------------------------------------------------------------------------
  14583. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14584. * +--------------------------------------------------------------------------
  14585. *
  14586. * sch id :Schedule command id
  14587. * Bits [11 : 0] : monotonically increasing counter to track the
  14588. * PPDU posted to a specific transmit queue.
  14589. *
  14590. * hwq_id: Hardware Queue ID.
  14591. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14592. *
  14593. * mac_id: MAC ID
  14594. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14595. *
  14596. * seq_idx: Sequence index.
  14597. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14598. * a particular TXOP.
  14599. *
  14600. * tqm_cmd: HWSCH/TQM flag.
  14601. * Bit [23] : Always set to 0.
  14602. *
  14603. * seq_cmd_type: Sequence command type.
  14604. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14605. * Refer to enum HTT_STATS_FTYPE for values.
  14606. */
  14607. PREPACK struct htt_ppdu_id {
  14608. A_UINT32
  14609. sch_id: 12,
  14610. hwq_id: 5,
  14611. mac_id: 2,
  14612. seq_idx: 2,
  14613. reserved1: 2,
  14614. tqm_cmd: 1,
  14615. seq_cmd_type: 6,
  14616. reserved2: 2;
  14617. } POSTPACK;
  14618. #define HTT_PPDU_ID_SCH_ID_S 0
  14619. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14620. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14621. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14622. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14623. do { \
  14624. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14625. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14626. } while (0)
  14627. #define HTT_PPDU_ID_HWQ_ID_S 12
  14628. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14629. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14630. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14631. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14632. do { \
  14633. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14634. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14635. } while (0)
  14636. #define HTT_PPDU_ID_MAC_ID_S 17
  14637. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14638. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14639. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14640. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14641. do { \
  14642. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14643. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14644. } while (0)
  14645. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14646. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14647. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14648. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14649. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14650. do { \
  14651. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14652. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14653. } while (0)
  14654. #define HTT_PPDU_ID_TQM_CMD_S 23
  14655. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14656. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14657. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14658. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14659. do { \
  14660. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14661. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14662. } while (0)
  14663. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14664. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14665. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14666. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14667. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14668. do { \
  14669. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14670. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14671. } while (0)
  14672. /**
  14673. * @brief target -> RX PEER METADATA V0 format
  14674. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14675. * message from target, and will confirm to the target which peer metadata
  14676. * version to use in the wmi_init message.
  14677. *
  14678. * The following diagram shows the format of the RX PEER METADATA.
  14679. *
  14680. * |31 24|23 16|15 8|7 0|
  14681. * |-----------------------------------------------------------------------|
  14682. * | Reserved | VDEV ID | PEER ID |
  14683. * |-----------------------------------------------------------------------|
  14684. */
  14685. PREPACK struct htt_rx_peer_metadata_v0 {
  14686. A_UINT32
  14687. peer_id: 16,
  14688. vdev_id: 8,
  14689. reserved1: 8;
  14690. } POSTPACK;
  14691. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14692. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14693. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14694. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14695. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14696. do { \
  14697. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14698. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14699. } while (0)
  14700. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14701. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14702. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14703. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14704. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14705. do { \
  14706. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14707. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14708. } while (0)
  14709. /**
  14710. * @brief target -> RX PEER METADATA V1 format
  14711. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14712. * message from target, and will confirm to the target which peer metadata
  14713. * version to use in the wmi_init message.
  14714. *
  14715. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14716. *
  14717. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14718. * |-----------------------------------------------------------------------|
  14719. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14720. * |-----------------------------------------------------------------------|
  14721. */
  14722. PREPACK struct htt_rx_peer_metadata_v1 {
  14723. A_UINT32
  14724. peer_id: 13,
  14725. ml_peer_valid: 1,
  14726. reserved1: 2,
  14727. vdev_id: 8,
  14728. lmac_id: 2,
  14729. chip_id: 3,
  14730. reserved2: 3;
  14731. } POSTPACK;
  14732. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14733. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14734. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14735. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14736. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14737. do { \
  14738. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14739. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14740. } while (0)
  14741. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14742. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14743. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14744. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14745. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14746. do { \
  14747. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14748. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14749. } while (0)
  14750. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14751. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14752. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14753. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14754. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14755. do { \
  14756. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14757. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14758. } while (0)
  14759. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14760. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14761. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14762. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14763. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14764. do { \
  14765. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14766. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14767. } while (0)
  14768. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14769. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14770. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14771. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14772. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14773. do { \
  14774. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14775. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14776. } while (0)
  14777. /*
  14778. * In some systems, the host SW wants to specify priorities between
  14779. * different MSDU / flow queues within the same peer-TID.
  14780. * The below enums are used for the host to identify to the target
  14781. * which MSDU queue's priority it wants to adjust.
  14782. */
  14783. /*
  14784. * The MSDUQ index describe index of TCL HW, where each index is
  14785. * used for queuing particular types of MSDUs.
  14786. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14787. */
  14788. enum HTT_MSDUQ_INDEX {
  14789. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14790. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14791. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14792. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14793. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14794. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14795. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14796. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14797. HTT_MSDUQ_MAX_INDEX,
  14798. };
  14799. /* MSDU qtype definition */
  14800. enum HTT_MSDU_QTYPE {
  14801. /*
  14802. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14803. * relative priority. Instead, the relative priority of CRIT_0 versus
  14804. * CRIT_1 is controlled by the FW, through the configuration parameters
  14805. * it applies to the queues.
  14806. */
  14807. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14808. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14809. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14810. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14811. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14812. /* New MSDU_QTYPE should be added above this line */
  14813. /*
  14814. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14815. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14816. * any host/target message definitions. The QTYPE_MAX value can
  14817. * only be used internally within the host or within the target.
  14818. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14819. * it must regard the unexpected value as a default qtype value,
  14820. * or ignore it.
  14821. */
  14822. HTT_MSDU_QTYPE_MAX,
  14823. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14824. };
  14825. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14826. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14827. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14828. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14829. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14830. };
  14831. /**
  14832. * @brief target -> host mlo timestamp offset indication
  14833. *
  14834. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14835. *
  14836. * @details
  14837. * The following field definitions describe the format of the HTT target
  14838. * to host mlo timestamp offset indication message.
  14839. *
  14840. *
  14841. * |31 16|15 12|11 10|9 8|7 0 |
  14842. * |----------------------------------------------------------------------|
  14843. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14844. * |----------------------------------------------------------------------|
  14845. * | Sync time stamp lo in us |
  14846. * |----------------------------------------------------------------------|
  14847. * | Sync time stamp hi in us |
  14848. * |----------------------------------------------------------------------|
  14849. * | mlo time stamp offset lo in us |
  14850. * |----------------------------------------------------------------------|
  14851. * | mlo time stamp offset hi in us |
  14852. * |----------------------------------------------------------------------|
  14853. * | mlo time stamp offset clocks in clock ticks |
  14854. * |----------------------------------------------------------------------|
  14855. * |31 26|25 16|15 0 |
  14856. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14857. * | | compensation in clks | |
  14858. * |----------------------------------------------------------------------|
  14859. * |31 22|21 0 |
  14860. * | rsvd 3 | mlo time stamp comp timer period |
  14861. * |----------------------------------------------------------------------|
  14862. * The message is interpreted as follows:
  14863. *
  14864. * dword0 - b'0:7 - msg_type: This will be set to
  14865. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14866. * value: 0x28
  14867. *
  14868. * dword0 - b'9:8 - pdev_id
  14869. *
  14870. * dword0 - b'11:10 - chip_id
  14871. *
  14872. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14873. *
  14874. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14875. *
  14876. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14877. * which last sync interrupt was received
  14878. *
  14879. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14880. * which last sync interrupt was received
  14881. *
  14882. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14883. *
  14884. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14885. *
  14886. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14887. *
  14888. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14889. *
  14890. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14891. * for sub us resolution
  14892. *
  14893. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14894. *
  14895. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14896. * is applied, in us
  14897. *
  14898. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14899. */
  14900. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14901. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14902. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14903. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14904. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14905. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14906. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14907. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14908. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14909. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14910. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14911. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14912. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14914. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14915. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14917. do { \
  14918. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14919. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14920. } while (0)
  14921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14922. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14923. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14924. do { \
  14925. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14926. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14927. } while (0)
  14928. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14929. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14930. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14931. do { \
  14932. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14933. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14934. } while (0)
  14935. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14936. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14937. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14938. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14939. do { \
  14940. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14941. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14942. } while (0)
  14943. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14944. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14945. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14946. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14947. do { \
  14948. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14949. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14950. } while (0)
  14951. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14952. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14953. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14954. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14955. do { \
  14956. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14957. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14958. } while (0)
  14959. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14960. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14961. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14962. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14963. do { \
  14964. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14965. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14966. } while (0)
  14967. typedef struct {
  14968. A_UINT32 msg_type: 8, /* bits 7:0 */
  14969. pdev_id: 2, /* bits 9:8 */
  14970. chip_id: 2, /* bits 11:10 */
  14971. reserved1: 4, /* bits 15:12 */
  14972. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14973. A_UINT32 sync_timestamp_lo_us;
  14974. A_UINT32 sync_timestamp_hi_us;
  14975. A_UINT32 mlo_timestamp_offset_lo_us;
  14976. A_UINT32 mlo_timestamp_offset_hi_us;
  14977. A_UINT32 mlo_timestamp_offset_clks;
  14978. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14979. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14980. reserved2: 6; /* bits 31:26 */
  14981. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14982. reserved3: 10; /* bits 31:22 */
  14983. } htt_t2h_mlo_offset_ind_t;
  14984. /*
  14985. * @brief target -> host VDEV TX RX STATS
  14986. *
  14987. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14988. *
  14989. * @details
  14990. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  14991. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  14992. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  14993. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  14994. * periodically by target even in the absence of any further HTT request
  14995. * messages from host.
  14996. *
  14997. * The message is formatted as follows:
  14998. *
  14999. * |31 16|15 8|7 0|
  15000. * |---------------------------------+----------------+----------------|
  15001. * | payload_size | pdev_id | msg_type |
  15002. * |---------------------------------+----------------+----------------|
  15003. * | reserved0 |
  15004. * |-------------------------------------------------------------------|
  15005. * | reserved1 |
  15006. * |-------------------------------------------------------------------|
  15007. * | reserved2 |
  15008. * |-------------------------------------------------------------------|
  15009. * | |
  15010. * | VDEV specific Tx Rx stats info |
  15011. * | |
  15012. * |-------------------------------------------------------------------|
  15013. *
  15014. * The message is interpreted as follows:
  15015. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15016. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15017. * b'8:15 - pdev_id
  15018. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15019. * message header fields (msg_type through reserved2)
  15020. * dword1 - b'0:31 - reserved0.
  15021. * dword2 - b'0:31 - reserved1.
  15022. * dword3 - b'0:31 - reserved2.
  15023. */
  15024. typedef struct {
  15025. A_UINT32 msg_type: 8,
  15026. pdev_id: 8,
  15027. payload_size: 16;
  15028. A_UINT32 reserved0;
  15029. A_UINT32 reserved1;
  15030. A_UINT32 reserved2;
  15031. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15032. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15033. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15034. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15035. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15036. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15037. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15038. do { \
  15039. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15040. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15041. } while (0)
  15042. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15043. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15044. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15045. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15046. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15047. do { \
  15048. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15049. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15050. } while (0)
  15051. /* SOC related stats */
  15052. typedef struct {
  15053. htt_tlv_hdr_t tlv_hdr;
  15054. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15055. * This can be due to either the peer is deleted or deletion is ongoing
  15056. * */
  15057. A_UINT32 inv_peers_msdu_drop_count_lo;
  15058. A_UINT32 inv_peers_msdu_drop_count_hi;
  15059. } htt_t2h_soc_txrx_stats_common_tlv;
  15060. /* VDEV HW Tx/Rx stats */
  15061. typedef struct {
  15062. htt_tlv_hdr_t tlv_hdr;
  15063. A_UINT32 vdev_id;
  15064. /* Rx msdu byte cnt */
  15065. A_UINT32 rx_msdu_byte_cnt_lo;
  15066. A_UINT32 rx_msdu_byte_cnt_hi;
  15067. /* Rx msdu cnt */
  15068. A_UINT32 rx_msdu_cnt_lo;
  15069. A_UINT32 rx_msdu_cnt_hi;
  15070. /* tx msdu byte cnt */
  15071. A_UINT32 tx_msdu_byte_cnt_lo;
  15072. A_UINT32 tx_msdu_byte_cnt_hi;
  15073. /* tx msdu cnt */
  15074. A_UINT32 tx_msdu_cnt_lo;
  15075. A_UINT32 tx_msdu_cnt_hi;
  15076. /* tx excessive retry discarded msdu cnt*/
  15077. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15078. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15079. /* TX congestion ctrl msdu drop cnt */
  15080. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15081. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15082. /* discarded tx msdus cnt coz of time to live expiry */
  15083. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15084. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15085. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15086. #endif