htt.h 764 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717
  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_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  631. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  632. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  633. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  634. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  635. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  636. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  637. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  638. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  639. HTT_STATS_MAX_TAG,
  640. } htt_tlv_tag_t;
  641. #define HTT_STATS_TLV_TAG_M 0x00000fff
  642. #define HTT_STATS_TLV_TAG_S 0
  643. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  644. #define HTT_STATS_TLV_LENGTH_S 12
  645. #define HTT_STATS_TLV_TAG_GET(_var) \
  646. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  647. HTT_STATS_TLV_TAG_S)
  648. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  649. do { \
  650. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  651. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  652. } while (0)
  653. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  654. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  655. HTT_STATS_TLV_LENGTH_S)
  656. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  657. do { \
  658. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  659. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  660. } while (0)
  661. /*=== host -> target messages ===============================================*/
  662. enum htt_h2t_msg_type {
  663. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  664. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  665. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  666. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  667. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  668. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  669. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  670. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  671. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  672. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  673. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  674. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  675. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  676. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  677. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  678. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  679. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  680. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  681. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  682. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  683. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  684. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  685. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  686. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  687. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  688. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  689. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  690. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  691. /* keep this last */
  692. HTT_H2T_NUM_MSGS
  693. };
  694. /*
  695. * HTT host to target message type -
  696. * stored in bits 7:0 of the first word of the message
  697. */
  698. #define HTT_H2T_MSG_TYPE_M 0xff
  699. #define HTT_H2T_MSG_TYPE_S 0
  700. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  701. do { \
  702. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  703. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  704. } while (0)
  705. #define HTT_H2T_MSG_TYPE_GET(word) \
  706. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  707. /**
  708. * @brief host -> target version number request message definition
  709. *
  710. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  711. *
  712. *
  713. * |31 24|23 16|15 8|7 0|
  714. * |----------------+----------------+----------------+----------------|
  715. * | reserved | msg type |
  716. * |-------------------------------------------------------------------|
  717. * : option request TLV (optional) |
  718. * :...................................................................:
  719. *
  720. * The VER_REQ message may consist of a single 4-byte word, or may be
  721. * extended with TLVs that specify which HTT options the host is requesting
  722. * from the target.
  723. * The following option TLVs may be appended to the VER_REQ message:
  724. * - HL_SUPPRESS_TX_COMPL_IND
  725. * - HL_MAX_TX_QUEUE_GROUPS
  726. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  727. * may be appended to the VER_REQ message (but only one TLV of each type).
  728. *
  729. * Header fields:
  730. * - MSG_TYPE
  731. * Bits 7:0
  732. * Purpose: identifies this as a version number request message
  733. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  734. */
  735. #define HTT_VER_REQ_BYTES 4
  736. /* TBDXXX: figure out a reasonable number */
  737. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  738. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  739. /**
  740. * @brief HTT tx MSDU descriptor
  741. *
  742. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  743. *
  744. * @details
  745. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  746. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  747. * the target firmware needs for the FW's tx processing, particularly
  748. * for creating the HW msdu descriptor.
  749. * The same HTT tx descriptor is used for HL and LL systems, though
  750. * a few fields within the tx descriptor are used only by LL or
  751. * only by HL.
  752. * The HTT tx descriptor is defined in two manners: by a struct with
  753. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  754. * definitions.
  755. * The target should use the struct def, for simplicitly and clarity,
  756. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  757. * neutral. Specifically, the host shall use the get/set macros built
  758. * around the mask + shift defs.
  759. */
  760. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  761. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  764. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  765. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  766. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  767. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  768. #define HTT_TX_VDEV_ID_WORD 0
  769. #define HTT_TX_VDEV_ID_MASK 0x3f
  770. #define HTT_TX_VDEV_ID_SHIFT 16
  771. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  772. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  773. #define HTT_TX_MSDU_LEN_DWORD 1
  774. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  775. /*
  776. * HTT_VAR_PADDR macros
  777. * Allow physical / bus addresses to be either a single 32-bit value,
  778. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  779. */
  780. #define HTT_VAR_PADDR32(var_name) \
  781. A_UINT32 var_name
  782. #define HTT_VAR_PADDR64_LE(var_name) \
  783. struct { \
  784. /* little-endian: lo precedes hi */ \
  785. A_UINT32 lo; \
  786. A_UINT32 hi; \
  787. } var_name
  788. /*
  789. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  790. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  791. * addresses are stored in a XXX-bit field.
  792. * This macro is used to define both htt_tx_msdu_desc32_t and
  793. * htt_tx_msdu_desc64_t structs.
  794. */
  795. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  796. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  797. { \
  798. /* DWORD 0: flags and meta-data */ \
  799. A_UINT32 \
  800. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  801. \
  802. /* pkt_subtype - \
  803. * Detailed specification of the tx frame contents, extending the \
  804. * general specification provided by pkt_type. \
  805. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  806. * pkt_type | pkt_subtype \
  807. * ============================================================== \
  808. * 802.3 | bit 0:3 - Reserved \
  809. * | bit 4: 0x0 - Copy-Engine Classification Results \
  810. * | not appended to the HTT message \
  811. * | 0x1 - Copy-Engine Classification Results \
  812. * | appended to the HTT message in the \
  813. * | format: \
  814. * | [HTT tx desc, frame header, \
  815. * | CE classification results] \
  816. * | The CE classification results begin \
  817. * | at the next 4-byte boundary after \
  818. * | the frame header. \
  819. * ------------+------------------------------------------------- \
  820. * Eth2 | bit 0:3 - Reserved \
  821. * | bit 4: 0x0 - Copy-Engine Classification Results \
  822. * | not appended to the HTT message \
  823. * | 0x1 - Copy-Engine Classification Results \
  824. * | appended to the HTT message. \
  825. * | See the above specification of the \
  826. * | CE classification results location. \
  827. * ------------+------------------------------------------------- \
  828. * native WiFi | bit 0:3 - Reserved \
  829. * | bit 4: 0x0 - Copy-Engine Classification Results \
  830. * | not appended to the HTT message \
  831. * | 0x1 - Copy-Engine Classification Results \
  832. * | appended to the HTT message. \
  833. * | See the above specification of the \
  834. * | CE classification results location. \
  835. * ------------+------------------------------------------------- \
  836. * mgmt | 0x0 - 802.11 MAC header absent \
  837. * | 0x1 - 802.11 MAC header present \
  838. * ------------+------------------------------------------------- \
  839. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  840. * | 0x1 - 802.11 MAC header present \
  841. * | bit 1: 0x0 - allow aggregation \
  842. * | 0x1 - don't allow aggregation \
  843. * | bit 2: 0x0 - perform encryption \
  844. * | 0x1 - don't perform encryption \
  845. * | bit 3: 0x0 - perform tx classification / queuing \
  846. * | 0x1 - don't perform tx classification; \
  847. * | insert the frame into the "misc" \
  848. * | tx queue \
  849. * | bit 4: 0x0 - Copy-Engine Classification Results \
  850. * | not appended to the HTT message \
  851. * | 0x1 - Copy-Engine Classification Results \
  852. * | appended to the HTT message. \
  853. * | See the above specification of the \
  854. * | CE classification results location. \
  855. */ \
  856. pkt_subtype: 5, \
  857. \
  858. /* pkt_type - \
  859. * General specification of the tx frame contents. \
  860. * The htt_pkt_type enum should be used to specify and check the \
  861. * value of this field. \
  862. */ \
  863. pkt_type: 3, \
  864. \
  865. /* vdev_id - \
  866. * ID for the vdev that is sending this tx frame. \
  867. * For certain non-standard packet types, e.g. pkt_type == raw \
  868. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  869. * This field is used primarily for determining where to queue \
  870. * broadcast and multicast frames. \
  871. */ \
  872. vdev_id: 6, \
  873. /* ext_tid - \
  874. * The extended traffic ID. \
  875. * If the TID is unknown, the extended TID is set to \
  876. * HTT_TX_EXT_TID_INVALID. \
  877. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  878. * value of the QoS TID. \
  879. * If the tx frame is non-QoS data, then the extended TID is set to \
  880. * HTT_TX_EXT_TID_NON_QOS. \
  881. * If the tx frame is multicast or broadcast, then the extended TID \
  882. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  883. */ \
  884. ext_tid: 5, \
  885. \
  886. /* postponed - \
  887. * This flag indicates whether the tx frame has been downloaded to \
  888. * the target before but discarded by the target, and now is being \
  889. * downloaded again; or if this is a new frame that is being \
  890. * downloaded for the first time. \
  891. * This flag allows the target to determine the correct order for \
  892. * transmitting new vs. old frames. \
  893. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  894. * This flag only applies to HL systems, since in LL systems, \
  895. * the tx flow control is handled entirely within the target. \
  896. */ \
  897. postponed: 1, \
  898. \
  899. /* extension - \
  900. * This flag indicates whether a HTT tx MSDU extension descriptor \
  901. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  902. * \
  903. * 0x0 - no extension MSDU descriptor is present \
  904. * 0x1 - an extension MSDU descriptor immediately follows the \
  905. * regular MSDU descriptor \
  906. */ \
  907. extension: 1, \
  908. \
  909. /* cksum_offload - \
  910. * This flag indicates whether checksum offload is enabled or not \
  911. * for this frame. Target FW use this flag to turn on HW checksumming \
  912. * 0x0 - No checksum offload \
  913. * 0x1 - L3 header checksum only \
  914. * 0x2 - L4 checksum only \
  915. * 0x3 - L3 header checksum + L4 checksum \
  916. */ \
  917. cksum_offload: 2, \
  918. \
  919. /* tx_comp_req - \
  920. * This flag indicates whether Tx Completion \
  921. * from fw is required or not. \
  922. * This flag is only relevant if tx completion is not \
  923. * universally enabled. \
  924. * For all LL systems, tx completion is mandatory, \
  925. * so this flag will be irrelevant. \
  926. * For HL systems tx completion is optional, but HL systems in which \
  927. * the bus throughput exceeds the WLAN throughput will \
  928. * probably want to always use tx completion, and thus \
  929. * would not check this flag. \
  930. * This flag is required when tx completions are not used universally, \
  931. * but are still required for certain tx frames for which \
  932. * an OTA delivery acknowledgment is needed by the host. \
  933. * In practice, this would be for HL systems in which the \
  934. * bus throughput is less than the WLAN throughput. \
  935. * \
  936. * 0x0 - Tx Completion Indication from Fw not required \
  937. * 0x1 - Tx Completion Indication from Fw is required \
  938. */ \
  939. tx_compl_req: 1; \
  940. \
  941. \
  942. /* DWORD 1: MSDU length and ID */ \
  943. A_UINT32 \
  944. len: 16, /* MSDU length, in bytes */ \
  945. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  946. * and this id is used to calculate fragmentation \
  947. * descriptor pointer inside the target based on \
  948. * the base address, configured inside the target. \
  949. */ \
  950. \
  951. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  952. /* frags_desc_ptr - \
  953. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  954. * where the tx frame's fragments reside in memory. \
  955. * This field only applies to LL systems, since in HL systems the \
  956. * (degenerate single-fragment) fragmentation descriptor is created \
  957. * within the target. \
  958. */ \
  959. _paddr__frags_desc_ptr_; \
  960. \
  961. /* DWORD 3 (or 4): peerid, chanfreq */ \
  962. /* \
  963. * Peer ID : Target can use this value to know which peer-id packet \
  964. * destined to. \
  965. * It's intended to be specified by host in case of NAWDS. \
  966. */ \
  967. A_UINT16 peerid; \
  968. \
  969. /* \
  970. * Channel frequency: This identifies the desired channel \
  971. * frequency (in mhz) for tx frames. This is used by FW to help \
  972. * determine when it is safe to transmit or drop frames for \
  973. * off-channel operation. \
  974. * The default value of zero indicates to FW that the corresponding \
  975. * VDEV's home channel (if there is one) is the desired channel \
  976. * frequency. \
  977. */ \
  978. A_UINT16 chanfreq; \
  979. \
  980. /* Reason reserved is commented is increasing the htt structure size \
  981. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  982. * A_UINT32 reserved_dword3_bits0_31; \
  983. */ \
  984. } POSTPACK
  985. /* define a htt_tx_msdu_desc32_t type */
  986. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  987. /* define a htt_tx_msdu_desc64_t type */
  988. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  989. /*
  990. * Make htt_tx_msdu_desc_t be an alias for either
  991. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  992. */
  993. #if HTT_PADDR64
  994. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  995. #else
  996. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  997. #endif
  998. /* decriptor information for Management frame*/
  999. /*
  1000. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1001. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1002. */
  1003. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1004. extern A_UINT32 mgmt_hdr_len;
  1005. PREPACK struct htt_mgmt_tx_desc_t {
  1006. A_UINT32 msg_type;
  1007. #if HTT_PADDR64
  1008. A_UINT64 frag_paddr; /* DMAble address of the data */
  1009. #else
  1010. A_UINT32 frag_paddr; /* DMAble address of the data */
  1011. #endif
  1012. A_UINT32 desc_id; /* returned to host during completion
  1013. * to free the meory*/
  1014. A_UINT32 len; /* Fragment length */
  1015. A_UINT32 vdev_id; /* virtual device ID*/
  1016. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1017. } POSTPACK;
  1018. PREPACK struct htt_mgmt_tx_compl_ind {
  1019. A_UINT32 desc_id;
  1020. A_UINT32 status;
  1021. } POSTPACK;
  1022. /*
  1023. * This SDU header size comes from the summation of the following:
  1024. * 1. Max of:
  1025. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1026. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1027. * b. 802.11 header, for raw frames: 36 bytes
  1028. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1029. * QoS header, HT header)
  1030. * c. 802.3 header, for ethernet frames: 14 bytes
  1031. * (destination address, source address, ethertype / length)
  1032. * 2. Max of:
  1033. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1034. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1035. * 3. 802.1Q VLAN header: 4 bytes
  1036. * 4. LLC/SNAP header: 8 bytes
  1037. */
  1038. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1039. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1040. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1041. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1042. A_COMPILE_TIME_ASSERT(
  1043. htt_encap_hdr_size_max_check_nwifi,
  1044. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1045. A_COMPILE_TIME_ASSERT(
  1046. htt_encap_hdr_size_max_check_enet,
  1047. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1048. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1049. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1050. #define HTT_TX_HDR_SIZE_802_1Q 4
  1051. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1052. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1053. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1054. HTT_TX_HDR_SIZE_802_1Q + \
  1055. HTT_TX_HDR_SIZE_LLC_SNAP)
  1056. #define HTT_HL_TX_FRM_HDR_LEN \
  1057. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1058. #define HTT_LL_TX_FRM_HDR_LEN \
  1059. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1060. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1061. /* dword 0 */
  1062. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1063. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1064. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1065. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1066. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1067. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1068. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1069. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1070. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1071. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1072. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1073. #define HTT_TX_DESC_PKT_TYPE_S 13
  1074. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1075. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1076. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1077. #define HTT_TX_DESC_VDEV_ID_S 16
  1078. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1079. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1080. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1081. #define HTT_TX_DESC_EXT_TID_S 22
  1082. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1083. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1084. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1085. #define HTT_TX_DESC_POSTPONED_S 27
  1086. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1087. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1088. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1089. #define HTT_TX_DESC_EXTENSION_S 28
  1090. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1091. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1092. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1093. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1094. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1095. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1096. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1097. #define HTT_TX_DESC_TX_COMP_S 31
  1098. /* dword 1 */
  1099. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1100. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1101. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1102. #define HTT_TX_DESC_FRM_LEN_S 0
  1103. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1104. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1105. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1106. #define HTT_TX_DESC_FRM_ID_S 16
  1107. /* dword 2 */
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1110. /* for systems using 64-bit format for bus addresses */
  1111. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1112. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1114. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1115. /* for systems using 32-bit format for bus addresses */
  1116. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1117. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1118. /* dword 3 */
  1119. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1120. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1121. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1122. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1123. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1124. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1125. #if HTT_PADDR64
  1126. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1127. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1128. #else
  1129. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1130. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1131. #endif
  1132. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1133. #define HTT_TX_DESC_PEER_ID_S 0
  1134. /*
  1135. * TEMPORARY:
  1136. * The original definitions for the PEER_ID fields contained typos
  1137. * (with _DESC_PADDR appended to this PEER_ID field name).
  1138. * Retain deprecated original names for PEER_ID fields until all code that
  1139. * refers to them has been updated.
  1140. */
  1141. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1142. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1143. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1144. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1145. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1146. HTT_TX_DESC_PEER_ID_M
  1147. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1148. HTT_TX_DESC_PEER_ID_S
  1149. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1150. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1151. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1152. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1153. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1154. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1155. #if HTT_PADDR64
  1156. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1157. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1158. #else
  1159. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1160. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1161. #endif
  1162. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1163. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1164. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1165. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1166. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1167. do { \
  1168. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1169. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1170. } while (0)
  1171. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1172. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1173. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1174. do { \
  1175. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1176. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1177. } while (0)
  1178. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1179. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1180. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1181. do { \
  1182. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1183. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1184. } while (0)
  1185. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1186. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1187. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1188. do { \
  1189. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1190. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1191. } while (0)
  1192. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1193. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1194. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1195. do { \
  1196. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1197. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1198. } while (0)
  1199. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1200. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1201. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1202. do { \
  1203. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1204. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1205. } while (0)
  1206. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1207. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1208. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1209. do { \
  1210. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1211. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1212. } while (0)
  1213. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1214. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1215. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1216. do { \
  1217. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1218. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1219. } while (0)
  1220. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1221. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1222. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1226. } while (0)
  1227. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1229. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1236. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1240. } while (0)
  1241. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1242. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1243. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1247. } while (0)
  1248. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1249. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1250. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1254. } while (0)
  1255. /* enums used in the HTT tx MSDU extension descriptor */
  1256. enum {
  1257. htt_tx_guard_interval_regular = 0,
  1258. htt_tx_guard_interval_short = 1,
  1259. };
  1260. enum {
  1261. htt_tx_preamble_type_ofdm = 0,
  1262. htt_tx_preamble_type_cck = 1,
  1263. htt_tx_preamble_type_ht = 2,
  1264. htt_tx_preamble_type_vht = 3,
  1265. };
  1266. enum {
  1267. htt_tx_bandwidth_5MHz = 0,
  1268. htt_tx_bandwidth_10MHz = 1,
  1269. htt_tx_bandwidth_20MHz = 2,
  1270. htt_tx_bandwidth_40MHz = 3,
  1271. htt_tx_bandwidth_80MHz = 4,
  1272. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1273. };
  1274. /**
  1275. * @brief HTT tx MSDU extension descriptor
  1276. * @details
  1277. * If the target supports HTT tx MSDU extension descriptors, the host has
  1278. * the option of appending the following struct following the regular
  1279. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1280. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1281. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1282. * tx specs for each frame.
  1283. */
  1284. PREPACK struct htt_tx_msdu_desc_ext_t {
  1285. /* DWORD 0: flags */
  1286. A_UINT32
  1287. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1288. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1289. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1290. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1291. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1292. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1293. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1294. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1295. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1296. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1297. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1298. /* DWORD 1: tx power, tx rate, tx BW */
  1299. A_UINT32
  1300. /* pwr -
  1301. * Specify what power the tx frame needs to be transmitted at.
  1302. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1303. * The value needs to be appropriately sign-extended when extracting
  1304. * the value from the message and storing it in a variable that is
  1305. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1306. * automatically handles this sign-extension.)
  1307. * If the transmission uses multiple tx chains, this power spec is
  1308. * the total transmit power, assuming incoherent combination of
  1309. * per-chain power to produce the total power.
  1310. */
  1311. pwr: 8,
  1312. /* mcs_mask -
  1313. * Specify the allowable values for MCS index (modulation and coding)
  1314. * to use for transmitting the frame.
  1315. *
  1316. * For HT / VHT preamble types, this mask directly corresponds to
  1317. * the HT or VHT MCS indices that are allowed. For each bit N set
  1318. * within the mask, MCS index N is allowed for transmitting the frame.
  1319. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1320. * rates versus OFDM rates, so the host has the option of specifying
  1321. * that the target must transmit the frame with CCK or OFDM rates
  1322. * (not HT or VHT), but leaving the decision to the target whether
  1323. * to use CCK or OFDM.
  1324. *
  1325. * For CCK and OFDM, the bits within this mask are interpreted as
  1326. * follows:
  1327. * bit 0 -> CCK 1 Mbps rate is allowed
  1328. * bit 1 -> CCK 2 Mbps rate is allowed
  1329. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1330. * bit 3 -> CCK 11 Mbps rate is allowed
  1331. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1332. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1333. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1334. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1335. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1336. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1337. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1338. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1339. *
  1340. * The MCS index specification needs to be compatible with the
  1341. * bandwidth mask specification. For example, a MCS index == 9
  1342. * specification is inconsistent with a preamble type == VHT,
  1343. * Nss == 1, and channel bandwidth == 20 MHz.
  1344. *
  1345. * Furthermore, the host has only a limited ability to specify to
  1346. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1347. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1348. */
  1349. mcs_mask: 12,
  1350. /* nss_mask -
  1351. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1352. * Each bit in this mask corresponds to a Nss value:
  1353. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1354. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1355. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1356. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1357. * The values in the Nss mask must be suitable for the recipient, e.g.
  1358. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1359. * recipient which only supports 2x2 MIMO.
  1360. */
  1361. nss_mask: 4,
  1362. /* guard_interval -
  1363. * Specify a htt_tx_guard_interval enum value to indicate whether
  1364. * the transmission should use a regular guard interval or a
  1365. * short guard interval.
  1366. */
  1367. guard_interval: 1,
  1368. /* preamble_type_mask -
  1369. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1370. * may choose from for transmitting this frame.
  1371. * The bits in this mask correspond to the values in the
  1372. * htt_tx_preamble_type enum. For example, to allow the target
  1373. * to transmit the frame as either CCK or OFDM, this field would
  1374. * be set to
  1375. * (1 << htt_tx_preamble_type_ofdm) |
  1376. * (1 << htt_tx_preamble_type_cck)
  1377. */
  1378. preamble_type_mask: 4,
  1379. reserved1_31_29: 3; /* unused, set to 0x0 */
  1380. /* DWORD 2: tx chain mask, tx retries */
  1381. A_UINT32
  1382. /* chain_mask - specify which chains to transmit from */
  1383. chain_mask: 4,
  1384. /* retry_limit -
  1385. * Specify the maximum number of transmissions, including the
  1386. * initial transmission, to attempt before giving up if no ack
  1387. * is received.
  1388. * If the tx rate is specified, then all retries shall use the
  1389. * same rate as the initial transmission.
  1390. * If no tx rate is specified, the target can choose whether to
  1391. * retain the original rate during the retransmissions, or to
  1392. * fall back to a more robust rate.
  1393. */
  1394. retry_limit: 4,
  1395. /* bandwidth_mask -
  1396. * Specify what channel widths may be used for the transmission.
  1397. * A value of zero indicates "don't care" - the target may choose
  1398. * the transmission bandwidth.
  1399. * The bits within this mask correspond to the htt_tx_bandwidth
  1400. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1401. * The bandwidth_mask must be consistent with the preamble_type_mask
  1402. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1403. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1404. */
  1405. bandwidth_mask: 6,
  1406. reserved2_31_14: 18; /* unused, set to 0x0 */
  1407. /* DWORD 3: tx expiry time (TSF) LSBs */
  1408. A_UINT32 expire_tsf_lo;
  1409. /* DWORD 4: tx expiry time (TSF) MSBs */
  1410. A_UINT32 expire_tsf_hi;
  1411. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1412. } POSTPACK;
  1413. /* DWORD 0 */
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1430. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1431. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1432. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1433. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1434. /* DWORD 1 */
  1435. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1436. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1437. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1438. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1439. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1440. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1441. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1442. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1443. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1444. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1445. /* DWORD 2 */
  1446. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1447. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1448. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1449. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1450. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1451. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1452. /* DWORD 0 */
  1453. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1454. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1455. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1456. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1457. do { \
  1458. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1459. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1460. } while (0)
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1462. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1463. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1464. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1465. do { \
  1466. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1467. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1468. } while (0)
  1469. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1470. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1471. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1473. do { \
  1474. HTT_CHECK_SET_VAL( \
  1475. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1476. ((_var) |= ((_val) \
  1477. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1478. } while (0)
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1480. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1481. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1483. do { \
  1484. HTT_CHECK_SET_VAL( \
  1485. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1486. ((_var) |= ((_val) \
  1487. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1488. } while (0)
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1490. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1491. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1493. do { \
  1494. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1495. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1496. } while (0)
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1498. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1499. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1501. do { \
  1502. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1503. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1504. } while (0)
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1506. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1507. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1509. do { \
  1510. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1511. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1512. } while (0)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1514. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1515. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1517. do { \
  1518. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1519. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1520. } while (0)
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1522. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1523. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1525. do { \
  1526. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1527. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1528. } while (0)
  1529. /* DWORD 1 */
  1530. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1531. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1532. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1533. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1534. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1535. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1536. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1537. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1538. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1539. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1540. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1541. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1542. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1543. do { \
  1544. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1545. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1546. } while (0)
  1547. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1553. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1554. } while (0)
  1555. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1562. } while (0)
  1563. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1569. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1570. } while (0)
  1571. /* DWORD 2 */
  1572. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1574. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1575. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1586. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1587. } while (0)
  1588. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1589. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1590. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1591. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1592. do { \
  1593. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1594. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1595. } while (0)
  1596. typedef enum {
  1597. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1598. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1599. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1600. } htt_11ax_ltf_subtype_t;
  1601. typedef enum {
  1602. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1603. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1604. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1605. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1606. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1607. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1608. } htt_tx_ext2_preamble_type_t;
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1617. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1618. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1619. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1620. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1621. /**
  1622. * @brief HTT tx MSDU extension descriptor v2
  1623. * @details
  1624. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1625. * is received as tcl_exit_base->host_meta_info in firmware.
  1626. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1627. * are already part of tcl_exit_base.
  1628. */
  1629. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1630. /* DWORD 0: flags */
  1631. A_UINT32
  1632. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1633. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1634. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1635. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1636. valid_retries : 1, /* if set, tx retries spec is valid */
  1637. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1638. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1639. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1640. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1641. valid_key_flags : 1, /* if set, key flags is valid */
  1642. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1643. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1644. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1645. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1646. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1647. 1 = ENCRYPT,
  1648. 2 ~ 3 - Reserved */
  1649. /* retry_limit -
  1650. * Specify the maximum number of transmissions, including the
  1651. * initial transmission, to attempt before giving up if no ack
  1652. * is received.
  1653. * If the tx rate is specified, then all retries shall use the
  1654. * same rate as the initial transmission.
  1655. * If no tx rate is specified, the target can choose whether to
  1656. * retain the original rate during the retransmissions, or to
  1657. * fall back to a more robust rate.
  1658. */
  1659. retry_limit : 4,
  1660. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1661. * Valid only for 11ax preamble types HE_SU
  1662. * and HE_EXT_SU
  1663. */
  1664. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1665. * Valid only for 11ax preamble types HE_SU
  1666. * and HE_EXT_SU
  1667. */
  1668. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1669. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1670. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1671. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1672. */
  1673. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1674. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1675. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1676. * Use cases:
  1677. * Any time firmware uses TQM-BYPASS for Data
  1678. * TID, firmware expect host to set this bit.
  1679. */
  1680. /* DWORD 1: tx power, tx rate */
  1681. A_UINT32
  1682. power : 8, /* unit of the power field is 0.5 dbm
  1683. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1684. * signed value ranging from -64dbm to 63.5 dbm
  1685. */
  1686. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1687. * Setting more than one MCS isn't currently
  1688. * supported by the target (but is supported
  1689. * in the interface in case in the future
  1690. * the target supports specifications of
  1691. * a limited set of MCS values.
  1692. */
  1693. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1694. * Setting more than one Nss isn't currently
  1695. * supported by the target (but is supported
  1696. * in the interface in case in the future
  1697. * the target supports specifications of
  1698. * a limited set of Nss values.
  1699. */
  1700. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1701. update_peer_cache : 1; /* When set these custom values will be
  1702. * used for all packets, until the next
  1703. * update via this ext header.
  1704. * This is to make sure not all packets
  1705. * need to include this header.
  1706. */
  1707. /* DWORD 2: tx chain mask, tx retries */
  1708. A_UINT32
  1709. /* chain_mask - specify which chains to transmit from */
  1710. chain_mask : 8,
  1711. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1712. * TODO: Update Enum values for key_flags
  1713. */
  1714. /*
  1715. * Channel frequency: This identifies the desired channel
  1716. * frequency (in MHz) for tx frames. This is used by FW to help
  1717. * determine when it is safe to transmit or drop frames for
  1718. * off-channel operation.
  1719. * The default value of zero indicates to FW that the corresponding
  1720. * VDEV's home channel (if there is one) is the desired channel
  1721. * frequency.
  1722. */
  1723. chanfreq : 16;
  1724. /* DWORD 3: tx expiry time (TSF) LSBs */
  1725. A_UINT32 expire_tsf_lo;
  1726. /* DWORD 4: tx expiry time (TSF) MSBs */
  1727. A_UINT32 expire_tsf_hi;
  1728. /* DWORD 5: flags to control routing / processing of the MSDU */
  1729. A_UINT32
  1730. /* learning_frame
  1731. * When this flag is set, this frame will be dropped by FW
  1732. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1733. */
  1734. learning_frame : 1,
  1735. /* send_as_standalone
  1736. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1737. * i.e. with no A-MSDU or A-MPDU aggregation.
  1738. * The scope is extended to other use-cases.
  1739. */
  1740. send_as_standalone : 1,
  1741. /* is_host_opaque_valid
  1742. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1743. * with valid information.
  1744. */
  1745. is_host_opaque_valid : 1,
  1746. rsvd0 : 29;
  1747. /* DWORD 6 : Host opaque cookie for special frames */
  1748. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1749. rsvd1 : 16;
  1750. /*
  1751. * This structure can be expanded further up to 40 bytes
  1752. * by adding further DWORDs as needed.
  1753. */
  1754. } POSTPACK;
  1755. /* DWORD 0 */
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1778. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1779. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1780. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1781. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1782. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1783. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1784. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1785. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1786. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1787. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1788. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1789. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1790. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1791. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1792. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1793. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1794. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1795. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1796. /* DWORD 1 */
  1797. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1798. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1799. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1800. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1801. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1802. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1803. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1804. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1805. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1806. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1807. /* DWORD 2 */
  1808. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1809. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1810. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1811. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1812. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1813. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1814. /* DWORD 5 */
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1821. /* DWORD 6 */
  1822. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1823. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1824. /* DWORD 0 */
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1832. } while (0)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1843. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1847. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1848. } while (0)
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1850. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1851. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1853. do { \
  1854. HTT_CHECK_SET_VAL( \
  1855. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1856. ((_var) |= ((_val) \
  1857. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1858. } while (0)
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1860. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1861. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1863. do { \
  1864. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1865. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1866. } while (0)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1868. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1869. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1871. do { \
  1872. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1873. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1874. } while (0)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1876. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1877. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1879. do { \
  1880. HTT_CHECK_SET_VAL( \
  1881. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1882. ((_var) |= ((_val) \
  1883. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1884. } while (0)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1886. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1887. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1892. } while (0)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1894. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1895. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1900. } while (0)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1902. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1903. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1908. } while (0)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1910. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1916. } while (0)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1918. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1924. } while (0)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1932. } while (0)
  1933. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1934. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1935. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1936. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1939. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1988. } while (0)
  1989. /* DWORD 1 */
  1990. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1991. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1992. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1993. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1994. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1995. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1996. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1997. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1998. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1999. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2025. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2026. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2030. } while (0)
  2031. /* DWORD 2 */
  2032. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2033. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2034. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2035. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2036. do { \
  2037. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2038. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2039. } while (0)
  2040. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2044. do { \
  2045. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2046. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2047. } while (0)
  2048. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2055. } while (0)
  2056. /* DWORD 5 */
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2072. } while (0)
  2073. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2074. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2075. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2076. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2077. do { \
  2078. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2079. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2080. } while (0)
  2081. /* DWORD 6 */
  2082. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2083. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2084. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2085. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2086. do { \
  2087. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2088. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2089. } while (0)
  2090. typedef enum {
  2091. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2092. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2093. } htt_tcl_metadata_type;
  2094. /**
  2095. * @brief HTT TCL command number format
  2096. * @details
  2097. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2098. * available to firmware as tcl_exit_base->tcl_status_number.
  2099. * For regular / multicast packets host will send vdev and mac id and for
  2100. * NAWDS packets, host will send peer id.
  2101. * A_UINT32 is used to avoid endianness conversion problems.
  2102. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2103. */
  2104. typedef struct {
  2105. A_UINT32
  2106. type: 1, /* vdev_id based or peer_id based */
  2107. rsvd: 31;
  2108. } htt_tx_tcl_vdev_or_peer_t;
  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. vdev_id: 8,
  2114. pdev_id: 2,
  2115. host_inspected:1,
  2116. rsvd: 19;
  2117. } htt_tx_tcl_vdev_metadata;
  2118. typedef struct {
  2119. A_UINT32
  2120. type: 1, /* vdev_id based or peer_id based */
  2121. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2122. peer_id: 14,
  2123. rsvd: 16;
  2124. } htt_tx_tcl_peer_metadata;
  2125. PREPACK struct htt_tx_tcl_metadata {
  2126. union {
  2127. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2128. htt_tx_tcl_vdev_metadata vdev_meta;
  2129. htt_tx_tcl_peer_metadata peer_meta;
  2130. };
  2131. } POSTPACK;
  2132. /* DWORD 0 */
  2133. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2134. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2135. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2136. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2137. /* VDEV metadata */
  2138. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2139. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2140. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2141. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2142. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2143. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2144. /* PEER metadata */
  2145. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2146. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2147. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2148. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2149. HTT_TX_TCL_METADATA_TYPE_S)
  2150. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2154. } while (0)
  2155. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2156. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2157. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2158. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2162. } while (0)
  2163. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2164. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2165. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2166. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2170. } while (0)
  2171. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2172. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2173. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2174. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2178. } while (0)
  2179. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2180. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2181. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2182. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2186. } while (0)
  2187. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2188. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2189. HTT_TX_TCL_METADATA_PEER_ID_S)
  2190. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2191. do { \
  2192. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2193. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2194. } while (0)
  2195. typedef enum {
  2196. HTT_TX_FW2WBM_TX_STATUS_OK,
  2197. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2198. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2199. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2200. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2201. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2202. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2203. HTT_TX_FW2WBM_TX_STATUS_MAX
  2204. } htt_tx_fw2wbm_tx_status_t;
  2205. typedef enum {
  2206. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2207. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2208. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2209. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2210. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2211. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2212. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2213. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2214. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2215. } htt_tx_fw2wbm_reinject_reason_t;
  2216. /**
  2217. * @brief HTT TX WBM Completion from firmware to host
  2218. * @details
  2219. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2220. * DWORD 3 and 4 for software based completions (Exception frames and
  2221. * TQM bypass frames)
  2222. * For software based completions, wbm_release_ring->release_source_module will
  2223. * be set to release_source_fw
  2224. */
  2225. PREPACK struct htt_tx_wbm_completion {
  2226. A_UINT32
  2227. sch_cmd_id: 24,
  2228. exception_frame: 1, /* If set, this packet was queued via exception path */
  2229. rsvd0_31_25: 7;
  2230. A_UINT32
  2231. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2232. * reception of an ACK or BA, this field indicates
  2233. * the RSSI of the received ACK or BA frame.
  2234. * When the frame is removed as result of a direct
  2235. * remove command from the SW, this field is set
  2236. * to 0x0 (which is never a valid value when real
  2237. * RSSI is available).
  2238. * Units: dB w.r.t noise floor
  2239. */
  2240. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2241. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2242. rsvd1_31_16: 16;
  2243. } POSTPACK;
  2244. /* DWORD 0 */
  2245. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2246. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2247. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2248. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2249. /* DWORD 1 */
  2250. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2251. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2252. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2253. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2254. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2255. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2256. /* DWORD 0 */
  2257. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2258. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2259. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2260. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2261. do { \
  2262. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2263. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2264. } while (0)
  2265. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2266. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2267. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2268. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2272. } while (0)
  2273. /* DWORD 1 */
  2274. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2275. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2276. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2277. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2281. } while (0)
  2282. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2283. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2284. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2285. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2286. do { \
  2287. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2288. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2289. } while (0)
  2290. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2291. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2292. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2293. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2294. do { \
  2295. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2296. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2297. } while (0)
  2298. /**
  2299. * @brief HTT TX WBM Completion from firmware to host
  2300. * @details
  2301. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2302. * (WBM) offload HW.
  2303. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2304. * For software based completions, release_source_module will
  2305. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2306. * struct wbm_release_ring and then switch to this after looking at
  2307. * release_source_module.
  2308. */
  2309. PREPACK struct htt_tx_wbm_completion_v2 {
  2310. A_UINT32
  2311. used_by_hw0; /* Refer to struct wbm_release_ring */
  2312. A_UINT32
  2313. used_by_hw1; /* Refer to struct wbm_release_ring */
  2314. A_UINT32
  2315. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2316. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2317. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2318. exception_frame: 1,
  2319. rsvd0: 12, /* For future use */
  2320. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2321. rsvd1: 1; /* For future use */
  2322. A_UINT32
  2323. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2324. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2325. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2326. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2327. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2328. */
  2329. A_UINT32
  2330. data1: 32;
  2331. A_UINT32
  2332. data2: 32;
  2333. A_UINT32
  2334. used_by_hw3; /* Refer to struct wbm_release_ring */
  2335. } POSTPACK;
  2336. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2337. /* DWORD 3 */
  2338. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2339. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2340. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2341. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2342. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2343. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2344. /* DWORD 3 */
  2345. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2346. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2347. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2348. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2349. do { \
  2350. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2351. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2352. } while (0)
  2353. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2354. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2355. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2356. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2360. } while (0)
  2361. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2362. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2363. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2364. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2368. } while (0)
  2369. /**
  2370. * @brief HTT TX WBM transmit status from firmware to host
  2371. * @details
  2372. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2373. * (WBM) offload HW.
  2374. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2375. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2376. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2377. */
  2378. PREPACK struct htt_tx_wbm_transmit_status {
  2379. A_UINT32
  2380. sch_cmd_id: 24,
  2381. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2382. * reception of an ACK or BA, this field indicates
  2383. * the RSSI of the received ACK or BA frame.
  2384. * When the frame is removed as result of a direct
  2385. * remove command from the SW, this field is set
  2386. * to 0x0 (which is never a valid value when real
  2387. * RSSI is available).
  2388. * Units: dB w.r.t noise floor
  2389. */
  2390. A_UINT32
  2391. sw_peer_id: 16,
  2392. tid_num: 5,
  2393. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2394. * and tid_num fields contain valid data.
  2395. * If this "valid" flag is not set, the
  2396. * sw_peer_id and tid_num fields must be ignored.
  2397. */
  2398. mcast: 1,
  2399. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2400. * contains valid data.
  2401. */
  2402. reserved0: 8;
  2403. A_UINT32
  2404. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2405. * packets in the wbm completion path
  2406. */
  2407. } POSTPACK;
  2408. /* DWORD 4 */
  2409. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2410. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2411. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2412. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2413. /* DWORD 5 */
  2414. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2415. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2416. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2417. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2418. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2419. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2420. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2421. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2422. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2423. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2424. /* DWORD 4 */
  2425. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2426. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2427. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2428. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2429. do { \
  2430. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2431. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2432. } while (0)
  2433. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2434. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2435. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2436. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2440. } while (0)
  2441. /* DWORD 5 */
  2442. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2443. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2444. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2445. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2446. do { \
  2447. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2448. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2449. } while (0)
  2450. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2451. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2452. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2453. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2454. do { \
  2455. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2456. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2457. } while (0)
  2458. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2459. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2460. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2461. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2462. do { \
  2463. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2464. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2465. } while (0)
  2466. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2467. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2468. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2469. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2470. do { \
  2471. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2472. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2473. } while (0)
  2474. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2475. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2476. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2477. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2478. do { \
  2479. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2480. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2481. } while (0)
  2482. /**
  2483. * @brief HTT TX WBM reinject status from firmware to host
  2484. * @details
  2485. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2486. * (WBM) offload HW.
  2487. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2488. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2489. */
  2490. PREPACK struct htt_tx_wbm_reinject_status {
  2491. A_UINT32
  2492. reserved0: 32;
  2493. A_UINT32
  2494. reserved1: 32;
  2495. A_UINT32
  2496. reserved2: 32;
  2497. } POSTPACK;
  2498. /**
  2499. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2500. * @details
  2501. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2502. * (WBM) offload HW.
  2503. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2504. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2505. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2506. * STA side.
  2507. */
  2508. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2509. A_UINT32
  2510. mec_sa_addr_31_0;
  2511. A_UINT32
  2512. mec_sa_addr_47_32: 16,
  2513. sa_ast_index: 16;
  2514. A_UINT32
  2515. vdev_id: 8,
  2516. reserved0: 24;
  2517. } POSTPACK;
  2518. /* DWORD 4 - mec_sa_addr_31_0 */
  2519. /* DWORD 5 */
  2520. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2521. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2522. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2523. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2524. /* DWORD 6 */
  2525. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2526. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2527. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2528. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2529. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2530. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2531. do { \
  2532. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2533. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2534. } while (0)
  2535. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2536. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2537. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2538. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2539. do { \
  2540. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2541. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2542. } while (0)
  2543. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2544. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2545. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2546. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2547. do { \
  2548. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2549. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2550. } while (0)
  2551. typedef enum {
  2552. TX_FLOW_PRIORITY_BE,
  2553. TX_FLOW_PRIORITY_HIGH,
  2554. TX_FLOW_PRIORITY_LOW,
  2555. } htt_tx_flow_priority_t;
  2556. typedef enum {
  2557. TX_FLOW_LATENCY_SENSITIVE,
  2558. TX_FLOW_LATENCY_INSENSITIVE,
  2559. } htt_tx_flow_latency_t;
  2560. typedef enum {
  2561. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2562. TX_FLOW_INTERACTIVE_TRAFFIC,
  2563. TX_FLOW_PERIODIC_TRAFFIC,
  2564. TX_FLOW_BURSTY_TRAFFIC,
  2565. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2566. } htt_tx_flow_traffic_pattern_t;
  2567. /**
  2568. * @brief HTT TX Flow search metadata format
  2569. * @details
  2570. * Host will set this metadata in flow table's flow search entry along with
  2571. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2572. * firmware and TQM ring if the flow search entry wins.
  2573. * This metadata is available to firmware in that first MSDU's
  2574. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2575. * to one of the available flows for specific tid and returns the tqm flow
  2576. * pointer as part of htt_tx_map_flow_info message.
  2577. */
  2578. PREPACK struct htt_tx_flow_metadata {
  2579. A_UINT32
  2580. rsvd0_1_0: 2,
  2581. tid: 4,
  2582. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2583. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2584. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2585. * Else choose final tid based on latency, priority.
  2586. */
  2587. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2588. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2589. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2590. } POSTPACK;
  2591. /* DWORD 0 */
  2592. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2593. #define HTT_TX_FLOW_METADATA_TID_S 2
  2594. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2595. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2596. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2597. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2598. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2599. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2600. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2601. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2602. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2603. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2604. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2605. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2606. /* DWORD 0 */
  2607. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2608. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2609. HTT_TX_FLOW_METADATA_TID_S)
  2610. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2611. do { \
  2612. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2613. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2614. } while (0)
  2615. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2616. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2617. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2618. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2619. do { \
  2620. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2621. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2622. } while (0)
  2623. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2624. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2625. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2626. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2627. do { \
  2628. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2629. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2630. } while (0)
  2631. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2632. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2633. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2634. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2635. do { \
  2636. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2637. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2638. } while (0)
  2639. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2640. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2641. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2642. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2643. do { \
  2644. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2645. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2646. } while (0)
  2647. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2648. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2649. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2650. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2651. do { \
  2652. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2653. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2654. } while (0)
  2655. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2656. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2657. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2658. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2659. do { \
  2660. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2661. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2662. } while (0)
  2663. /**
  2664. * @brief host -> target ADD WDS Entry
  2665. *
  2666. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2667. *
  2668. * @brief host -> target DELETE WDS Entry
  2669. *
  2670. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2671. *
  2672. * @details
  2673. * HTT wds entry from source port learning
  2674. * Host will learn wds entries from rx and send this message to firmware
  2675. * to enable firmware to configure/delete AST entries for wds clients.
  2676. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2677. * and when SA's entry is deleted, firmware removes this AST entry
  2678. *
  2679. * The message would appear as follows:
  2680. *
  2681. * |31 30|29 |17 16|15 8|7 0|
  2682. * |----------------+----------------+----------------+----------------|
  2683. * | rsvd0 |PDVID| vdev_id | msg_type |
  2684. * |-------------------------------------------------------------------|
  2685. * | sa_addr_31_0 |
  2686. * |-------------------------------------------------------------------|
  2687. * | | ta_peer_id | sa_addr_47_32 |
  2688. * |-------------------------------------------------------------------|
  2689. * Where PDVID = pdev_id
  2690. *
  2691. * The message is interpreted as follows:
  2692. *
  2693. * dword0 - b'0:7 - msg_type: This will be set to
  2694. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2695. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2696. *
  2697. * dword0 - b'8:15 - vdev_id
  2698. *
  2699. * dword0 - b'16:17 - pdev_id
  2700. *
  2701. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2702. *
  2703. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2704. *
  2705. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2706. *
  2707. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2708. */
  2709. PREPACK struct htt_wds_entry {
  2710. A_UINT32
  2711. msg_type: 8,
  2712. vdev_id: 8,
  2713. pdev_id: 2,
  2714. rsvd0: 14;
  2715. A_UINT32 sa_addr_31_0;
  2716. A_UINT32
  2717. sa_addr_47_32: 16,
  2718. ta_peer_id: 14,
  2719. rsvd2: 2;
  2720. } POSTPACK;
  2721. /* DWORD 0 */
  2722. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2723. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2724. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2725. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2726. /* DWORD 2 */
  2727. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2728. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2729. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2730. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2731. /* DWORD 0 */
  2732. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2733. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2734. HTT_WDS_ENTRY_VDEV_ID_S)
  2735. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2736. do { \
  2737. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2738. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2739. } while (0)
  2740. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2741. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2742. HTT_WDS_ENTRY_PDEV_ID_S)
  2743. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2746. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2747. } while (0)
  2748. /* DWORD 2 */
  2749. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2750. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2751. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2752. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2753. do { \
  2754. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2755. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2756. } while (0)
  2757. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2758. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2759. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2760. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2761. do { \
  2762. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2763. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2764. } while (0)
  2765. /**
  2766. * @brief MAC DMA rx ring setup specification
  2767. *
  2768. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2769. *
  2770. * @details
  2771. * To allow for dynamic rx ring reconfiguration and to avoid race
  2772. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2773. * it uses. Instead, it sends this message to the target, indicating how
  2774. * the rx ring used by the host should be set up and maintained.
  2775. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2776. * specifications.
  2777. *
  2778. * |31 16|15 8|7 0|
  2779. * |---------------------------------------------------------------|
  2780. * header: | reserved | num rings | msg type |
  2781. * |---------------------------------------------------------------|
  2782. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2783. #if HTT_PADDR64
  2784. * | FW_IDX shadow register physical address (bits 63:32) |
  2785. #endif
  2786. * |---------------------------------------------------------------|
  2787. * | rx ring base physical address (bits 31:0) |
  2788. #if HTT_PADDR64
  2789. * | rx ring base physical address (bits 63:32) |
  2790. #endif
  2791. * |---------------------------------------------------------------|
  2792. * | rx ring buffer size | rx ring length |
  2793. * |---------------------------------------------------------------|
  2794. * | FW_IDX initial value | enabled flags |
  2795. * |---------------------------------------------------------------|
  2796. * | MSDU payload offset | 802.11 header offset |
  2797. * |---------------------------------------------------------------|
  2798. * | PPDU end offset | PPDU start offset |
  2799. * |---------------------------------------------------------------|
  2800. * | MPDU end offset | MPDU start offset |
  2801. * |---------------------------------------------------------------|
  2802. * | MSDU end offset | MSDU start offset |
  2803. * |---------------------------------------------------------------|
  2804. * | frag info offset | rx attention offset |
  2805. * |---------------------------------------------------------------|
  2806. * payload 2, if present, has the same format as payload 1
  2807. * Header fields:
  2808. * - MSG_TYPE
  2809. * Bits 7:0
  2810. * Purpose: identifies this as an rx ring configuration message
  2811. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2812. * - NUM_RINGS
  2813. * Bits 15:8
  2814. * Purpose: indicates whether the host is setting up one rx ring or two
  2815. * Value: 1 or 2
  2816. * Payload:
  2817. * for systems using 64-bit format for bus addresses:
  2818. * - IDX_SHADOW_REG_PADDR_LO
  2819. * Bits 31:0
  2820. * Value: lower 4 bytes of physical address of the host's
  2821. * FW_IDX shadow register
  2822. * - IDX_SHADOW_REG_PADDR_HI
  2823. * Bits 31:0
  2824. * Value: upper 4 bytes of physical address of the host's
  2825. * FW_IDX shadow register
  2826. * - RING_BASE_PADDR_LO
  2827. * Bits 31:0
  2828. * Value: lower 4 bytes of physical address of the host's rx ring
  2829. * - RING_BASE_PADDR_HI
  2830. * Bits 31:0
  2831. * Value: uppper 4 bytes of physical address of the host's rx ring
  2832. * for systems using 32-bit format for bus addresses:
  2833. * - IDX_SHADOW_REG_PADDR
  2834. * Bits 31:0
  2835. * Value: physical address of the host's FW_IDX shadow register
  2836. * - RING_BASE_PADDR
  2837. * Bits 31:0
  2838. * Value: physical address of the host's rx ring
  2839. * - RING_LEN
  2840. * Bits 15:0
  2841. * Value: number of elements in the rx ring
  2842. * - RING_BUF_SZ
  2843. * Bits 31:16
  2844. * Value: size of the buffers referenced by the rx ring, in byte units
  2845. * - ENABLED_FLAGS
  2846. * Bits 15:0
  2847. * Value: 1-bit flags to show whether different rx fields are enabled
  2848. * bit 0: 802.11 header enabled (1) or disabled (0)
  2849. * bit 1: MSDU payload enabled (1) or disabled (0)
  2850. * bit 2: PPDU start enabled (1) or disabled (0)
  2851. * bit 3: PPDU end enabled (1) or disabled (0)
  2852. * bit 4: MPDU start enabled (1) or disabled (0)
  2853. * bit 5: MPDU end enabled (1) or disabled (0)
  2854. * bit 6: MSDU start enabled (1) or disabled (0)
  2855. * bit 7: MSDU end enabled (1) or disabled (0)
  2856. * bit 8: rx attention enabled (1) or disabled (0)
  2857. * bit 9: frag info enabled (1) or disabled (0)
  2858. * bit 10: unicast rx enabled (1) or disabled (0)
  2859. * bit 11: multicast rx enabled (1) or disabled (0)
  2860. * bit 12: ctrl rx enabled (1) or disabled (0)
  2861. * bit 13: mgmt rx enabled (1) or disabled (0)
  2862. * bit 14: null rx enabled (1) or disabled (0)
  2863. * bit 15: phy data rx enabled (1) or disabled (0)
  2864. * - IDX_INIT_VAL
  2865. * Bits 31:16
  2866. * Purpose: Specify the initial value for the FW_IDX.
  2867. * Value: the number of buffers initially present in the host's rx ring
  2868. * - OFFSET_802_11_HDR
  2869. * Bits 15:0
  2870. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2871. * - OFFSET_MSDU_PAYLOAD
  2872. * Bits 31:16
  2873. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2874. * - OFFSET_PPDU_START
  2875. * Bits 15:0
  2876. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2877. * - OFFSET_PPDU_END
  2878. * Bits 31:16
  2879. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2880. * - OFFSET_MPDU_START
  2881. * Bits 15:0
  2882. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2883. * - OFFSET_MPDU_END
  2884. * Bits 31:16
  2885. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2886. * - OFFSET_MSDU_START
  2887. * Bits 15:0
  2888. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2889. * - OFFSET_MSDU_END
  2890. * Bits 31:16
  2891. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2892. * - OFFSET_RX_ATTN
  2893. * Bits 15:0
  2894. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2895. * - OFFSET_FRAG_INFO
  2896. * Bits 31:16
  2897. * Value: offset in QUAD-bytes of frag info table
  2898. */
  2899. /* header fields */
  2900. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2901. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2902. /* payload fields */
  2903. /* for systems using a 64-bit format for bus addresses */
  2904. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2905. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2906. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2907. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2908. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2909. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2910. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2911. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2912. /* for systems using a 32-bit format for bus addresses */
  2913. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2914. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2915. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2916. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2917. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2918. #define HTT_RX_RING_CFG_LEN_S 0
  2919. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2920. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2921. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2922. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2923. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2924. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2925. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2926. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2927. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2928. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2929. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2930. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2931. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2932. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2933. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2934. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2935. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2936. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2937. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2938. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2939. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2940. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2941. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2942. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2943. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2944. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2945. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2946. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2947. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2948. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2949. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2950. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2951. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2952. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2953. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2954. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2955. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2956. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2957. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2959. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2960. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2961. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2962. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2963. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2964. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2965. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2966. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2967. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2968. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2969. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2970. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2971. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2972. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2973. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2974. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2975. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2976. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2977. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2978. #if HTT_PADDR64
  2979. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2980. #else
  2981. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2982. #endif
  2983. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2984. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2985. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2986. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2987. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2988. do { \
  2989. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2990. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2991. } while (0)
  2992. /* degenerate case for 32-bit fields */
  2993. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2994. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2995. ((_var) = (_val))
  2996. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2997. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2998. ((_var) = (_val))
  2999. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3000. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3001. ((_var) = (_val))
  3002. /* degenerate case for 32-bit fields */
  3003. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3004. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3005. ((_var) = (_val))
  3006. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3007. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3008. ((_var) = (_val))
  3009. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3010. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3011. ((_var) = (_val))
  3012. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3013. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3014. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3015. do { \
  3016. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3017. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3018. } while (0)
  3019. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3020. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3021. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3022. do { \
  3023. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3024. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3025. } while (0)
  3026. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3027. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3028. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3029. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3030. do { \
  3031. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3032. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3033. } while (0)
  3034. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3035. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3036. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3037. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3038. do { \
  3039. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3040. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3041. } while (0)
  3042. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3043. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3044. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3045. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3046. do { \
  3047. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3048. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3049. } while (0)
  3050. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3051. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3052. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3053. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3054. do { \
  3055. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3056. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3057. } while (0)
  3058. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3059. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3060. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3061. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3062. do { \
  3063. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3064. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3065. } while (0)
  3066. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3067. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3068. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3069. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3070. do { \
  3071. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3072. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3073. } while (0)
  3074. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3075. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3076. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3077. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3078. do { \
  3079. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3080. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3081. } while (0)
  3082. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3083. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3084. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3085. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3086. do { \
  3087. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3088. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3089. } while (0)
  3090. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3091. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3092. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3093. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3094. do { \
  3095. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3096. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3097. } while (0)
  3098. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3099. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3100. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3101. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3102. do { \
  3103. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3104. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3105. } while (0)
  3106. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3107. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3108. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3109. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3110. do { \
  3111. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3112. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3113. } while (0)
  3114. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3115. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3116. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3117. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3118. do { \
  3119. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3120. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3121. } while (0)
  3122. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3123. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3124. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3125. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3126. do { \
  3127. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3128. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3129. } while (0)
  3130. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3131. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3132. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3133. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3134. do { \
  3135. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3136. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3137. } while (0)
  3138. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3139. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3140. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3141. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3142. do { \
  3143. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3144. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3145. } while (0)
  3146. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3147. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3148. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3149. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3150. do { \
  3151. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3152. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3153. } while (0)
  3154. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3155. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3156. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3157. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3158. do { \
  3159. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3160. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3161. } while (0)
  3162. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3163. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3164. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3165. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3166. do { \
  3167. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3168. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3169. } while (0)
  3170. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3171. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3172. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3173. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3174. do { \
  3175. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3176. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3177. } while (0)
  3178. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3179. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3180. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3181. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3182. do { \
  3183. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3184. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3185. } while (0)
  3186. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3187. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3188. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3189. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3190. do { \
  3191. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3192. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3193. } while (0)
  3194. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3195. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3196. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3197. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3198. do { \
  3199. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3200. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3201. } while (0)
  3202. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3203. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3204. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3205. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3206. do { \
  3207. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3208. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3209. } while (0)
  3210. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3211. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3212. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3213. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3214. do { \
  3215. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3216. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3217. } while (0)
  3218. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3219. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3220. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3221. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3222. do { \
  3223. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3224. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3225. } while (0)
  3226. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3227. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3228. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3229. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3230. do { \
  3231. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3232. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3233. } while (0)
  3234. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3235. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3236. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3237. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3238. do { \
  3239. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3240. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3241. } while (0)
  3242. /**
  3243. * @brief host -> target FW statistics retrieve
  3244. *
  3245. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3246. *
  3247. * @details
  3248. * The following field definitions describe the format of the HTT host
  3249. * to target FW stats retrieve message. The message specifies the type of
  3250. * stats host wants to retrieve.
  3251. *
  3252. * |31 24|23 16|15 8|7 0|
  3253. * |-----------------------------------------------------------|
  3254. * | stats types request bitmask | msg type |
  3255. * |-----------------------------------------------------------|
  3256. * | stats types reset bitmask | reserved |
  3257. * |-----------------------------------------------------------|
  3258. * | stats type | config value |
  3259. * |-----------------------------------------------------------|
  3260. * | cookie LSBs |
  3261. * |-----------------------------------------------------------|
  3262. * | cookie MSBs |
  3263. * |-----------------------------------------------------------|
  3264. * Header fields:
  3265. * - MSG_TYPE
  3266. * Bits 7:0
  3267. * Purpose: identifies this is a stats upload request message
  3268. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3269. * - UPLOAD_TYPES
  3270. * Bits 31:8
  3271. * Purpose: identifies which types of FW statistics to upload
  3272. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3273. * - RESET_TYPES
  3274. * Bits 31:8
  3275. * Purpose: identifies which types of FW statistics to reset
  3276. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3277. * - CFG_VAL
  3278. * Bits 23:0
  3279. * Purpose: give an opaque configuration value to the specified stats type
  3280. * Value: stats-type specific configuration value
  3281. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3282. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3283. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3284. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3285. * - CFG_STAT_TYPE
  3286. * Bits 31:24
  3287. * Purpose: specify which stats type (if any) the config value applies to
  3288. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3289. * a valid configuration specification
  3290. * - COOKIE_LSBS
  3291. * Bits 31:0
  3292. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3293. * message with its preceding host->target stats request message.
  3294. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3295. * - COOKIE_MSBS
  3296. * Bits 31:0
  3297. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3298. * message with its preceding host->target stats request message.
  3299. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3300. */
  3301. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3302. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3303. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3304. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3305. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3306. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3307. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3308. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3309. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3310. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3311. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3312. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3313. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3314. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3315. do { \
  3316. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3317. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3318. } while (0)
  3319. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3320. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3321. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3322. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3323. do { \
  3324. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3325. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3326. } while (0)
  3327. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3328. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3329. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3330. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3331. do { \
  3332. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3333. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3334. } while (0)
  3335. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3336. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3337. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3338. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3339. do { \
  3340. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3341. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3342. } while (0)
  3343. /**
  3344. * @brief host -> target HTT out-of-band sync request
  3345. *
  3346. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3347. *
  3348. * @details
  3349. * The HTT SYNC tells the target to suspend processing of subsequent
  3350. * HTT host-to-target messages until some other target agent locally
  3351. * informs the target HTT FW that the current sync counter is equal to
  3352. * or greater than (in a modulo sense) the sync counter specified in
  3353. * the SYNC message.
  3354. * This allows other host-target components to synchronize their operation
  3355. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3356. * security key has been downloaded to and activated by the target.
  3357. * In the absence of any explicit synchronization counter value
  3358. * specification, the target HTT FW will use zero as the default current
  3359. * sync value.
  3360. *
  3361. * |31 24|23 16|15 8|7 0|
  3362. * |-----------------------------------------------------------|
  3363. * | reserved | sync count | msg type |
  3364. * |-----------------------------------------------------------|
  3365. * Header fields:
  3366. * - MSG_TYPE
  3367. * Bits 7:0
  3368. * Purpose: identifies this as a sync message
  3369. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3370. * - SYNC_COUNT
  3371. * Bits 15:8
  3372. * Purpose: specifies what sync value the HTT FW will wait for from
  3373. * an out-of-band specification to resume its operation
  3374. * Value: in-band sync counter value to compare against the out-of-band
  3375. * counter spec.
  3376. * The HTT target FW will suspend its host->target message processing
  3377. * as long as
  3378. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3379. */
  3380. #define HTT_H2T_SYNC_MSG_SZ 4
  3381. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3382. #define HTT_H2T_SYNC_COUNT_S 8
  3383. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3384. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3385. HTT_H2T_SYNC_COUNT_S)
  3386. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3387. do { \
  3388. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3389. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3390. } while (0)
  3391. /**
  3392. * @brief host -> target HTT aggregation configuration
  3393. *
  3394. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3395. */
  3396. #define HTT_AGGR_CFG_MSG_SZ 4
  3397. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3398. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3399. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3400. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3401. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3402. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3403. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3404. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3405. do { \
  3406. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3407. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3408. } while (0)
  3409. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3410. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3411. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3412. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3413. do { \
  3414. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3415. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3416. } while (0)
  3417. /**
  3418. * @brief host -> target HTT configure max amsdu info per vdev
  3419. *
  3420. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3421. *
  3422. * @details
  3423. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3424. *
  3425. * |31 21|20 16|15 8|7 0|
  3426. * |-----------------------------------------------------------|
  3427. * | reserved | vdev id | max amsdu | msg type |
  3428. * |-----------------------------------------------------------|
  3429. * Header fields:
  3430. * - MSG_TYPE
  3431. * Bits 7:0
  3432. * Purpose: identifies this as a aggr cfg ex message
  3433. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3434. * - MAX_NUM_AMSDU_SUBFRM
  3435. * Bits 15:8
  3436. * Purpose: max MSDUs per A-MSDU
  3437. * - VDEV_ID
  3438. * Bits 20:16
  3439. * Purpose: ID of the vdev to which this limit is applied
  3440. */
  3441. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3442. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3443. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3444. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3445. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3446. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3447. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3448. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3449. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3450. do { \
  3451. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3452. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3453. } while (0)
  3454. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3455. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3456. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3457. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3458. do { \
  3459. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3460. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3461. } while (0)
  3462. /**
  3463. * @brief HTT WDI_IPA Config Message
  3464. *
  3465. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3466. *
  3467. * @details
  3468. * The HTT WDI_IPA config message is created/sent by host at driver
  3469. * init time. It contains information about data structures used on
  3470. * WDI_IPA TX and RX path.
  3471. * TX CE ring is used for pushing packet metadata from IPA uC
  3472. * to WLAN FW
  3473. * TX Completion ring is used for generating TX completions from
  3474. * WLAN FW to IPA uC
  3475. * RX Indication ring is used for indicating RX packets from FW
  3476. * to IPA uC
  3477. * RX Ring2 is used as either completion ring or as second
  3478. * indication ring. when Ring2 is used as completion ring, IPA uC
  3479. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3480. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3481. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3482. * indicated in RX Indication ring. Please see WDI_IPA specification
  3483. * for more details.
  3484. * |31 24|23 16|15 8|7 0|
  3485. * |----------------+----------------+----------------+----------------|
  3486. * | tx pkt pool size | Rsvd | msg_type |
  3487. * |-------------------------------------------------------------------|
  3488. * | tx comp ring base (bits 31:0) |
  3489. #if HTT_PADDR64
  3490. * | tx comp ring base (bits 63:32) |
  3491. #endif
  3492. * |-------------------------------------------------------------------|
  3493. * | tx comp ring size |
  3494. * |-------------------------------------------------------------------|
  3495. * | tx comp WR_IDX physical address (bits 31:0) |
  3496. #if HTT_PADDR64
  3497. * | tx comp WR_IDX physical address (bits 63:32) |
  3498. #endif
  3499. * |-------------------------------------------------------------------|
  3500. * | tx CE WR_IDX physical address (bits 31:0) |
  3501. #if HTT_PADDR64
  3502. * | tx CE WR_IDX physical address (bits 63:32) |
  3503. #endif
  3504. * |-------------------------------------------------------------------|
  3505. * | rx indication ring base (bits 31:0) |
  3506. #if HTT_PADDR64
  3507. * | rx indication ring base (bits 63:32) |
  3508. #endif
  3509. * |-------------------------------------------------------------------|
  3510. * | rx indication ring size |
  3511. * |-------------------------------------------------------------------|
  3512. * | rx ind RD_IDX physical address (bits 31:0) |
  3513. #if HTT_PADDR64
  3514. * | rx ind RD_IDX physical address (bits 63:32) |
  3515. #endif
  3516. * |-------------------------------------------------------------------|
  3517. * | rx ind WR_IDX physical address (bits 31:0) |
  3518. #if HTT_PADDR64
  3519. * | rx ind WR_IDX physical address (bits 63:32) |
  3520. #endif
  3521. * |-------------------------------------------------------------------|
  3522. * |-------------------------------------------------------------------|
  3523. * | rx ring2 base (bits 31:0) |
  3524. #if HTT_PADDR64
  3525. * | rx ring2 base (bits 63:32) |
  3526. #endif
  3527. * |-------------------------------------------------------------------|
  3528. * | rx ring2 size |
  3529. * |-------------------------------------------------------------------|
  3530. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3531. #if HTT_PADDR64
  3532. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3533. #endif
  3534. * |-------------------------------------------------------------------|
  3535. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3536. #if HTT_PADDR64
  3537. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3538. #endif
  3539. * |-------------------------------------------------------------------|
  3540. *
  3541. * Header fields:
  3542. * Header fields:
  3543. * - MSG_TYPE
  3544. * Bits 7:0
  3545. * Purpose: Identifies this as WDI_IPA config message
  3546. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3547. * - TX_PKT_POOL_SIZE
  3548. * Bits 15:0
  3549. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3550. * WDI_IPA TX path
  3551. * For systems using 32-bit format for bus addresses:
  3552. * - TX_COMP_RING_BASE_ADDR
  3553. * Bits 31:0
  3554. * Purpose: TX Completion Ring base address in DDR
  3555. * - TX_COMP_RING_SIZE
  3556. * Bits 31:0
  3557. * Purpose: TX Completion Ring size (must be power of 2)
  3558. * - TX_COMP_WR_IDX_ADDR
  3559. * Bits 31:0
  3560. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3561. * updates the Write Index for WDI_IPA TX completion ring
  3562. * - TX_CE_WR_IDX_ADDR
  3563. * Bits 31:0
  3564. * Purpose: DDR address where IPA uC
  3565. * updates the WR Index for TX CE ring
  3566. * (needed for fusion platforms)
  3567. * - RX_IND_RING_BASE_ADDR
  3568. * Bits 31:0
  3569. * Purpose: RX Indication Ring base address in DDR
  3570. * - RX_IND_RING_SIZE
  3571. * Bits 31:0
  3572. * Purpose: RX Indication Ring size
  3573. * - RX_IND_RD_IDX_ADDR
  3574. * Bits 31:0
  3575. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3576. * RX indication ring
  3577. * - RX_IND_WR_IDX_ADDR
  3578. * Bits 31:0
  3579. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3580. * updates the Write Index for WDI_IPA RX indication ring
  3581. * - RX_RING2_BASE_ADDR
  3582. * Bits 31:0
  3583. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3584. * - RX_RING2_SIZE
  3585. * Bits 31:0
  3586. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3587. * - RX_RING2_RD_IDX_ADDR
  3588. * Bits 31:0
  3589. * Purpose: If Second RX ring is Indication ring, DDR address where
  3590. * IPA uC updates the Read Index for Ring2.
  3591. * If Second RX ring is completion ring, this is NOT used
  3592. * - RX_RING2_WR_IDX_ADDR
  3593. * Bits 31:0
  3594. * Purpose: If Second RX ring is Indication ring, DDR address where
  3595. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3596. * If second RX ring is completion ring, DDR address where
  3597. * IPA uC updates the Write Index for Ring 2.
  3598. * For systems using 64-bit format for bus addresses:
  3599. * - TX_COMP_RING_BASE_ADDR_LO
  3600. * Bits 31:0
  3601. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3602. * - TX_COMP_RING_BASE_ADDR_HI
  3603. * Bits 31:0
  3604. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3605. * - TX_COMP_RING_SIZE
  3606. * Bits 31:0
  3607. * Purpose: TX Completion Ring size (must be power of 2)
  3608. * - TX_COMP_WR_IDX_ADDR_LO
  3609. * Bits 31:0
  3610. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3611. * Lower 4 bytes of DDR address where WIFI FW
  3612. * updates the Write Index for WDI_IPA TX completion ring
  3613. * - TX_COMP_WR_IDX_ADDR_HI
  3614. * Bits 31:0
  3615. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3616. * Higher 4 bytes of DDR address where WIFI FW
  3617. * updates the Write Index for WDI_IPA TX completion ring
  3618. * - TX_CE_WR_IDX_ADDR_LO
  3619. * Bits 31:0
  3620. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3621. * updates the WR Index for TX CE ring
  3622. * (needed for fusion platforms)
  3623. * - TX_CE_WR_IDX_ADDR_HI
  3624. * Bits 31:0
  3625. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3626. * updates the WR Index for TX CE ring
  3627. * (needed for fusion platforms)
  3628. * - RX_IND_RING_BASE_ADDR_LO
  3629. * Bits 31:0
  3630. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3631. * - RX_IND_RING_BASE_ADDR_HI
  3632. * Bits 31:0
  3633. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3634. * - RX_IND_RING_SIZE
  3635. * Bits 31:0
  3636. * Purpose: RX Indication Ring size
  3637. * - RX_IND_RD_IDX_ADDR_LO
  3638. * Bits 31:0
  3639. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3640. * for WDI_IPA RX indication ring
  3641. * - RX_IND_RD_IDX_ADDR_HI
  3642. * Bits 31:0
  3643. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3644. * for WDI_IPA RX indication ring
  3645. * - RX_IND_WR_IDX_ADDR_LO
  3646. * Bits 31:0
  3647. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3648. * Lower 4 bytes of DDR address where WIFI FW
  3649. * updates the Write Index for WDI_IPA RX indication ring
  3650. * - RX_IND_WR_IDX_ADDR_HI
  3651. * Bits 31:0
  3652. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3653. * Higher 4 bytes of DDR address where WIFI FW
  3654. * updates the Write Index for WDI_IPA RX indication ring
  3655. * - RX_RING2_BASE_ADDR_LO
  3656. * Bits 31:0
  3657. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3658. * - RX_RING2_BASE_ADDR_HI
  3659. * Bits 31:0
  3660. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3661. * - RX_RING2_SIZE
  3662. * Bits 31:0
  3663. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3664. * - RX_RING2_RD_IDX_ADDR_LO
  3665. * Bits 31:0
  3666. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3667. * DDR address where IPA uC updates the Read Index for Ring2.
  3668. * If Second RX ring is completion ring, this is NOT used
  3669. * - RX_RING2_RD_IDX_ADDR_HI
  3670. * Bits 31:0
  3671. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3672. * DDR address where IPA uC updates the Read Index for Ring2.
  3673. * If Second RX ring is completion ring, this is NOT used
  3674. * - RX_RING2_WR_IDX_ADDR_LO
  3675. * Bits 31:0
  3676. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3677. * DDR address where WIFI FW updates the Write Index
  3678. * for WDI_IPA RX ring2
  3679. * If second RX ring is completion ring, lower 4 bytes of
  3680. * DDR address where IPA uC updates the Write Index for Ring 2.
  3681. * - RX_RING2_WR_IDX_ADDR_HI
  3682. * Bits 31:0
  3683. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3684. * DDR address where WIFI FW updates the Write Index
  3685. * for WDI_IPA RX ring2
  3686. * If second RX ring is completion ring, higher 4 bytes of
  3687. * DDR address where IPA uC updates the Write Index for Ring 2.
  3688. */
  3689. #if HTT_PADDR64
  3690. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3691. #else
  3692. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3693. #endif
  3694. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3695. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3698. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3699. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3700. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3701. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3702. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3705. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3706. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3707. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3708. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3709. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3710. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3711. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3712. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3713. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3714. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3715. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3718. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3719. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3720. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3721. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3722. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3725. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3726. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3727. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3728. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3729. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3730. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3731. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3732. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3733. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3734. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3735. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3753. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3754. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3755. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3756. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3757. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3758. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3759. do { \
  3760. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3761. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3762. } while (0)
  3763. /* for systems using 32-bit format for bus addr */
  3764. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3765. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3766. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3767. do { \
  3768. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3769. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3770. } while (0)
  3771. /* for systems using 64-bit format for bus addr */
  3772. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3773. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3774. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3775. do { \
  3776. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3777. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3778. } while (0)
  3779. /* for systems using 64-bit format for bus addr */
  3780. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3781. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3782. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3783. do { \
  3784. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3785. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3786. } while (0)
  3787. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3788. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3789. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3792. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3793. } while (0)
  3794. /* for systems using 32-bit format for bus addr */
  3795. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3796. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3797. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3798. do { \
  3799. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3800. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3801. } while (0)
  3802. /* for systems using 64-bit format for bus addr */
  3803. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3804. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3805. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3806. do { \
  3807. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3808. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3809. } while (0)
  3810. /* for systems using 64-bit format for bus addr */
  3811. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3812. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3813. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3814. do { \
  3815. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3816. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3817. } while (0)
  3818. /* for systems using 32-bit format for bus addr */
  3819. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3820. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3821. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3822. do { \
  3823. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3824. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3825. } while (0)
  3826. /* for systems using 64-bit format for bus addr */
  3827. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3828. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3829. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3830. do { \
  3831. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3832. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3833. } while (0)
  3834. /* for systems using 64-bit format for bus addr */
  3835. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3836. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3837. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3838. do { \
  3839. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3840. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3841. } while (0)
  3842. /* for systems using 32-bit format for bus addr */
  3843. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3844. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3845. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3846. do { \
  3847. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3848. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3849. } while (0)
  3850. /* for systems using 64-bit format for bus addr */
  3851. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3852. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3853. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3854. do { \
  3855. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3856. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3857. } while (0)
  3858. /* for systems using 64-bit format for bus addr */
  3859. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3860. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3861. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3862. do { \
  3863. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3864. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3865. } while (0)
  3866. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3867. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3868. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3869. do { \
  3870. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3871. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3872. } while (0)
  3873. /* for systems using 32-bit format for bus addr */
  3874. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3875. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3876. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3877. do { \
  3878. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3879. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3880. } while (0)
  3881. /* for systems using 64-bit format for bus addr */
  3882. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3883. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3884. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3885. do { \
  3886. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3887. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3888. } while (0)
  3889. /* for systems using 64-bit format for bus addr */
  3890. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3891. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3892. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3893. do { \
  3894. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3895. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3896. } while (0)
  3897. /* for systems using 32-bit format for bus addr */
  3898. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3899. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3900. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3901. do { \
  3902. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3903. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3904. } while (0)
  3905. /* for systems using 64-bit format for bus addr */
  3906. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3907. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3908. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3909. do { \
  3910. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3911. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3912. } while (0)
  3913. /* for systems using 64-bit format for bus addr */
  3914. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3915. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3916. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3917. do { \
  3918. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3919. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3920. } while (0)
  3921. /* for systems using 32-bit format for bus addr */
  3922. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3923. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3924. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3925. do { \
  3926. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3927. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3928. } while (0)
  3929. /* for systems using 64-bit format for bus addr */
  3930. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3931. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3932. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3933. do { \
  3934. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3935. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3936. } while (0)
  3937. /* for systems using 64-bit format for bus addr */
  3938. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3939. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3940. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3941. do { \
  3942. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3943. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3944. } while (0)
  3945. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3946. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3947. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3948. do { \
  3949. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3950. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3951. } while (0)
  3952. /* for systems using 32-bit format for bus addr */
  3953. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3954. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3955. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3956. do { \
  3957. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3958. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3959. } while (0)
  3960. /* for systems using 64-bit format for bus addr */
  3961. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3962. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3963. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3964. do { \
  3965. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3966. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3967. } while (0)
  3968. /* for systems using 64-bit format for bus addr */
  3969. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3970. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3971. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3972. do { \
  3973. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3974. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3975. } while (0)
  3976. /* for systems using 32-bit format for bus addr */
  3977. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3978. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3979. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3980. do { \
  3981. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3982. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3983. } while (0)
  3984. /* for systems using 64-bit format for bus addr */
  3985. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3986. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3987. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3988. do { \
  3989. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3990. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3991. } while (0)
  3992. /* for systems using 64-bit format for bus addr */
  3993. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3994. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3995. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3996. do { \
  3997. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3998. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3999. } while (0)
  4000. /*
  4001. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4002. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4003. * addresses are stored in a XXX-bit field.
  4004. * This macro is used to define both htt_wdi_ipa_config32_t and
  4005. * htt_wdi_ipa_config64_t structs.
  4006. */
  4007. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4008. _paddr__tx_comp_ring_base_addr_, \
  4009. _paddr__tx_comp_wr_idx_addr_, \
  4010. _paddr__tx_ce_wr_idx_addr_, \
  4011. _paddr__rx_ind_ring_base_addr_, \
  4012. _paddr__rx_ind_rd_idx_addr_, \
  4013. _paddr__rx_ind_wr_idx_addr_, \
  4014. _paddr__rx_ring2_base_addr_,\
  4015. _paddr__rx_ring2_rd_idx_addr_,\
  4016. _paddr__rx_ring2_wr_idx_addr_) \
  4017. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4018. { \
  4019. /* DWORD 0: flags and meta-data */ \
  4020. A_UINT32 \
  4021. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4022. reserved: 8, \
  4023. tx_pkt_pool_size: 16;\
  4024. /* DWORD 1 */\
  4025. _paddr__tx_comp_ring_base_addr_;\
  4026. /* DWORD 2 (or 3)*/\
  4027. A_UINT32 tx_comp_ring_size;\
  4028. /* DWORD 3 (or 4)*/\
  4029. _paddr__tx_comp_wr_idx_addr_;\
  4030. /* DWORD 4 (or 6)*/\
  4031. _paddr__tx_ce_wr_idx_addr_;\
  4032. /* DWORD 5 (or 8)*/\
  4033. _paddr__rx_ind_ring_base_addr_;\
  4034. /* DWORD 6 (or 10)*/\
  4035. A_UINT32 rx_ind_ring_size;\
  4036. /* DWORD 7 (or 11)*/\
  4037. _paddr__rx_ind_rd_idx_addr_;\
  4038. /* DWORD 8 (or 13)*/\
  4039. _paddr__rx_ind_wr_idx_addr_;\
  4040. /* DWORD 9 (or 15)*/\
  4041. _paddr__rx_ring2_base_addr_;\
  4042. /* DWORD 10 (or 17) */\
  4043. A_UINT32 rx_ring2_size;\
  4044. /* DWORD 11 (or 18) */\
  4045. _paddr__rx_ring2_rd_idx_addr_;\
  4046. /* DWORD 12 (or 20) */\
  4047. _paddr__rx_ring2_wr_idx_addr_;\
  4048. } POSTPACK
  4049. /* define a htt_wdi_ipa_config32_t type */
  4050. 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));
  4051. /* define a htt_wdi_ipa_config64_t type */
  4052. 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));
  4053. #if HTT_PADDR64
  4054. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4055. #else
  4056. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4057. #endif
  4058. enum htt_wdi_ipa_op_code {
  4059. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4060. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4061. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4062. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4063. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4064. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4065. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4066. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4067. /* keep this last */
  4068. HTT_WDI_IPA_OPCODE_MAX
  4069. };
  4070. /**
  4071. * @brief HTT WDI_IPA Operation Request Message
  4072. *
  4073. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4074. *
  4075. * @details
  4076. * HTT WDI_IPA Operation Request message is sent by host
  4077. * to either suspend or resume WDI_IPA TX or RX path.
  4078. * |31 24|23 16|15 8|7 0|
  4079. * |----------------+----------------+----------------+----------------|
  4080. * | op_code | Rsvd | msg_type |
  4081. * |-------------------------------------------------------------------|
  4082. *
  4083. * Header fields:
  4084. * - MSG_TYPE
  4085. * Bits 7:0
  4086. * Purpose: Identifies this as WDI_IPA Operation Request message
  4087. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4088. * - OP_CODE
  4089. * Bits 31:16
  4090. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4091. * value: = enum htt_wdi_ipa_op_code
  4092. */
  4093. PREPACK struct htt_wdi_ipa_op_request_t
  4094. {
  4095. /* DWORD 0: flags and meta-data */
  4096. A_UINT32
  4097. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4098. reserved: 8,
  4099. op_code: 16;
  4100. } POSTPACK;
  4101. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4102. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4103. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4104. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4105. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4106. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4109. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4110. } while (0)
  4111. /*
  4112. * @brief host -> target HTT_SRING_SETUP message
  4113. *
  4114. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4115. *
  4116. * @details
  4117. * After target is booted up, Host can send SRING setup message for
  4118. * each host facing LMAC SRING. Target setups up HW registers based
  4119. * on setup message and confirms back to Host if response_required is set.
  4120. * Host should wait for confirmation message before sending new SRING
  4121. * setup message
  4122. *
  4123. * The message would appear as follows:
  4124. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4125. * |--------------- +-----------------+-----------------+-----------------|
  4126. * | ring_type | ring_id | pdev_id | msg_type |
  4127. * |----------------------------------------------------------------------|
  4128. * | ring_base_addr_lo |
  4129. * |----------------------------------------------------------------------|
  4130. * | ring_base_addr_hi |
  4131. * |----------------------------------------------------------------------|
  4132. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4133. * |----------------------------------------------------------------------|
  4134. * | ring_head_offset32_remote_addr_lo |
  4135. * |----------------------------------------------------------------------|
  4136. * | ring_head_offset32_remote_addr_hi |
  4137. * |----------------------------------------------------------------------|
  4138. * | ring_tail_offset32_remote_addr_lo |
  4139. * |----------------------------------------------------------------------|
  4140. * | ring_tail_offset32_remote_addr_hi |
  4141. * |----------------------------------------------------------------------|
  4142. * | ring_msi_addr_lo |
  4143. * |----------------------------------------------------------------------|
  4144. * | ring_msi_addr_hi |
  4145. * |----------------------------------------------------------------------|
  4146. * | ring_msi_data |
  4147. * |----------------------------------------------------------------------|
  4148. * | intr_timer_th |IM| intr_batch_counter_th |
  4149. * |----------------------------------------------------------------------|
  4150. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4151. * |----------------------------------------------------------------------|
  4152. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4153. * |----------------------------------------------------------------------|
  4154. * Where
  4155. * IM = sw_intr_mode
  4156. * RR = response_required
  4157. * PTCF = prefetch_timer_cfg
  4158. * IP = IPA drop flag
  4159. *
  4160. * The message is interpreted as follows:
  4161. * dword0 - b'0:7 - msg_type: This will be set to
  4162. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4163. * b'8:15 - pdev_id:
  4164. * 0 (for rings at SOC/UMAC level),
  4165. * 1/2/3 mac id (for rings at LMAC level)
  4166. * b'16:23 - ring_id: identify which ring is to setup,
  4167. * more details can be got from enum htt_srng_ring_id
  4168. * b'24:31 - ring_type: identify type of host rings,
  4169. * more details can be got from enum htt_srng_ring_type
  4170. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4171. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4172. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4173. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4174. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4175. * SW_TO_HW_RING.
  4176. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4177. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4178. * Lower 32 bits of memory address of the remote variable
  4179. * storing the 4-byte word offset that identifies the head
  4180. * element within the ring.
  4181. * (The head offset variable has type A_UINT32.)
  4182. * Valid for HW_TO_SW and SW_TO_SW rings.
  4183. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4184. * Upper 32 bits of memory address of the remote variable
  4185. * storing the 4-byte word offset that identifies the head
  4186. * element within the ring.
  4187. * (The head offset variable has type A_UINT32.)
  4188. * Valid for HW_TO_SW and SW_TO_SW rings.
  4189. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4190. * Lower 32 bits of memory address of the remote variable
  4191. * storing the 4-byte word offset that identifies the tail
  4192. * element within the ring.
  4193. * (The tail offset variable has type A_UINT32.)
  4194. * Valid for HW_TO_SW and SW_TO_SW rings.
  4195. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4196. * Upper 32 bits of memory address of the remote variable
  4197. * storing the 4-byte word offset that identifies the tail
  4198. * element within the ring.
  4199. * (The tail offset variable has type A_UINT32.)
  4200. * Valid for HW_TO_SW and SW_TO_SW rings.
  4201. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4202. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4203. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4204. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4205. * dword10 - b'0:31 - ring_msi_data: MSI data
  4206. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4207. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4208. * dword11 - b'0:14 - intr_batch_counter_th:
  4209. * batch counter threshold is in units of 4-byte words.
  4210. * HW internally maintains and increments batch count.
  4211. * (see SRING spec for detail description).
  4212. * When batch count reaches threshold value, an interrupt
  4213. * is generated by HW.
  4214. * b'15 - sw_intr_mode:
  4215. * This configuration shall be static.
  4216. * Only programmed at power up.
  4217. * 0: generate pulse style sw interrupts
  4218. * 1: generate level style sw interrupts
  4219. * b'16:31 - intr_timer_th:
  4220. * The timer init value when timer is idle or is
  4221. * initialized to start downcounting.
  4222. * In 8us units (to cover a range of 0 to 524 ms)
  4223. * dword12 - b'0:15 - intr_low_threshold:
  4224. * Used only by Consumer ring to generate ring_sw_int_p.
  4225. * Ring entries low threshold water mark, that is used
  4226. * in combination with the interrupt timer as well as
  4227. * the the clearing of the level interrupt.
  4228. * b'16:18 - prefetch_timer_cfg:
  4229. * Used only by Consumer ring to set timer mode to
  4230. * support Application prefetch handling.
  4231. * The external tail offset/pointer will be updated
  4232. * at following intervals:
  4233. * 3'b000: (Prefetch feature disabled; used only for debug)
  4234. * 3'b001: 1 usec
  4235. * 3'b010: 4 usec
  4236. * 3'b011: 8 usec (default)
  4237. * 3'b100: 16 usec
  4238. * Others: Reserverd
  4239. * b'19 - response_required:
  4240. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4241. * b'20 - ipa_drop_flag:
  4242. Indicates that host will config ipa drop threshold percentage
  4243. * b'21:31 - reserved: reserved for future use
  4244. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4245. * b'8:15 - ipa drop high threshold percentage:
  4246. * b'16:31 - Reserved
  4247. */
  4248. PREPACK struct htt_sring_setup_t {
  4249. A_UINT32 msg_type: 8,
  4250. pdev_id: 8,
  4251. ring_id: 8,
  4252. ring_type: 8;
  4253. A_UINT32 ring_base_addr_lo;
  4254. A_UINT32 ring_base_addr_hi;
  4255. A_UINT32 ring_size: 16,
  4256. ring_entry_size: 8,
  4257. ring_misc_cfg_flag: 8;
  4258. A_UINT32 ring_head_offset32_remote_addr_lo;
  4259. A_UINT32 ring_head_offset32_remote_addr_hi;
  4260. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4261. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4262. A_UINT32 ring_msi_addr_lo;
  4263. A_UINT32 ring_msi_addr_hi;
  4264. A_UINT32 ring_msi_data;
  4265. A_UINT32 intr_batch_counter_th: 15,
  4266. sw_intr_mode: 1,
  4267. intr_timer_th: 16;
  4268. A_UINT32 intr_low_threshold: 16,
  4269. prefetch_timer_cfg: 3,
  4270. response_required: 1,
  4271. ipa_drop_flag: 1,
  4272. reserved1: 11;
  4273. A_UINT32 ipa_drop_low_threshold: 8,
  4274. ipa_drop_high_threshold: 8,
  4275. reserved: 16;
  4276. } POSTPACK;
  4277. enum htt_srng_ring_type {
  4278. HTT_HW_TO_SW_RING = 0,
  4279. HTT_SW_TO_HW_RING,
  4280. HTT_SW_TO_SW_RING,
  4281. /* Insert new ring types above this line */
  4282. };
  4283. enum htt_srng_ring_id {
  4284. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4285. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4286. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4287. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4288. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4289. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4290. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4291. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4292. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4293. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4294. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4295. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4296. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4297. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4298. HTT_RX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4299. /* Add Other SRING which can't be directly configured by host software above this line */
  4300. };
  4301. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4302. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4303. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4304. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4305. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4306. HTT_SRING_SETUP_PDEV_ID_S)
  4307. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4308. do { \
  4309. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4310. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4311. } while (0)
  4312. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4313. #define HTT_SRING_SETUP_RING_ID_S 16
  4314. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4315. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4316. HTT_SRING_SETUP_RING_ID_S)
  4317. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4318. do { \
  4319. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4320. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4321. } while (0)
  4322. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4323. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4324. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4325. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4326. HTT_SRING_SETUP_RING_TYPE_S)
  4327. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4328. do { \
  4329. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4330. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4331. } while (0)
  4332. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4333. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4334. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4335. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4336. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4337. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4338. do { \
  4339. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4340. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4341. } while (0)
  4342. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4343. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4344. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4345. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4346. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4347. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4348. do { \
  4349. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4350. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4351. } while (0)
  4352. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4353. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4354. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4355. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4356. HTT_SRING_SETUP_RING_SIZE_S)
  4357. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4358. do { \
  4359. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4360. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4361. } while (0)
  4362. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4363. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4364. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4365. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4366. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4367. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4368. do { \
  4369. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4370. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4371. } while (0)
  4372. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4373. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4374. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4375. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4376. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4377. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4378. do { \
  4379. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4380. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4381. } while (0)
  4382. /* This control bit is applicable to only Producer, which updates Ring ID field
  4383. * of each descriptor before pushing into the ring.
  4384. * 0: updates ring_id(default)
  4385. * 1: ring_id updating disabled */
  4386. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4387. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4388. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4389. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4390. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4392. do { \
  4393. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4394. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4395. } while (0)
  4396. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4397. * of each descriptor before pushing into the ring.
  4398. * 0: updates Loopcnt(default)
  4399. * 1: Loopcnt updating disabled */
  4400. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4401. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4402. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4403. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4404. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4405. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4406. do { \
  4407. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4408. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4409. } while (0)
  4410. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4411. * into security_id port of GXI/AXI. */
  4412. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4413. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4414. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4415. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4416. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4417. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4418. do { \
  4419. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4420. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4421. } while (0)
  4422. /* During MSI write operation, SRNG drives value of this register bit into
  4423. * swap bit of GXI/AXI. */
  4424. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4425. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4426. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4427. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4428. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4429. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4430. do { \
  4431. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4432. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4433. } while (0)
  4434. /* During Pointer write operation, SRNG drives value of this register bit into
  4435. * swap bit of GXI/AXI. */
  4436. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4437. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4438. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4439. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4440. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4441. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4442. do { \
  4443. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4444. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4445. } while (0)
  4446. /* During any data or TLV write operation, SRNG drives value of this register
  4447. * bit into swap bit of GXI/AXI. */
  4448. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4449. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4450. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4451. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4452. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4453. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4454. do { \
  4455. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4456. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4457. } while (0)
  4458. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4459. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4460. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4461. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4462. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4463. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4464. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4465. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4466. do { \
  4467. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4468. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4469. } while (0)
  4470. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4471. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4472. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4473. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4474. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4475. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4476. do { \
  4477. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4478. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4479. } while (0)
  4480. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4481. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4482. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4483. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4484. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4485. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4486. do { \
  4487. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4488. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4489. } while (0)
  4490. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4491. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4492. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4493. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4494. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4495. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4496. do { \
  4497. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4498. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4499. } while (0)
  4500. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4501. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4502. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4503. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4504. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4505. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4506. do { \
  4507. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4508. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4509. } while (0)
  4510. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4511. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4512. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4513. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4514. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4515. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4516. do { \
  4517. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4518. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4519. } while (0)
  4520. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4521. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4522. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4523. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4524. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4525. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4528. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4529. } while (0)
  4530. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4531. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4532. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4533. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4534. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4535. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4536. do { \
  4537. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4538. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4539. } while (0)
  4540. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4541. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4542. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4543. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4544. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4545. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4546. do { \
  4547. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4548. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4549. } while (0)
  4550. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4551. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4552. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4553. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4554. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4555. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4556. do { \
  4557. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4558. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4559. } while (0)
  4560. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4561. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4562. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4563. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4564. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4565. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4566. do { \
  4567. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4568. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4569. } while (0)
  4570. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4571. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4572. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4573. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4574. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4575. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4576. do { \
  4577. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4578. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4579. } while (0)
  4580. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4581. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4582. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4583. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4584. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4585. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4586. do { \
  4587. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4588. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4589. } while (0)
  4590. /**
  4591. * @brief host -> target RX ring selection config message
  4592. *
  4593. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4594. *
  4595. * @details
  4596. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4597. * configure RXDMA rings.
  4598. * The configuration is per ring based and includes both packet subtypes
  4599. * and PPDU/MPDU TLVs.
  4600. *
  4601. * The message would appear as follows:
  4602. *
  4603. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4604. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4605. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4606. * |-------------------------------------------------------------------|
  4607. * | rsvd2 | ring_buffer_size |
  4608. * |-------------------------------------------------------------------|
  4609. * | packet_type_enable_flags_0 |
  4610. * |-------------------------------------------------------------------|
  4611. * | packet_type_enable_flags_1 |
  4612. * |-------------------------------------------------------------------|
  4613. * | packet_type_enable_flags_2 |
  4614. * |-------------------------------------------------------------------|
  4615. * | packet_type_enable_flags_3 |
  4616. * |-------------------------------------------------------------------|
  4617. * | tlv_filter_in_flags |
  4618. * |-------------------------------------------------------------------|
  4619. * | rx_header_offset | rx_packet_offset |
  4620. * |-------------------------------------------------------------------|
  4621. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4622. * |-------------------------------------------------------------------|
  4623. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4624. * |-------------------------------------------------------------------|
  4625. * | rsvd3 | rx_attention_offset |
  4626. * |-------------------------------------------------------------------|
  4627. * | rsvd4 | mo| fp| rx_drop_threshold |
  4628. * | |ndp|ndp| |
  4629. * |-------------------------------------------------------------------|
  4630. * Where:
  4631. * PS = pkt_swap
  4632. * SS = status_swap
  4633. * OV = rx_offsets_valid
  4634. * DT = drop_thresh_valid
  4635. * The message is interpreted as follows:
  4636. * dword0 - b'0:7 - msg_type: This will be set to
  4637. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4638. * b'8:15 - pdev_id:
  4639. * 0 (for rings at SOC/UMAC level),
  4640. * 1/2/3 mac id (for rings at LMAC level)
  4641. * b'16:23 - ring_id : Identify the ring to configure.
  4642. * More details can be got from enum htt_srng_ring_id
  4643. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4644. * BUF_RING_CFG_0 defs within HW .h files,
  4645. * e.g. wmac_top_reg_seq_hwioreg.h
  4646. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4647. * BUF_RING_CFG_0 defs within HW .h files,
  4648. * e.g. wmac_top_reg_seq_hwioreg.h
  4649. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4650. * configuration fields are valid
  4651. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4652. * rx_drop_threshold field is valid
  4653. * b'28:31 - rsvd1: reserved for future use
  4654. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4655. * in byte units.
  4656. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4657. * - b'16:31 - rsvd2: Reserved for future use
  4658. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4659. * Enable MGMT packet from 0b0000 to 0b1001
  4660. * bits from low to high: FP, MD, MO - 3 bits
  4661. * FP: Filter_Pass
  4662. * MD: Monitor_Direct
  4663. * MO: Monitor_Other
  4664. * 10 mgmt subtypes * 3 bits -> 30 bits
  4665. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4666. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4667. * Enable MGMT packet from 0b1010 to 0b1111
  4668. * bits from low to high: FP, MD, MO - 3 bits
  4669. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4670. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4671. * Enable CTRL packet from 0b0000 to 0b1001
  4672. * bits from low to high: FP, MD, MO - 3 bits
  4673. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4674. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4675. * Enable CTRL packet from 0b1010 to 0b1111,
  4676. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4677. * bits from low to high: FP, MD, MO - 3 bits
  4678. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4679. * dword6 - b'0:31 - tlv_filter_in_flags:
  4680. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4681. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4682. * dword7 - b'0:15 - rx_packet_offset: rx_packet_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_1 defs within HW .h files,
  4686. * e.g. wmac_top_reg_seq_hwioreg.h
  4687. * - b'16:31 - rx_header_offset: rx_header_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_1 defs within HW .h files,
  4691. * e.g. wmac_top_reg_seq_hwioreg.h
  4692. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_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_2 defs within HW .h files,
  4696. * e.g. wmac_top_reg_seq_hwioreg.h
  4697. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_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_2 defs within HW .h files,
  4701. * e.g. wmac_top_reg_seq_hwioreg.h
  4702. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_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_3 defs within HW .h files,
  4706. * e.g. wmac_top_reg_seq_hwioreg.h
  4707. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4708. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4709. * A value of 0 will be considered as ignore this config.
  4710. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4711. * e.g. wmac_top_reg_seq_hwioreg.h
  4712. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4713. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4714. * A value of 0 will be considered as ignore this config.
  4715. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4716. * e.g. wmac_top_reg_seq_hwioreg.h
  4717. * - b'16:31 - rsvd3 for future use
  4718. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4719. * to source rings. Consumer drops packets if the available
  4720. * words in the ring falls below the configured threshold
  4721. * value.
  4722. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4723. * by host. 1 -> subscribed
  4724. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4725. * by host. 1 -> subscribed
  4726. */
  4727. PREPACK struct htt_rx_ring_selection_cfg_t {
  4728. A_UINT32 msg_type: 8,
  4729. pdev_id: 8,
  4730. ring_id: 8,
  4731. status_swap: 1,
  4732. pkt_swap: 1,
  4733. rx_offsets_valid: 1,
  4734. drop_thresh_valid: 1,
  4735. rsvd1: 4;
  4736. A_UINT32 ring_buffer_size: 16,
  4737. rsvd2: 16;
  4738. A_UINT32 packet_type_enable_flags_0;
  4739. A_UINT32 packet_type_enable_flags_1;
  4740. A_UINT32 packet_type_enable_flags_2;
  4741. A_UINT32 packet_type_enable_flags_3;
  4742. A_UINT32 tlv_filter_in_flags;
  4743. A_UINT32 rx_packet_offset: 16,
  4744. rx_header_offset: 16;
  4745. A_UINT32 rx_mpdu_end_offset: 16,
  4746. rx_mpdu_start_offset: 16;
  4747. A_UINT32 rx_msdu_end_offset: 16,
  4748. rx_msdu_start_offset: 16;
  4749. A_UINT32 rx_attn_offset: 16,
  4750. rsvd3: 16;
  4751. A_UINT32 rx_drop_threshold: 10,
  4752. fp_ndp: 1,
  4753. mo_ndp: 1,
  4754. rsvd4: 20;
  4755. } POSTPACK;
  4756. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4757. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4758. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4759. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4760. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4761. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4762. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4763. do { \
  4764. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4765. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4766. } while (0)
  4767. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4768. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4769. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4770. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4771. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4772. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4773. do { \
  4774. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4775. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4776. } while (0)
  4777. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4778. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4779. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4780. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4781. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4782. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4783. do { \
  4784. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4785. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4786. } while (0)
  4787. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4790. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4791. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4792. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4793. do { \
  4794. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4795. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4796. } while (0)
  4797. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4798. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4799. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4800. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4801. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4802. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4803. do { \
  4804. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4805. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4806. } while (0)
  4807. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4808. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4809. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4810. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4811. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4812. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4813. do { \
  4814. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4815. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4816. } while (0)
  4817. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4818. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4819. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4820. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4821. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4822. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4825. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4826. } while (0)
  4827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4830. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4831. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4833. do { \
  4834. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4835. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4836. } while (0)
  4837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4840. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4841. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4843. do { \
  4844. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4845. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4846. } while (0)
  4847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4850. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4851. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4853. do { \
  4854. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4855. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4856. } while (0)
  4857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4860. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4861. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4863. do { \
  4864. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4865. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4866. } while (0)
  4867. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4868. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4869. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4870. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4871. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4872. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4875. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4876. } while (0)
  4877. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4878. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4879. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4880. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4881. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4882. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4883. do { \
  4884. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4885. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4886. } while (0)
  4887. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4888. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4889. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4890. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4891. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4892. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4893. do { \
  4894. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4895. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4896. } while (0)
  4897. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4898. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4899. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4900. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4901. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4902. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4903. do { \
  4904. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4905. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4906. } while (0)
  4907. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4908. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4909. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4910. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4911. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4912. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4915. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4916. } while (0)
  4917. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4918. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4919. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4920. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4921. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4922. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4923. do { \
  4924. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4925. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4926. } while (0)
  4927. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4928. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4929. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4930. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4931. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4932. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4933. do { \
  4934. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4935. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4936. } while (0)
  4937. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4938. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4939. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4940. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4941. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4942. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4945. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4946. } while (0)
  4947. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4948. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4949. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4950. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4951. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4952. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4955. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4956. } while (0)
  4957. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4958. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4959. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4960. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4961. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4962. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4965. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4966. } while (0)
  4967. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4968. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4969. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4970. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4971. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4972. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4975. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4976. } while (0)
  4977. /*
  4978. * Subtype based MGMT frames enable bits.
  4979. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4980. */
  4981. /* association request */
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4988. /* association response */
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4995. /* Reassociation request */
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5002. /* Reassociation response */
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5009. /* Probe request */
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5016. /* Probe response */
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5023. /* Timing Advertisement */
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5030. /* Reserved */
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5037. /* Beacon */
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5044. /* ATIM */
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5051. /* Disassociation */
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5058. /* Authentication */
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5065. /* Deauthentication */
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5072. /* Action */
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5079. /* Action No Ack */
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5086. /* Reserved */
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5093. /*
  5094. * Subtype based CTRL frames enable bits.
  5095. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5096. */
  5097. /* Reserved */
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5104. /* Reserved */
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5111. /* Reserved */
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5118. /* Reserved */
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5125. /* Reserved */
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5132. /* Reserved */
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5139. /* Reserved */
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5146. /* Control Wrapper */
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5153. /* Block Ack Request */
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5160. /* Block Ack*/
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5167. /* PS-POLL */
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5174. /* RTS */
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5181. /* CTS */
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5188. /* ACK */
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5195. /* CF-END */
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5202. /* CF-END + CF-ACK */
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5209. /* Multicast data */
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5216. /* Unicast data */
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5223. /* NULL data */
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5228. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5229. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5231. do { \
  5232. HTT_CHECK_SET_VAL(httsym, value); \
  5233. (word) |= (value) << httsym##_S; \
  5234. } while (0)
  5235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5236. (((word) & httsym##_M) >> httsym##_S)
  5237. #define htt_rx_ring_pkt_enable_subtype_set( \
  5238. word, flag, mode, type, subtype, val) \
  5239. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5240. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5241. #define htt_rx_ring_pkt_enable_subtype_get( \
  5242. word, flag, mode, type, subtype) \
  5243. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5244. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5245. /* Definition to filter in TLVs */
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5263. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5264. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5266. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5267. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5268. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5269. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5270. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5271. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5272. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5273. do { \
  5274. HTT_CHECK_SET_VAL(httsym, enable); \
  5275. (word) |= (enable) << httsym##_S; \
  5276. } while (0)
  5277. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5278. (((word) & httsym##_M) >> httsym##_S)
  5279. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5280. HTT_RX_RING_TLV_ENABLE_SET( \
  5281. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5282. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5283. HTT_RX_RING_TLV_ENABLE_GET( \
  5284. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5285. /**
  5286. * @brief host -> target TX monitor config message
  5287. *
  5288. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5289. *
  5290. * @details
  5291. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5292. * configure RXDMA rings.
  5293. * The configuration is per ring based and includes both packet types
  5294. * and PPDU/MPDU TLVs.
  5295. *
  5296. * The message would appear as follows:
  5297. *
  5298. * |31 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5299. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5300. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5301. * |-----+--------+--------+-----+------+--------------------------------|
  5302. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5303. * |---------------------------------------------------------------+-----|
  5304. * | rsvd3 | E |
  5305. * |---------------------------------------------------------------------|
  5306. * | tlv_filter_mask_in0 |
  5307. * |---------------------------------------------------------------------|
  5308. * | tlv_filter_mask_in1 |
  5309. * |---------------------------------------------------------------------|
  5310. * | tlv_filter_mask_in2 |
  5311. * |---------------------------------------------------------------------|
  5312. * | tlv_filter_mask_in3 |
  5313. * |------------------------------------+--------------------------------|
  5314. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5315. * |------------------------------------+--------------------------------|
  5316. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5317. * |------------------------------------+--------------------------------|
  5318. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5319. * |-----------------------+-----+------+--------------------------------|
  5320. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5321. * |---------------------------------------------------------------------|
  5322. *
  5323. * Where:
  5324. * PS = pkt_swap
  5325. * SS = status_swap
  5326. * The message is interpreted as follows:
  5327. * dword0 - b'0:7 - msg_type: This will be set to
  5328. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5329. * b'8:15 - pdev_id:
  5330. * 0 (for rings at SOC/UMAC level),
  5331. * 1/2/3 mac id (for rings at LMAC level)
  5332. * b'16:23 - ring_id : Identify the ring to configure.
  5333. * More details can be got from enum htt_srng_ring_id
  5334. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5335. * BUF_RING_CFG_0 defs within HW .h files,
  5336. * e.g. wmac_top_reg_seq_hwioreg.h
  5337. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5338. * BUF_RING_CFG_0 defs within HW .h files,
  5339. * e.g. wmac_top_reg_seq_hwioreg.h
  5340. * b'26:31 - rsvd1: reserved for future use
  5341. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5342. * in byte units.
  5343. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5344. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5345. * Each bit out of 3 bits represents if configurable length
  5346. * is valid and needs to programmed.
  5347. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5348. * 64, 128, 256.
  5349. * If all 3 bits are set config length is > 256
  5350. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5351. * 64, 128, 256.
  5352. * If all 3 bits are set config length is > 256
  5353. * b'25:27 - config_length_data(DATA) for DATA: Each bit set represent
  5354. * 64, 128, 256.
  5355. * If all 3 bits are set config length is > 256
  5356. * - b'28:31 - rsvd2: Reserved for future use
  5357. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5358. * b'3:31 - rsvd3: Reserved for future use
  5359. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5360. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5361. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5362. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5363. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5364. * - b'16:31 - tx_peer_entry_word_mask:
  5365. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5366. * - b'16:31 - tx_msdu_start_word_mask:
  5367. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5368. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5369. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5370. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5371. * Each bit out of 3 bits represents if MSDU/MPDU
  5372. * logging is enabled
  5373. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5374. * 0 -> MSDU level logging is enabled
  5375. * (valid only if bit is set in
  5376. * pkt_type_msdu_or_mpdu_logging)
  5377. * 1 -> MPDU level logging is enabled
  5378. * (valid only if bit is set in
  5379. * pkt_type_msdu_or_mpdu_logging)
  5380. * - b'22:31 - rsvd4 for future use
  5381. */
  5382. PREPACK struct htt_tx_monitor_cfg_t {
  5383. A_UINT32 msg_type: 8,
  5384. pdev_id: 8,
  5385. ring_id: 8,
  5386. status_swap: 1,
  5387. pkt_swap: 1,
  5388. rsvd1: 6;
  5389. A_UINT32 ring_buffer_size: 16,
  5390. pkt_type_config_length: 3,
  5391. config_length_mgmt: 3,
  5392. config_length_ctrl: 3,
  5393. config_length_data: 3,
  5394. rsvd2: 4;
  5395. A_UINT32 pkt_type_enable_flags: 3,
  5396. rsvd3: 29;
  5397. A_UINT32 tlv_filter_mask_in0;
  5398. A_UINT32 tlv_filter_mask_in1;
  5399. A_UINT32 tlv_filter_mask_in2;
  5400. A_UINT32 tlv_filter_mask_in3;
  5401. A_UINT32 tx_fes_setup_word_mask: 16,
  5402. tx_peer_entry_word_mask: 16;
  5403. A_UINT32 tx_queue_ext_word_mask: 16,
  5404. tx_msdu_start_word_mask: 16;
  5405. A_UINT32 tx_mpdu_start_word_mask: 16,
  5406. pcu_ppdu_setup_word_mask: 16;
  5407. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5408. pkt_type_msdu_or_mpdu_logging: 3,
  5409. enable_msdu_or_mpdu_logging: 3,
  5410. rsvd4: 10;
  5411. } POSTPACK;
  5412. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5413. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5414. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5415. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5416. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5417. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5418. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5421. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5422. } while (0)
  5423. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5424. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5425. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5426. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5427. HTT_TX_MONITOR_CFG_RING_ID_S)
  5428. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5431. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5432. } while (0)
  5433. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5434. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5435. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5436. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5437. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5438. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5441. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5442. } while (0)
  5443. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5444. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5445. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5446. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5447. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5448. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5451. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5452. } while (0)
  5453. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5454. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5455. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5456. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5457. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5458. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5461. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5462. } while (0)
  5463. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5464. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5465. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5466. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5467. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5468. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5471. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5472. } while (0)
  5473. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5474. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5475. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5476. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5477. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5478. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5481. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5482. } while (0)
  5483. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5484. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5485. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5486. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5487. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5488. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5489. do { \
  5490. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5491. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5492. } while (0)
  5493. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5494. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5495. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5496. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5497. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5498. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5501. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5502. } while (0)
  5503. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5504. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5505. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5506. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5507. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5508. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5511. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5512. } while (0)
  5513. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5514. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5515. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5516. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5517. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5521. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5522. } while (0)
  5523. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5524. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5525. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5526. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5527. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5528. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5531. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5532. } while (0)
  5533. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5534. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5535. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5536. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5537. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5538. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5541. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5542. } while (0)
  5543. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5544. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5545. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5546. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5547. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5548. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5551. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5552. } while (0)
  5553. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5554. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5555. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5556. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5557. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5558. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5561. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5562. } while (0)
  5563. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5564. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5565. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5566. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5567. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5568. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5571. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5572. } while (0)
  5573. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5574. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5575. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5576. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5577. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5578. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5581. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5582. } while (0)
  5583. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5584. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5585. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5586. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5587. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5588. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5591. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5592. } while (0)
  5593. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5594. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5595. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5596. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5597. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5598. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5601. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5602. } while (0)
  5603. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5604. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5605. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5606. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5607. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5608. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5611. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5612. } while (0)
  5613. /*
  5614. * pkt_type_config_length
  5615. */
  5616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5617. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5618. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5619. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5620. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5622. /*
  5623. * pkt_type_enable_flags
  5624. */
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5631. /*
  5632. * pkt_type_msdu_or_mpdu_logging
  5633. * */
  5634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5638. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5641. do { \
  5642. HTT_CHECK_SET_VAL(httsym, value); \
  5643. (word) |= (value) << httsym##_S; \
  5644. } while (0)
  5645. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5646. (((word) & httsym##_M) >> httsym##_S)
  5647. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5648. * type -> MGMT, CTRL, DATA*/
  5649. #define htt_tx_ring_pkt_type_set( \
  5650. word, mode, type, val) \
  5651. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5652. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5653. #define htt_tx_ring_pkt_type_get( \
  5654. word, mode, type) \
  5655. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5656. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5657. /* Definition to filter in TLVs */
  5658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5722. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5723. do { \
  5724. HTT_CHECK_SET_VAL(httsym, enable); \
  5725. (word) |= (enable) << httsym##_S; \
  5726. } while (0)
  5727. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5728. (((word) & httsym##_M) >> httsym##_S)
  5729. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5730. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5731. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5732. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5733. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5734. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5799. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5800. do { \
  5801. HTT_CHECK_SET_VAL(httsym, enable); \
  5802. (word) |= (enable) << httsym##_S; \
  5803. } while (0)
  5804. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5805. (((word) & httsym##_M) >> httsym##_S)
  5806. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5807. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5808. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5809. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5810. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5811. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5876. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5877. do { \
  5878. HTT_CHECK_SET_VAL(httsym, enable); \
  5879. (word) |= (enable) << httsym##_S; \
  5880. } while (0)
  5881. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5882. (((word) & httsym##_M) >> httsym##_S)
  5883. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5884. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5885. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5886. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5887. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5888. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5933. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5934. do { \
  5935. HTT_CHECK_SET_VAL(httsym, enable); \
  5936. (word) |= (enable) << httsym##_S; \
  5937. } while (0)
  5938. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5939. (((word) & httsym##_M) >> httsym##_S)
  5940. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5941. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5942. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5943. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5944. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5945. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5946. /**
  5947. * @brief host --> target Receive Flow Steering configuration message definition
  5948. *
  5949. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5950. *
  5951. * host --> target Receive Flow Steering configuration message definition.
  5952. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5953. * The reason for this is we want RFS to be configured and ready before MAC
  5954. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5955. *
  5956. * |31 24|23 16|15 9|8|7 0|
  5957. * |----------------+----------------+----------------+----------------|
  5958. * | reserved |E| msg type |
  5959. * |-------------------------------------------------------------------|
  5960. * Where E = RFS enable flag
  5961. *
  5962. * The RFS_CONFIG message consists of a single 4-byte word.
  5963. *
  5964. * Header fields:
  5965. * - MSG_TYPE
  5966. * Bits 7:0
  5967. * Purpose: identifies this as a RFS config msg
  5968. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5969. * - RFS_CONFIG
  5970. * Bit 8
  5971. * Purpose: Tells target whether to enable (1) or disable (0)
  5972. * flow steering feature when sending rx indication messages to host
  5973. */
  5974. #define HTT_H2T_RFS_CONFIG_M 0x100
  5975. #define HTT_H2T_RFS_CONFIG_S 8
  5976. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5977. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5978. HTT_H2T_RFS_CONFIG_S)
  5979. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5980. do { \
  5981. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5982. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5983. } while (0)
  5984. #define HTT_RFS_CFG_REQ_BYTES 4
  5985. /**
  5986. * @brief host -> target FW extended statistics retrieve
  5987. *
  5988. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5989. *
  5990. * @details
  5991. * The following field definitions describe the format of the HTT host
  5992. * to target FW extended stats retrieve message.
  5993. * The message specifies the type of stats the host wants to retrieve.
  5994. *
  5995. * |31 24|23 16|15 8|7 0|
  5996. * |-----------------------------------------------------------|
  5997. * | reserved | stats type | pdev_mask | msg type |
  5998. * |-----------------------------------------------------------|
  5999. * | config param [0] |
  6000. * |-----------------------------------------------------------|
  6001. * | config param [1] |
  6002. * |-----------------------------------------------------------|
  6003. * | config param [2] |
  6004. * |-----------------------------------------------------------|
  6005. * | config param [3] |
  6006. * |-----------------------------------------------------------|
  6007. * | reserved |
  6008. * |-----------------------------------------------------------|
  6009. * | cookie LSBs |
  6010. * |-----------------------------------------------------------|
  6011. * | cookie MSBs |
  6012. * |-----------------------------------------------------------|
  6013. * Header fields:
  6014. * - MSG_TYPE
  6015. * Bits 7:0
  6016. * Purpose: identifies this is a extended stats upload request message
  6017. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6018. * - PDEV_MASK
  6019. * Bits 8:15
  6020. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6021. * Value: This is a overloaded field, refer to usage and interpretation of
  6022. * PDEV in interface document.
  6023. * Bit 8 : Reserved for SOC stats
  6024. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6025. * Indicates MACID_MASK in DBS
  6026. * - STATS_TYPE
  6027. * Bits 23:16
  6028. * Purpose: identifies which FW statistics to upload
  6029. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6030. * - Reserved
  6031. * Bits 31:24
  6032. * - CONFIG_PARAM [0]
  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 [1]
  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. * - CONFIG_PARAM [2]
  6043. * Bits 31:0
  6044. * Purpose: give an opaque configuration value to the specified stats type
  6045. * Value: stats-type specific configuration value
  6046. * Refer to htt_stats.h for interpretation for each stats sub_type
  6047. * - CONFIG_PARAM [3]
  6048. * Bits 31:0
  6049. * Purpose: give an opaque configuration value to the specified stats type
  6050. * Value: stats-type specific configuration value
  6051. * Refer to htt_stats.h for interpretation for each stats sub_type
  6052. * - Reserved [31:0] for future use.
  6053. * - COOKIE_LSBS
  6054. * Bits 31:0
  6055. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6056. * message with its preceding host->target stats request message.
  6057. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6058. * - COOKIE_MSBS
  6059. * Bits 31:0
  6060. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6061. * message with its preceding host->target stats request message.
  6062. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6063. */
  6064. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6065. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6066. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6067. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6068. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6069. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6070. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6071. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6072. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6073. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6074. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6075. do { \
  6076. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6077. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6078. } while (0)
  6079. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6080. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6081. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6082. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6083. do { \
  6084. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6085. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6086. } while (0)
  6087. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6088. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6089. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6090. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6091. do { \
  6092. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6093. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6094. } while (0)
  6095. /**
  6096. * @brief host -> target FW PPDU_STATS request message
  6097. *
  6098. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6099. *
  6100. * @details
  6101. * The following field definitions describe the format of the HTT host
  6102. * to target FW for PPDU_STATS_CFG msg.
  6103. * The message allows the host to configure the PPDU_STATS_IND messages
  6104. * produced by the target.
  6105. *
  6106. * |31 24|23 16|15 8|7 0|
  6107. * |-----------------------------------------------------------|
  6108. * | REQ bit mask | pdev_mask | msg type |
  6109. * |-----------------------------------------------------------|
  6110. * Header fields:
  6111. * - MSG_TYPE
  6112. * Bits 7:0
  6113. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6114. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6115. * - PDEV_MASK
  6116. * Bits 8:15
  6117. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6118. * Value: This is a overloaded field, refer to usage and interpretation of
  6119. * PDEV in interface document.
  6120. * Bit 8 : Reserved for SOC stats
  6121. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6122. * Indicates MACID_MASK in DBS
  6123. * - REQ_TLV_BIT_MASK
  6124. * Bits 16:31
  6125. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6126. * needs to be included in the target's PPDU_STATS_IND messages.
  6127. * Value: refer htt_ppdu_stats_tlv_tag_t
  6128. *
  6129. */
  6130. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6131. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6132. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6133. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6134. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6135. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6136. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6137. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6138. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6139. do { \
  6140. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6141. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6142. } while (0)
  6143. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6144. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6145. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6146. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6147. do { \
  6148. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6149. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6150. } while (0)
  6151. /**
  6152. * @brief Host-->target HTT RX FSE setup message
  6153. *
  6154. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6155. *
  6156. * @details
  6157. * Through this message, the host will provide details of the flow tables
  6158. * in host DDR along with hash keys.
  6159. * This message can be sent per SOC or per PDEV, which is differentiated
  6160. * by pdev id values.
  6161. * The host will allocate flow search table and sends table size,
  6162. * physical DMA address of flow table, and hash keys to firmware to
  6163. * program into the RXOLE FSE HW block.
  6164. *
  6165. * The following field definitions describe the format of the RX FSE setup
  6166. * message sent from the host to target
  6167. *
  6168. * Header fields:
  6169. * dword0 - b'7:0 - msg_type: This will be set to
  6170. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6171. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6172. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6173. * pdev's LMAC ring.
  6174. * b'31:16 - reserved : Reserved for future use
  6175. * dword1 - b'19:0 - number of records: This field indicates the number of
  6176. * entries in the flow table. For example: 8k number of
  6177. * records is equivalent to
  6178. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6179. * b'27:20 - max search: This field specifies the skid length to FSE
  6180. * parser HW module whenever match is not found at the
  6181. * exact index pointed by hash.
  6182. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6183. * Refer htt_ip_da_sa_prefix below for more details.
  6184. * b'31:30 - reserved: Reserved for future use
  6185. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6186. * table allocated by host in DDR
  6187. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6188. * table allocated by host in DDR
  6189. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6190. * entry hashing
  6191. *
  6192. *
  6193. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6194. * |---------------------------------------------------------------|
  6195. * | reserved | pdev_id | MSG_TYPE |
  6196. * |---------------------------------------------------------------|
  6197. * |resvd|IPDSA| max_search | Number of records |
  6198. * |---------------------------------------------------------------|
  6199. * | base address lo |
  6200. * |---------------------------------------------------------------|
  6201. * | base address high |
  6202. * |---------------------------------------------------------------|
  6203. * | toeplitz key 31_0 |
  6204. * |---------------------------------------------------------------|
  6205. * | toeplitz key 63_32 |
  6206. * |---------------------------------------------------------------|
  6207. * | toeplitz key 95_64 |
  6208. * |---------------------------------------------------------------|
  6209. * | toeplitz key 127_96 |
  6210. * |---------------------------------------------------------------|
  6211. * | toeplitz key 159_128 |
  6212. * |---------------------------------------------------------------|
  6213. * | toeplitz key 191_160 |
  6214. * |---------------------------------------------------------------|
  6215. * | toeplitz key 223_192 |
  6216. * |---------------------------------------------------------------|
  6217. * | toeplitz key 255_224 |
  6218. * |---------------------------------------------------------------|
  6219. * | toeplitz key 287_256 |
  6220. * |---------------------------------------------------------------|
  6221. * | reserved | toeplitz key 314_288(26:0 bits) |
  6222. * |---------------------------------------------------------------|
  6223. * where:
  6224. * IPDSA = ip_da_sa
  6225. */
  6226. /**
  6227. * @brief: htt_ip_da_sa_prefix
  6228. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6229. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6230. * documentation per RFC3849
  6231. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6232. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6233. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6234. */
  6235. enum htt_ip_da_sa_prefix {
  6236. HTT_RX_IPV6_20010db8,
  6237. HTT_RX_IPV4_MAPPED_IPV6,
  6238. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6239. HTT_RX_IPV6_64FF9B,
  6240. };
  6241. /**
  6242. * @brief Host-->target HTT RX FISA configure and enable
  6243. *
  6244. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6245. *
  6246. * @details
  6247. * The host will send this command down to configure and enable the FISA
  6248. * operational params.
  6249. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6250. * register.
  6251. * Should configure both the MACs.
  6252. *
  6253. * dword0 - b'7:0 - msg_type:
  6254. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6255. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6256. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6257. * pdev's LMAC ring.
  6258. * b'31:16 - reserved : Reserved for future use
  6259. *
  6260. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6261. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6262. * packets. 1 flow search will be skipped
  6263. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6264. * tcp,udp packets
  6265. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6266. * calculation
  6267. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6268. * calculation
  6269. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6270. * calculation
  6271. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6272. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6273. * length
  6274. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6275. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6276. * length
  6277. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6278. * num jump
  6279. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6280. * num jump
  6281. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6282. * data type switch has happend for MPDU Sequence num jump
  6283. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6284. * for MPDU Sequence num jump
  6285. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6286. * for decrypt errors
  6287. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6288. * while aggregating a msdu
  6289. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6290. * The aggregation is done until (number of MSDUs aggregated
  6291. * < LIMIT + 1)
  6292. * b'31:18 - Reserved
  6293. *
  6294. * fisa_control_value - 32bit value FW can write to register
  6295. *
  6296. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6297. * Threshold value for FISA timeout (units are microseconds).
  6298. * When the global timestamp exceeds this threshold, FISA
  6299. * aggregation will be restarted.
  6300. * A value of 0 means timeout is disabled.
  6301. * Compare the threshold register with timestamp field in
  6302. * flow entry to generate timeout for the flow.
  6303. *
  6304. * |31 18 |17 16|15 8|7 0|
  6305. * |-------------------------------------------------------------|
  6306. * | reserved | pdev_mask | msg type |
  6307. * |-------------------------------------------------------------|
  6308. * | reserved | FISA_CTRL |
  6309. * |-------------------------------------------------------------|
  6310. * | FISA_TIMEOUT_THRESH |
  6311. * |-------------------------------------------------------------|
  6312. */
  6313. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6314. A_UINT32 msg_type:8,
  6315. pdev_id:8,
  6316. reserved0:16;
  6317. /**
  6318. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6319. * [17:0]
  6320. */
  6321. union {
  6322. /*
  6323. * fisa_control_bits structure is deprecated.
  6324. * Please use fisa_control_bits_v2 going forward.
  6325. */
  6326. struct {
  6327. A_UINT32 fisa_enable: 1,
  6328. ipsec_skip_search: 1,
  6329. nontcp_skip_search: 1,
  6330. add_ipv4_fixed_hdr_len: 1,
  6331. add_ipv6_fixed_hdr_len: 1,
  6332. add_tcp_fixed_hdr_len: 1,
  6333. add_udp_hdr_len: 1,
  6334. chksum_cum_ip_len_en: 1,
  6335. disable_tid_check: 1,
  6336. disable_ta_check: 1,
  6337. disable_qos_check: 1,
  6338. disable_raw_check: 1,
  6339. disable_decrypt_err_check: 1,
  6340. disable_msdu_drop_check: 1,
  6341. fisa_aggr_limit: 4,
  6342. reserved: 14;
  6343. } fisa_control_bits;
  6344. struct {
  6345. A_UINT32 fisa_enable: 1,
  6346. fisa_aggr_limit: 4,
  6347. reserved: 27;
  6348. } fisa_control_bits_v2;
  6349. A_UINT32 fisa_control_value;
  6350. } u_fisa_control;
  6351. /**
  6352. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6353. * timeout threshold for aggregation. Unit in usec.
  6354. * [31:0]
  6355. */
  6356. A_UINT32 fisa_timeout_threshold;
  6357. } POSTPACK;
  6358. /* DWord 0: pdev-ID */
  6359. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6360. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6361. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6362. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6363. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6364. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6365. do { \
  6366. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6367. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6368. } while (0)
  6369. /* Dword 1: fisa_control_value fisa config */
  6370. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6371. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6372. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6373. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6374. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6375. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6378. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6379. } while (0)
  6380. /* Dword 1: fisa_control_value ipsec_skip_search */
  6381. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6382. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6383. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6384. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6385. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6386. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6387. do { \
  6388. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6389. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6390. } while (0)
  6391. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6392. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6393. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6394. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6395. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6396. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6397. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6398. do { \
  6399. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6400. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6401. } while (0)
  6402. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6403. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6404. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6405. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6406. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6407. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6408. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6409. do { \
  6410. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6411. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6412. } while (0)
  6413. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6414. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6415. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6416. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6417. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6418. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6419. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6420. do { \
  6421. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6422. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6423. } while (0)
  6424. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6425. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6426. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6427. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6428. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6429. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6430. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6431. do { \
  6432. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6433. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6434. } while (0)
  6435. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6436. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6437. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6438. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6439. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6440. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6441. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6444. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6445. } while (0)
  6446. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6447. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6448. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6449. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6450. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6451. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6452. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6453. do { \
  6454. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6455. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6456. } while (0)
  6457. /* Dword 1: fisa_control_value disable_tid_check */
  6458. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6459. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6460. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6461. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6462. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6463. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6464. do { \
  6465. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6466. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6467. } while (0)
  6468. /* Dword 1: fisa_control_value disable_ta_check */
  6469. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6470. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6471. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6472. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6473. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6474. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6475. do { \
  6476. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6477. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6478. } while (0)
  6479. /* Dword 1: fisa_control_value disable_qos_check */
  6480. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6481. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6482. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6483. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6484. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6485. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6486. do { \
  6487. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6488. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6489. } while (0)
  6490. /* Dword 1: fisa_control_value disable_raw_check */
  6491. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6492. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6493. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6494. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6495. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6496. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6497. do { \
  6498. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6499. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6500. } while (0)
  6501. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6502. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6503. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6504. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6505. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6506. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6507. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6508. do { \
  6509. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6510. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6511. } while (0)
  6512. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6513. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6514. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6515. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6516. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6517. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6518. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6519. do { \
  6520. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6521. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6522. } while (0)
  6523. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6524. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6525. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6526. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6527. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6528. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6529. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6530. do { \
  6531. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6532. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6533. } while (0)
  6534. /* Dword 1: fisa_control_value fisa config */
  6535. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6536. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6537. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6538. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6539. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6540. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6541. do { \
  6542. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6543. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6544. } while (0)
  6545. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6546. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6547. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6548. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6549. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6550. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6551. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6554. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6555. } while (0)
  6556. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6557. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6558. pdev_id:8,
  6559. reserved0:16;
  6560. A_UINT32 num_records:20,
  6561. max_search:8,
  6562. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6563. reserved1:2;
  6564. A_UINT32 base_addr_lo;
  6565. A_UINT32 base_addr_hi;
  6566. A_UINT32 toeplitz31_0;
  6567. A_UINT32 toeplitz63_32;
  6568. A_UINT32 toeplitz95_64;
  6569. A_UINT32 toeplitz127_96;
  6570. A_UINT32 toeplitz159_128;
  6571. A_UINT32 toeplitz191_160;
  6572. A_UINT32 toeplitz223_192;
  6573. A_UINT32 toeplitz255_224;
  6574. A_UINT32 toeplitz287_256;
  6575. A_UINT32 toeplitz314_288:27,
  6576. reserved2:5;
  6577. } POSTPACK;
  6578. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6579. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6580. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6581. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6582. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6583. /* DWORD 0: Pdev ID */
  6584. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6585. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6586. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6587. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6588. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6589. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6590. do { \
  6591. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6592. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6593. } while (0)
  6594. /* DWORD 1:num of records */
  6595. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6596. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6597. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6598. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6599. HTT_RX_FSE_SETUP_NUM_REC_S)
  6600. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6601. do { \
  6602. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6603. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6604. } while (0)
  6605. /* DWORD 1:max_search */
  6606. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6607. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6608. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6609. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6610. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6611. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6614. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6615. } while (0)
  6616. /* DWORD 1:ip_da_sa prefix */
  6617. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6618. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6619. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6620. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6621. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6622. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6623. do { \
  6624. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6625. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6626. } while (0)
  6627. /* DWORD 2: Base Address LO */
  6628. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6629. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6630. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6631. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6632. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6633. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6634. do { \
  6635. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6636. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6637. } while (0)
  6638. /* DWORD 3: Base Address High */
  6639. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6640. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6641. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6642. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6643. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6644. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6645. do { \
  6646. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6647. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6648. } while (0)
  6649. /* DWORD 4-12: Hash Value */
  6650. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6651. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6652. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6653. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6654. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6655. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6656. do { \
  6657. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6658. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6659. } while (0)
  6660. /* DWORD 13: Hash Value 314:288 bits */
  6661. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6662. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6663. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6664. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6665. do { \
  6666. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6667. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6668. } while (0)
  6669. /**
  6670. * @brief Host-->target HTT RX FSE operation message
  6671. *
  6672. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6673. *
  6674. * @details
  6675. * The host will send this Flow Search Engine (FSE) operation message for
  6676. * every flow add/delete operation.
  6677. * The FSE operation includes FSE full cache invalidation or individual entry
  6678. * invalidation.
  6679. * This message can be sent per SOC or per PDEV which is differentiated
  6680. * by pdev id values.
  6681. *
  6682. * |31 16|15 8|7 1|0|
  6683. * |-------------------------------------------------------------|
  6684. * | reserved | pdev_id | MSG_TYPE |
  6685. * |-------------------------------------------------------------|
  6686. * | reserved | operation |I|
  6687. * |-------------------------------------------------------------|
  6688. * | ip_src_addr_31_0 |
  6689. * |-------------------------------------------------------------|
  6690. * | ip_src_addr_63_32 |
  6691. * |-------------------------------------------------------------|
  6692. * | ip_src_addr_95_64 |
  6693. * |-------------------------------------------------------------|
  6694. * | ip_src_addr_127_96 |
  6695. * |-------------------------------------------------------------|
  6696. * | ip_dst_addr_31_0 |
  6697. * |-------------------------------------------------------------|
  6698. * | ip_dst_addr_63_32 |
  6699. * |-------------------------------------------------------------|
  6700. * | ip_dst_addr_95_64 |
  6701. * |-------------------------------------------------------------|
  6702. * | ip_dst_addr_127_96 |
  6703. * |-------------------------------------------------------------|
  6704. * | l4_dst_port | l4_src_port |
  6705. * | (32-bit SPI incase of IPsec) |
  6706. * |-------------------------------------------------------------|
  6707. * | reserved | l4_proto |
  6708. * |-------------------------------------------------------------|
  6709. *
  6710. * where I is 1-bit ipsec_valid.
  6711. *
  6712. * The following field definitions describe the format of the RX FSE operation
  6713. * message sent from the host to target for every add/delete flow entry to flow
  6714. * table.
  6715. *
  6716. * Header fields:
  6717. * dword0 - b'7:0 - msg_type: This will be set to
  6718. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6719. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6720. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6721. * specified pdev's LMAC ring.
  6722. * b'31:16 - reserved : Reserved for future use
  6723. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6724. * (Internet Protocol Security).
  6725. * IPsec describes the framework for providing security at
  6726. * IP layer. IPsec is defined for both versions of IP:
  6727. * IPV4 and IPV6.
  6728. * Please refer to htt_rx_flow_proto enumeration below for
  6729. * more info.
  6730. * ipsec_valid = 1 for IPSEC packets
  6731. * ipsec_valid = 0 for IP Packets
  6732. * b'7:1 - operation: This indicates types of FSE operation.
  6733. * Refer to htt_rx_fse_operation enumeration:
  6734. * 0 - No Cache Invalidation required
  6735. * 1 - Cache invalidate only one entry given by IP
  6736. * src/dest address at DWORD[2:9]
  6737. * 2 - Complete FSE Cache Invalidation
  6738. * 3 - FSE Disable
  6739. * 4 - FSE Enable
  6740. * b'31:8 - reserved: Reserved for future use
  6741. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6742. * for per flow addition/deletion
  6743. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6744. * and the subsequent 3 A_UINT32 will be padding bytes.
  6745. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6746. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6747. * from 0 to 65535 but only 0 to 1023 are designated as
  6748. * well-known ports. Refer to [RFC1700] for more details.
  6749. * This field is valid only if
  6750. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6751. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6752. * range from 0 to 65535 but only 0 to 1023 are designated
  6753. * as well-known ports. Refer to [RFC1700] for more details.
  6754. * This field is valid only if
  6755. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6756. * - SPI (31:0): Security Parameters Index is an
  6757. * identification tag added to the header while using IPsec
  6758. * for tunneling the IP traffici.
  6759. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6760. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6761. * Assigned Internet Protocol Numbers.
  6762. * l4_proto numbers for standard protocol like UDP/TCP
  6763. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6764. * l4_proto = 17 for UDP etc.
  6765. * b'31:8 - reserved: Reserved for future use.
  6766. *
  6767. */
  6768. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6769. A_UINT32 msg_type:8,
  6770. pdev_id:8,
  6771. reserved0:16;
  6772. A_UINT32 ipsec_valid:1,
  6773. operation:7,
  6774. reserved1:24;
  6775. A_UINT32 ip_src_addr_31_0;
  6776. A_UINT32 ip_src_addr_63_32;
  6777. A_UINT32 ip_src_addr_95_64;
  6778. A_UINT32 ip_src_addr_127_96;
  6779. A_UINT32 ip_dest_addr_31_0;
  6780. A_UINT32 ip_dest_addr_63_32;
  6781. A_UINT32 ip_dest_addr_95_64;
  6782. A_UINT32 ip_dest_addr_127_96;
  6783. union {
  6784. A_UINT32 spi;
  6785. struct {
  6786. A_UINT32 l4_src_port:16,
  6787. l4_dest_port:16;
  6788. } ip;
  6789. } u;
  6790. A_UINT32 l4_proto:8,
  6791. reserved:24;
  6792. } POSTPACK;
  6793. /**
  6794. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6795. *
  6796. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6797. *
  6798. * @details
  6799. * The host will send this Full monitor mode register configuration message.
  6800. * This message can be sent per SOC or per PDEV which is differentiated
  6801. * by pdev id values.
  6802. *
  6803. * |31 16|15 11|10 8|7 3|2|1|0|
  6804. * |-------------------------------------------------------------|
  6805. * | reserved | pdev_id | MSG_TYPE |
  6806. * |-------------------------------------------------------------|
  6807. * | reserved |Release Ring |N|Z|E|
  6808. * |-------------------------------------------------------------|
  6809. *
  6810. * where E is 1-bit full monitor mode enable/disable.
  6811. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6812. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6813. *
  6814. * The following field definitions describe the format of the full monitor
  6815. * mode configuration message sent from the host to target for each pdev.
  6816. *
  6817. * Header fields:
  6818. * dword0 - b'7:0 - msg_type: This will be set to
  6819. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6820. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6821. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6822. * specified pdev's LMAC ring.
  6823. * b'31:16 - reserved : Reserved for future use.
  6824. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6825. * monitor mode rxdma register is to be enabled or disabled.
  6826. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6827. * additional descriptors at ppdu end for zero mpdus
  6828. * enabled or disabled.
  6829. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6830. * additional descriptors at ppdu end for non zero mpdus
  6831. * enabled or disabled.
  6832. * b'10:3 - release_ring: This indicates the destination ring
  6833. * selection for the descriptor at the end of PPDU
  6834. * 0 - REO ring select
  6835. * 1 - FW ring select
  6836. * 2 - SW ring select
  6837. * 3 - Release ring select
  6838. * Refer to htt_rx_full_mon_release_ring.
  6839. * b'31:11 - reserved for future use
  6840. */
  6841. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6842. A_UINT32 msg_type:8,
  6843. pdev_id:8,
  6844. reserved0:16;
  6845. A_UINT32 full_monitor_mode_enable:1,
  6846. addnl_descs_zero_mpdus_end:1,
  6847. addnl_descs_non_zero_mpdus_end:1,
  6848. release_ring:8,
  6849. reserved1:21;
  6850. } POSTPACK;
  6851. /**
  6852. * Enumeration for full monitor mode destination ring select
  6853. * 0 - REO destination ring select
  6854. * 1 - FW destination ring select
  6855. * 2 - SW destination ring select
  6856. * 3 - Release destination ring select
  6857. */
  6858. enum htt_rx_full_mon_release_ring {
  6859. HTT_RX_MON_RING_REO,
  6860. HTT_RX_MON_RING_FW,
  6861. HTT_RX_MON_RING_SW,
  6862. HTT_RX_MON_RING_RELEASE,
  6863. };
  6864. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6865. /* DWORD 0: Pdev ID */
  6866. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6867. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6868. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6869. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6870. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6871. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6872. do { \
  6873. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6874. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6875. } while (0)
  6876. /* DWORD 1:ENABLE */
  6877. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6878. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6879. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6880. do { \
  6881. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6882. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6883. } while (0)
  6884. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6885. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6886. /* DWORD 1:ZERO_MPDU */
  6887. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6888. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6889. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6890. do { \
  6891. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6892. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6893. } while (0)
  6894. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6895. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6896. /* DWORD 1:NON_ZERO_MPDU */
  6897. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6898. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6899. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6900. do { \
  6901. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6902. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6903. } while (0)
  6904. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6905. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6906. /* DWORD 1:RELEASE_RINGS */
  6907. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6908. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6909. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6910. do { \
  6911. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6912. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6913. } while (0)
  6914. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6915. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6916. /**
  6917. * Enumeration for IP Protocol or IPSEC Protocol
  6918. * IPsec describes the framework for providing security at IP layer.
  6919. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6920. */
  6921. enum htt_rx_flow_proto {
  6922. HTT_RX_FLOW_IP_PROTO,
  6923. HTT_RX_FLOW_IPSEC_PROTO,
  6924. };
  6925. /**
  6926. * Enumeration for FSE Cache Invalidation
  6927. * 0 - No Cache Invalidation required
  6928. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6929. * 2 - Complete FSE Cache Invalidation
  6930. * 3 - FSE Disable
  6931. * 4 - FSE Enable
  6932. */
  6933. enum htt_rx_fse_operation {
  6934. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6935. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6936. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6937. HTT_RX_FSE_DISABLE,
  6938. HTT_RX_FSE_ENABLE,
  6939. };
  6940. /* DWORD 0: Pdev ID */
  6941. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6942. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6943. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6944. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6945. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6946. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6947. do { \
  6948. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6949. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6950. } while (0)
  6951. /* DWORD 1:IP PROTO or IPSEC */
  6952. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6953. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6954. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6955. do { \
  6956. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6957. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6958. } while (0)
  6959. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6960. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6961. /* DWORD 1:FSE Operation */
  6962. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6963. #define HTT_RX_FSE_OPERATION_S 1
  6964. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6965. do { \
  6966. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6967. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6968. } while (0)
  6969. #define HTT_RX_FSE_OPERATION_GET(word) \
  6970. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6971. /* DWORD 2-9:IP Address */
  6972. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6973. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6974. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6975. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6976. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6977. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6978. do { \
  6979. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6980. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6981. } while (0)
  6982. /* DWORD 10:Source Port Number */
  6983. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6984. #define HTT_RX_FSE_SOURCEPORT_S 0
  6985. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6986. do { \
  6987. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6988. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6989. } while (0)
  6990. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6991. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6992. /* DWORD 11:Destination Port Number */
  6993. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6994. #define HTT_RX_FSE_DESTPORT_S 16
  6995. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6996. do { \
  6997. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6998. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6999. } while (0)
  7000. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7001. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7002. /* DWORD 10-11:SPI (In case of IPSEC) */
  7003. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7004. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7005. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7006. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7007. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7008. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7009. do { \
  7010. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7011. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7012. } while (0)
  7013. /* DWORD 12:L4 PROTO */
  7014. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7015. #define HTT_RX_FSE_L4_PROTO_S 0
  7016. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7017. do { \
  7018. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7019. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7020. } while (0)
  7021. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7022. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7023. /**
  7024. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7025. *
  7026. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7027. *
  7028. * |31 24|23 |15 8|7 2|1|0|
  7029. * |----------------+----------------+----------------+----------------|
  7030. * | reserved | pdev_id | msg_type |
  7031. * |---------------------------------+----------------+----------------|
  7032. * | reserved |E|F|
  7033. * |---------------------------------+----------------+----------------|
  7034. * Where E = Configure the target to provide the 3-tuple hash value in
  7035. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7036. * F = Configure the target to provide the 3-tuple hash value in
  7037. * flow_id_toeplitz field of rx_msdu_start tlv
  7038. *
  7039. * The following field definitions describe the format of the 3 tuple hash value
  7040. * message sent from the host to target as part of initialization sequence.
  7041. *
  7042. * Header fields:
  7043. * dword0 - b'7:0 - msg_type: This will be set to
  7044. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7045. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7046. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7047. * specified pdev's LMAC ring.
  7048. * b'31:16 - reserved : Reserved for future use
  7049. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7050. * b'1 - toeplitz_hash_2_or_4_field_enable
  7051. * b'31:2 - reserved : Reserved for future use
  7052. * ---------+------+----------------------------------------------------------
  7053. * bit1 | bit0 | Functionality
  7054. * ---------+------+----------------------------------------------------------
  7055. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7056. * | | in flow_id_toeplitz field
  7057. * ---------+------+----------------------------------------------------------
  7058. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7059. * | | in toeplitz_hash_2_or_4 field
  7060. * ---------+------+----------------------------------------------------------
  7061. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7062. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7063. * ---------+------+----------------------------------------------------------
  7064. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7065. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7066. * | | toeplitz_hash_2_or_4 field
  7067. *----------------------------------------------------------------------------
  7068. */
  7069. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7070. A_UINT32 msg_type :8,
  7071. pdev_id :8,
  7072. reserved0 :16;
  7073. A_UINT32 flow_id_toeplitz_field_enable :1,
  7074. toeplitz_hash_2_or_4_field_enable :1,
  7075. reserved1 :30;
  7076. } POSTPACK;
  7077. /* DWORD0 : pdev_id configuration Macros */
  7078. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7079. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7080. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7081. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7082. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7083. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7084. do { \
  7085. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7086. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7087. } while (0)
  7088. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7089. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7090. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7091. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7092. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7093. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7094. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7095. do { \
  7096. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7097. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7098. } while (0)
  7099. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7100. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7101. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7102. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7103. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7104. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7105. do { \
  7106. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7107. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7108. } while (0)
  7109. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7110. /**
  7111. * @brief host --> target Host PA Address Size
  7112. *
  7113. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7114. *
  7115. * @details
  7116. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7117. * provide the physical start address and size of each of the memory
  7118. * areas within host DDR that the target FW may need to access.
  7119. *
  7120. * For example, the host can use this message to allow the target FW
  7121. * to set up access to the host's pools of TQM link descriptors.
  7122. * The message would appear as follows:
  7123. *
  7124. * |31 24|23 16|15 8|7 0|
  7125. * |----------------+----------------+----------------+----------------|
  7126. * | reserved | num_entries | msg_type |
  7127. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7128. * | mem area 0 size |
  7129. * |----------------+----------------+----------------+----------------|
  7130. * | mem area 0 physical_address_lo |
  7131. * |----------------+----------------+----------------+----------------|
  7132. * | mem area 0 physical_address_hi |
  7133. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7134. * | mem area 1 size |
  7135. * |----------------+----------------+----------------+----------------|
  7136. * | mem area 1 physical_address_lo |
  7137. * |----------------+----------------+----------------+----------------|
  7138. * | mem area 1 physical_address_hi |
  7139. * |----------------+----------------+----------------+----------------|
  7140. * ...
  7141. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7142. * | mem area N size |
  7143. * |----------------+----------------+----------------+----------------|
  7144. * | mem area N physical_address_lo |
  7145. * |----------------+----------------+----------------+----------------|
  7146. * | mem area N physical_address_hi |
  7147. * |----------------+----------------+----------------+----------------|
  7148. *
  7149. * The message is interpreted as follows:
  7150. * dword0 - b'0:7 - msg_type: This will be set to
  7151. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7152. * b'8:15 - number_entries: Indicated the number of host memory
  7153. * areas specified within the remainder of the message
  7154. * b'16:31 - reserved.
  7155. * dword1 - b'0:31 - memory area 0 size in bytes
  7156. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7157. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7158. * and similar for memory area 1 through memory area N.
  7159. */
  7160. PREPACK struct htt_h2t_host_paddr_size {
  7161. A_UINT32 msg_type: 8,
  7162. num_entries: 8,
  7163. reserved: 16;
  7164. } POSTPACK;
  7165. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7166. A_UINT32 size;
  7167. A_UINT32 physical_address_lo;
  7168. A_UINT32 physical_address_hi;
  7169. } POSTPACK;
  7170. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7171. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7172. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7173. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7174. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7175. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7176. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7177. do { \
  7178. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7179. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7180. } while (0)
  7181. /**
  7182. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7183. *
  7184. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7185. *
  7186. * @details
  7187. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7188. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7189. *
  7190. * The message would appear as follows:
  7191. *
  7192. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7193. * |---------------------------------+---+---+----------+-+-----------|
  7194. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7195. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7196. *
  7197. *
  7198. * The message is interpreted as follows:
  7199. * dword0 - b'0:7 - msg_type: This will be set to
  7200. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7201. * b'8 - override bit to drive MSDUs to PPE ring
  7202. * b'9:13 - REO destination ring indication
  7203. * b'14 - Multi buffer msdu override enable bit
  7204. * b'15 - Intra BSS override
  7205. * b'16 - Decap raw override
  7206. * b'17 - Decap Native wifi override
  7207. * b'18 - IP frag override
  7208. * b'19:31 - reserved
  7209. */
  7210. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7211. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7212. override: 1,
  7213. reo_destination_indication: 5,
  7214. multi_buffer_msdu_override_en: 1,
  7215. intra_bss_override: 1,
  7216. decap_raw_override: 1,
  7217. decap_nwifi_override: 1,
  7218. ip_frag_override: 1,
  7219. reserved: 13;
  7220. } POSTPACK;
  7221. /* DWORD 0: Override */
  7222. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7223. #define HTT_PPE_CFG_OVERRIDE_S 8
  7224. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7225. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7226. HTT_PPE_CFG_OVERRIDE_S)
  7227. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7228. do { \
  7229. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7230. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7231. } while (0)
  7232. /* DWORD 0: REO Destination Indication*/
  7233. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7234. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7235. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7236. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7237. HTT_PPE_CFG_REO_DEST_IND_S)
  7238. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7239. do { \
  7240. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7241. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7242. } while (0)
  7243. /* DWORD 0: Multi buffer MSDU override */
  7244. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7245. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7246. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7247. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7248. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7249. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7250. do { \
  7251. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7252. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7253. } while (0)
  7254. /* DWORD 0: Intra BSS override */
  7255. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7256. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7257. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7258. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7259. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7260. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7261. do { \
  7262. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7263. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7264. } while (0)
  7265. /* DWORD 0: Decap RAW override */
  7266. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7267. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7268. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7269. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7270. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7271. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7272. do { \
  7273. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7274. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7275. } while (0)
  7276. /* DWORD 0: Decap NWIFI override */
  7277. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7278. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7279. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7280. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7281. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7282. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7283. do { \
  7284. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7285. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7286. } while (0)
  7287. /* DWORD 0: IP frag override */
  7288. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7289. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7290. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7291. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7292. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7293. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7294. do { \
  7295. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7296. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7297. } while (0)
  7298. /*
  7299. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7300. *
  7301. * @details
  7302. * The following field definitions describe the format of the HTT host
  7303. * to target FW VDEV TX RX stats retrieve message.
  7304. * The message specifies the type of stats the host wants to retrieve.
  7305. *
  7306. * |31 27|26 25|24 17|16|15 8|7 0|
  7307. * |-----------------------------------------------------------|
  7308. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7309. * |-----------------------------------------------------------|
  7310. * | vdev_id lower bitmask |
  7311. * |-----------------------------------------------------------|
  7312. * | vdev_id upper bitmask |
  7313. * |-----------------------------------------------------------|
  7314. * Header fields:
  7315. * Where:
  7316. * dword0 - b'7:0 - msg_type: This will be set to
  7317. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7318. * b'15:8 - pdev id
  7319. * b'16(E) - Enable/Disable the vdev HW stats
  7320. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7321. * b'25:26(R) - Reset stats bits
  7322. * 0: don't reset stats
  7323. * 1: reset stats once
  7324. * 2: reset stats at the start of each periodic interval
  7325. * b'27:31 - reserved for future use
  7326. * dword1 - b'0:31 - vdev_id lower bitmask
  7327. * dword2 - b'0:31 - vdev_id upper bitmask
  7328. */
  7329. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7330. A_UINT32 msg_type :8,
  7331. pdev_id :8,
  7332. enable :1,
  7333. periodic_interval :8,
  7334. reset_stats_bits :2,
  7335. reserved0 :5;
  7336. A_UINT32 vdev_id_lower_bitmask;
  7337. A_UINT32 vdev_id_upper_bitmask;
  7338. } POSTPACK;
  7339. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7340. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7341. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7342. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7343. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7344. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7345. do { \
  7346. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7347. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7348. } while (0)
  7349. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7350. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7351. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7352. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7353. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7354. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7355. do { \
  7356. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7357. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7358. } while (0)
  7359. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7360. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7361. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7362. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7363. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7364. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7365. do { \
  7366. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7367. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7368. } while (0)
  7369. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7370. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7371. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7372. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7373. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7374. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7375. do { \
  7376. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7377. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7378. } while (0)
  7379. /*=== target -> host messages ===============================================*/
  7380. enum htt_t2h_msg_type {
  7381. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7382. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7383. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7384. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7385. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7386. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7387. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7388. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7389. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7390. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7391. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7392. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7393. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7394. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7395. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7396. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7397. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7398. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7399. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7400. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7401. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7402. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7403. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7404. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7405. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7406. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7407. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7408. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7409. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7410. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7411. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7412. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7413. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7414. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7415. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7416. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7417. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7418. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7419. /* TX_OFFLOAD_DELIVER_IND:
  7420. * Forward the target's locally-generated packets to the host,
  7421. * to provide to the monitor mode interface.
  7422. */
  7423. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7424. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7425. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7426. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7427. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7428. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7429. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7430. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7431. HTT_T2H_MSG_TYPE_TEST,
  7432. /* keep this last */
  7433. HTT_T2H_NUM_MSGS
  7434. };
  7435. /*
  7436. * HTT target to host message type -
  7437. * stored in bits 7:0 of the first word of the message
  7438. */
  7439. #define HTT_T2H_MSG_TYPE_M 0xff
  7440. #define HTT_T2H_MSG_TYPE_S 0
  7441. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7442. do { \
  7443. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7444. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7445. } while (0)
  7446. #define HTT_T2H_MSG_TYPE_GET(word) \
  7447. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7448. /**
  7449. * @brief target -> host version number confirmation message definition
  7450. *
  7451. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7452. *
  7453. * |31 24|23 16|15 8|7 0|
  7454. * |----------------+----------------+----------------+----------------|
  7455. * | reserved | major number | minor number | msg type |
  7456. * |-------------------------------------------------------------------|
  7457. * : option request TLV (optional) |
  7458. * :...................................................................:
  7459. *
  7460. * The VER_CONF message may consist of a single 4-byte word, or may be
  7461. * extended with TLVs that specify HTT options selected by the target.
  7462. * The following option TLVs may be appended to the VER_CONF message:
  7463. * - LL_BUS_ADDR_SIZE
  7464. * - HL_SUPPRESS_TX_COMPL_IND
  7465. * - MAX_TX_QUEUE_GROUPS
  7466. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7467. * may be appended to the VER_CONF message (but only one TLV of each type).
  7468. *
  7469. * Header fields:
  7470. * - MSG_TYPE
  7471. * Bits 7:0
  7472. * Purpose: identifies this as a version number confirmation message
  7473. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7474. * - VER_MINOR
  7475. * Bits 15:8
  7476. * Purpose: Specify the minor number of the HTT message library version
  7477. * in use by the target firmware.
  7478. * The minor number specifies the specific revision within a range
  7479. * of fundamentally compatible HTT message definition revisions.
  7480. * Compatible revisions involve adding new messages or perhaps
  7481. * adding new fields to existing messages, in a backwards-compatible
  7482. * manner.
  7483. * Incompatible revisions involve changing the message type values,
  7484. * or redefining existing messages.
  7485. * Value: minor number
  7486. * - VER_MAJOR
  7487. * Bits 15:8
  7488. * Purpose: Specify the major number of the HTT message library version
  7489. * in use by the target firmware.
  7490. * The major number specifies the family of minor revisions that are
  7491. * fundamentally compatible with each other, but not with prior or
  7492. * later families.
  7493. * Value: major number
  7494. */
  7495. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7496. #define HTT_VER_CONF_MINOR_S 8
  7497. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7498. #define HTT_VER_CONF_MAJOR_S 16
  7499. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7500. do { \
  7501. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7502. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7503. } while (0)
  7504. #define HTT_VER_CONF_MINOR_GET(word) \
  7505. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7506. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7507. do { \
  7508. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7509. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7510. } while (0)
  7511. #define HTT_VER_CONF_MAJOR_GET(word) \
  7512. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7513. #define HTT_VER_CONF_BYTES 4
  7514. /**
  7515. * @brief - target -> host HTT Rx In order indication message
  7516. *
  7517. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7518. *
  7519. * @details
  7520. *
  7521. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7522. * |----------------+-------------------+---------------------+---------------|
  7523. * | peer ID | P| F| O| ext TID | msg type |
  7524. * |--------------------------------------------------------------------------|
  7525. * | MSDU count | Reserved | vdev id |
  7526. * |--------------------------------------------------------------------------|
  7527. * | MSDU 0 bus address (bits 31:0) |
  7528. #if HTT_PADDR64
  7529. * | MSDU 0 bus address (bits 63:32) |
  7530. #endif
  7531. * |--------------------------------------------------------------------------|
  7532. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7533. * |--------------------------------------------------------------------------|
  7534. * | MSDU 1 bus address (bits 31:0) |
  7535. #if HTT_PADDR64
  7536. * | MSDU 1 bus address (bits 63:32) |
  7537. #endif
  7538. * |--------------------------------------------------------------------------|
  7539. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7540. * |--------------------------------------------------------------------------|
  7541. */
  7542. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7543. *
  7544. * @details
  7545. * bits
  7546. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7547. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7548. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7549. * | | frag | | | | fail |chksum fail|
  7550. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7551. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7552. */
  7553. struct htt_rx_in_ord_paddr_ind_hdr_t
  7554. {
  7555. A_UINT32 /* word 0 */
  7556. msg_type: 8,
  7557. ext_tid: 5,
  7558. offload: 1,
  7559. frag: 1,
  7560. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7561. peer_id: 16;
  7562. A_UINT32 /* word 1 */
  7563. vap_id: 8,
  7564. /* NOTE:
  7565. * This reserved_1 field is not truly reserved - certain targets use
  7566. * this field internally to store debug information, and do not zero
  7567. * out the contents of the field before uploading the message to the
  7568. * host. Thus, any host-target communication supported by this field
  7569. * is limited to using values that are never used by the debug
  7570. * information stored by certain targets in the reserved_1 field.
  7571. * In particular, the targets in question don't use the value 0x3
  7572. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7573. * so this previously-unused value within these bits is available to
  7574. * use as the host / target PKT_CAPTURE_MODE flag.
  7575. */
  7576. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7577. /* if pkt_capture_mode == 0x3, host should
  7578. * send rx frames to monitor mode interface
  7579. */
  7580. msdu_cnt: 16;
  7581. };
  7582. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7583. {
  7584. A_UINT32 dma_addr;
  7585. A_UINT32
  7586. length: 16,
  7587. fw_desc: 8,
  7588. msdu_info:8;
  7589. };
  7590. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7591. {
  7592. A_UINT32 dma_addr_lo;
  7593. A_UINT32 dma_addr_hi;
  7594. A_UINT32
  7595. length: 16,
  7596. fw_desc: 8,
  7597. msdu_info:8;
  7598. };
  7599. #if HTT_PADDR64
  7600. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7601. #else
  7602. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7603. #endif
  7604. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7605. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7606. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7607. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7608. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7609. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7610. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7611. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7612. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7613. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7614. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7615. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7616. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7617. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7618. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7619. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7620. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7621. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7622. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7623. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7624. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7625. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7626. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7627. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7628. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7629. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7630. /* for systems using 64-bit format for bus addresses */
  7631. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7632. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7633. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7634. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7635. /* for systems using 32-bit format for bus addresses */
  7636. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7637. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7638. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7639. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7640. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7641. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7642. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7643. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7644. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7645. do { \
  7646. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7647. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7648. } while (0)
  7649. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7650. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7651. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7652. do { \
  7653. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7654. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7655. } while (0)
  7656. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7657. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7658. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7659. do { \
  7660. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7661. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7662. } while (0)
  7663. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7664. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7665. /*
  7666. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7667. * deliver the rx frames to the monitor mode interface.
  7668. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7669. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7670. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7671. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7672. */
  7673. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7674. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7675. do { \
  7676. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7677. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7678. } while (0)
  7679. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7680. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7681. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7682. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7683. do { \
  7684. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7685. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7686. } while (0)
  7687. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7688. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7689. /* for systems using 64-bit format for bus addresses */
  7690. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7691. do { \
  7692. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7693. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7694. } while (0)
  7695. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7696. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7697. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7698. do { \
  7699. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7700. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7701. } while (0)
  7702. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7703. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7704. /* for systems using 32-bit format for bus addresses */
  7705. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7706. do { \
  7707. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7708. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7709. } while (0)
  7710. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7711. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7712. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7715. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7716. } while (0)
  7717. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7718. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7719. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7722. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7723. } while (0)
  7724. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7725. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7726. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7727. do { \
  7728. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7729. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7730. } while (0)
  7731. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7732. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7733. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7734. do { \
  7735. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7736. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7737. } while (0)
  7738. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7739. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7740. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7741. do { \
  7742. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7743. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7744. } while (0)
  7745. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7746. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7747. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7748. do { \
  7749. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7750. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7751. } while (0)
  7752. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7753. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7754. /* definitions used within target -> host rx indication message */
  7755. PREPACK struct htt_rx_ind_hdr_prefix_t
  7756. {
  7757. A_UINT32 /* word 0 */
  7758. msg_type: 8,
  7759. ext_tid: 5,
  7760. release_valid: 1,
  7761. flush_valid: 1,
  7762. reserved0: 1,
  7763. peer_id: 16;
  7764. A_UINT32 /* word 1 */
  7765. flush_start_seq_num: 6,
  7766. flush_end_seq_num: 6,
  7767. release_start_seq_num: 6,
  7768. release_end_seq_num: 6,
  7769. num_mpdu_ranges: 8;
  7770. } POSTPACK;
  7771. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7772. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7773. #define HTT_TGT_RSSI_INVALID 0x80
  7774. PREPACK struct htt_rx_ppdu_desc_t
  7775. {
  7776. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7777. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7778. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7779. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7780. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7781. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7782. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7783. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7784. A_UINT32 /* word 0 */
  7785. rssi_cmb: 8,
  7786. timestamp_submicrosec: 8,
  7787. phy_err_code: 8,
  7788. phy_err: 1,
  7789. legacy_rate: 4,
  7790. legacy_rate_sel: 1,
  7791. end_valid: 1,
  7792. start_valid: 1;
  7793. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7794. union {
  7795. A_UINT32 /* word 1 */
  7796. rssi0_pri20: 8,
  7797. rssi0_ext20: 8,
  7798. rssi0_ext40: 8,
  7799. rssi0_ext80: 8;
  7800. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7801. } u0;
  7802. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7803. union {
  7804. A_UINT32 /* word 2 */
  7805. rssi1_pri20: 8,
  7806. rssi1_ext20: 8,
  7807. rssi1_ext40: 8,
  7808. rssi1_ext80: 8;
  7809. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7810. } u1;
  7811. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7812. union {
  7813. A_UINT32 /* word 3 */
  7814. rssi2_pri20: 8,
  7815. rssi2_ext20: 8,
  7816. rssi2_ext40: 8,
  7817. rssi2_ext80: 8;
  7818. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7819. } u2;
  7820. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7821. union {
  7822. A_UINT32 /* word 4 */
  7823. rssi3_pri20: 8,
  7824. rssi3_ext20: 8,
  7825. rssi3_ext40: 8,
  7826. rssi3_ext80: 8;
  7827. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7828. } u3;
  7829. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7830. A_UINT32 tsf32; /* word 5 */
  7831. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7832. A_UINT32 timestamp_microsec; /* word 6 */
  7833. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7834. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7835. A_UINT32 /* word 7 */
  7836. vht_sig_a1: 24,
  7837. preamble_type: 8;
  7838. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7839. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7840. A_UINT32 /* word 8 */
  7841. vht_sig_a2: 24,
  7842. /* sa_ant_matrix
  7843. * For cases where a single rx chain has options to be connected to
  7844. * different rx antennas, show which rx antennas were in use during
  7845. * receipt of a given PPDU.
  7846. * This sa_ant_matrix provides a bitmask of the antennas used while
  7847. * receiving this frame.
  7848. */
  7849. sa_ant_matrix: 8;
  7850. } POSTPACK;
  7851. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7852. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7853. PREPACK struct htt_rx_ind_hdr_suffix_t
  7854. {
  7855. A_UINT32 /* word 0 */
  7856. fw_rx_desc_bytes: 16,
  7857. reserved0: 16;
  7858. } POSTPACK;
  7859. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7860. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7861. PREPACK struct htt_rx_ind_hdr_t
  7862. {
  7863. struct htt_rx_ind_hdr_prefix_t prefix;
  7864. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7865. struct htt_rx_ind_hdr_suffix_t suffix;
  7866. } POSTPACK;
  7867. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7868. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7869. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7870. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7871. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7872. /*
  7873. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7874. * the offset into the HTT rx indication message at which the
  7875. * FW rx PPDU descriptor resides
  7876. */
  7877. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7878. /*
  7879. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7880. * the offset into the HTT rx indication message at which the
  7881. * header suffix (FW rx MSDU byte count) resides
  7882. */
  7883. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7884. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7885. /*
  7886. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7887. * the offset into the HTT rx indication message at which the per-MSDU
  7888. * information starts
  7889. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7890. * per-MSDU information portion of the message. The per-MSDU info itself
  7891. * starts at byte 12.
  7892. */
  7893. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7894. /**
  7895. * @brief target -> host rx indication message definition
  7896. *
  7897. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7898. *
  7899. * @details
  7900. * The following field definitions describe the format of the rx indication
  7901. * message sent from the target to the host.
  7902. * The message consists of three major sections:
  7903. * 1. a fixed-length header
  7904. * 2. a variable-length list of firmware rx MSDU descriptors
  7905. * 3. one or more 4-octet MPDU range information elements
  7906. * The fixed length header itself has two sub-sections
  7907. * 1. the message meta-information, including identification of the
  7908. * sender and type of the received data, and a 4-octet flush/release IE
  7909. * 2. the firmware rx PPDU descriptor
  7910. *
  7911. * The format of the message is depicted below.
  7912. * in this depiction, the following abbreviations are used for information
  7913. * elements within the message:
  7914. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7915. * elements associated with the PPDU start are valid.
  7916. * Specifically, the following fields are valid only if SV is set:
  7917. * RSSI (all variants), L, legacy rate, preamble type, service,
  7918. * VHT-SIG-A
  7919. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7920. * elements associated with the PPDU end are valid.
  7921. * Specifically, the following fields are valid only if EV is set:
  7922. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7923. * - L - Legacy rate selector - if legacy rates are used, this flag
  7924. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7925. * (L == 0) PHY.
  7926. * - P - PHY error flag - boolean indication of whether the rx frame had
  7927. * a PHY error
  7928. *
  7929. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7930. * |----------------+-------------------+---------------------+---------------|
  7931. * | peer ID | |RV|FV| ext TID | msg type |
  7932. * |--------------------------------------------------------------------------|
  7933. * | num | release | release | flush | flush |
  7934. * | MPDU | end | start | end | start |
  7935. * | ranges | seq num | seq num | seq num | seq num |
  7936. * |==========================================================================|
  7937. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7938. * |V|V| | rate | | | timestamp | RSSI |
  7939. * |--------------------------------------------------------------------------|
  7940. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7941. * |--------------------------------------------------------------------------|
  7942. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7943. * |--------------------------------------------------------------------------|
  7944. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7945. * |--------------------------------------------------------------------------|
  7946. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7947. * |--------------------------------------------------------------------------|
  7948. * | TSF LSBs |
  7949. * |--------------------------------------------------------------------------|
  7950. * | microsec timestamp |
  7951. * |--------------------------------------------------------------------------|
  7952. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7953. * |--------------------------------------------------------------------------|
  7954. * | service | HT-SIG / VHT-SIG-A2 |
  7955. * |==========================================================================|
  7956. * | reserved | FW rx desc bytes |
  7957. * |--------------------------------------------------------------------------|
  7958. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7959. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7960. * |--------------------------------------------------------------------------|
  7961. * : : :
  7962. * |--------------------------------------------------------------------------|
  7963. * | alignment | MSDU Rx |
  7964. * | padding | desc Bn |
  7965. * |--------------------------------------------------------------------------|
  7966. * | reserved | MPDU range status | MPDU count |
  7967. * |--------------------------------------------------------------------------|
  7968. * : reserved : MPDU range status : MPDU count :
  7969. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7970. *
  7971. * Header fields:
  7972. * - MSG_TYPE
  7973. * Bits 7:0
  7974. * Purpose: identifies this as an rx indication message
  7975. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7976. * - EXT_TID
  7977. * Bits 12:8
  7978. * Purpose: identify the traffic ID of the rx data, including
  7979. * special "extended" TID values for multicast, broadcast, and
  7980. * non-QoS data frames
  7981. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7982. * - FLUSH_VALID (FV)
  7983. * Bit 13
  7984. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7985. * is valid
  7986. * Value:
  7987. * 1 -> flush IE is valid and needs to be processed
  7988. * 0 -> flush IE is not valid and should be ignored
  7989. * - REL_VALID (RV)
  7990. * Bit 13
  7991. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7992. * is valid
  7993. * Value:
  7994. * 1 -> release IE is valid and needs to be processed
  7995. * 0 -> release IE is not valid and should be ignored
  7996. * - PEER_ID
  7997. * Bits 31:16
  7998. * Purpose: Identify, by ID, which peer sent the rx data
  7999. * Value: ID of the peer who sent the rx data
  8000. * - FLUSH_SEQ_NUM_START
  8001. * Bits 5:0
  8002. * Purpose: Indicate the start of a series of MPDUs to flush
  8003. * Not all MPDUs within this series are necessarily valid - the host
  8004. * must check each sequence number within this range to see if the
  8005. * corresponding MPDU is actually present.
  8006. * This field is only valid if the FV bit is set.
  8007. * Value:
  8008. * The sequence number for the first MPDUs to check to flush.
  8009. * The sequence number is masked by 0x3f.
  8010. * - FLUSH_SEQ_NUM_END
  8011. * Bits 11:6
  8012. * Purpose: Indicate the end of a series of MPDUs to flush
  8013. * Value:
  8014. * The sequence number one larger than the sequence number of the
  8015. * last MPDU to check to flush.
  8016. * The sequence number is masked by 0x3f.
  8017. * Not all MPDUs within this series are necessarily valid - the host
  8018. * must check each sequence number within this range to see if the
  8019. * corresponding MPDU is actually present.
  8020. * This field is only valid if the FV bit is set.
  8021. * - REL_SEQ_NUM_START
  8022. * Bits 17:12
  8023. * Purpose: Indicate the start of a series of MPDUs to release.
  8024. * All MPDUs within this series are present and valid - the host
  8025. * need not check each sequence number within this range to see if
  8026. * the corresponding MPDU is actually present.
  8027. * This field is only valid if the RV bit is set.
  8028. * Value:
  8029. * The sequence number for the first MPDUs to check to release.
  8030. * The sequence number is masked by 0x3f.
  8031. * - REL_SEQ_NUM_END
  8032. * Bits 23:18
  8033. * Purpose: Indicate the end of a series of MPDUs to release.
  8034. * Value:
  8035. * The sequence number one larger than the sequence number of the
  8036. * last MPDU to check to release.
  8037. * The sequence number is masked by 0x3f.
  8038. * All MPDUs within this series are present and valid - the host
  8039. * need not check each sequence number within this range to see if
  8040. * the corresponding MPDU is actually present.
  8041. * This field is only valid if the RV bit is set.
  8042. * - NUM_MPDU_RANGES
  8043. * Bits 31:24
  8044. * Purpose: Indicate how many ranges of MPDUs are present.
  8045. * Each MPDU range consists of a series of contiguous MPDUs within the
  8046. * rx frame sequence which all have the same MPDU status.
  8047. * Value: 1-63 (typically a small number, like 1-3)
  8048. *
  8049. * Rx PPDU descriptor fields:
  8050. * - RSSI_CMB
  8051. * Bits 7:0
  8052. * Purpose: Combined RSSI from all active rx chains, across the active
  8053. * bandwidth.
  8054. * Value: RSSI dB units w.r.t. noise floor
  8055. * - TIMESTAMP_SUBMICROSEC
  8056. * Bits 15:8
  8057. * Purpose: high-resolution timestamp
  8058. * Value:
  8059. * Sub-microsecond time of PPDU reception.
  8060. * This timestamp ranges from [0,MAC clock MHz).
  8061. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8062. * to form a high-resolution, large range rx timestamp.
  8063. * - PHY_ERR_CODE
  8064. * Bits 23:16
  8065. * Purpose:
  8066. * If the rx frame processing resulted in a PHY error, indicate what
  8067. * type of rx PHY error occurred.
  8068. * Value:
  8069. * This field is valid if the "P" (PHY_ERR) flag is set.
  8070. * TBD: document/specify the values for this field
  8071. * - PHY_ERR
  8072. * Bit 24
  8073. * Purpose: indicate whether the rx PPDU had a PHY error
  8074. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8075. * - LEGACY_RATE
  8076. * Bits 28:25
  8077. * Purpose:
  8078. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8079. * specify which rate was used.
  8080. * Value:
  8081. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8082. * flag.
  8083. * If LEGACY_RATE_SEL is 0:
  8084. * 0x8: OFDM 48 Mbps
  8085. * 0x9: OFDM 24 Mbps
  8086. * 0xA: OFDM 12 Mbps
  8087. * 0xB: OFDM 6 Mbps
  8088. * 0xC: OFDM 54 Mbps
  8089. * 0xD: OFDM 36 Mbps
  8090. * 0xE: OFDM 18 Mbps
  8091. * 0xF: OFDM 9 Mbps
  8092. * If LEGACY_RATE_SEL is 1:
  8093. * 0x8: CCK 11 Mbps long preamble
  8094. * 0x9: CCK 5.5 Mbps long preamble
  8095. * 0xA: CCK 2 Mbps long preamble
  8096. * 0xB: CCK 1 Mbps long preamble
  8097. * 0xC: CCK 11 Mbps short preamble
  8098. * 0xD: CCK 5.5 Mbps short preamble
  8099. * 0xE: CCK 2 Mbps short preamble
  8100. * - LEGACY_RATE_SEL
  8101. * Bit 29
  8102. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8103. * Value:
  8104. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8105. * used a legacy rate.
  8106. * 0 -> OFDM, 1 -> CCK
  8107. * - END_VALID
  8108. * Bit 30
  8109. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8110. * the start of the PPDU are valid. Specifically, the following
  8111. * fields are only valid if END_VALID is set:
  8112. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8113. * TIMESTAMP_SUBMICROSEC
  8114. * Value:
  8115. * 0 -> rx PPDU desc end fields are not valid
  8116. * 1 -> rx PPDU desc end fields are valid
  8117. * - START_VALID
  8118. * Bit 31
  8119. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8120. * the end of the PPDU are valid. Specifically, the following
  8121. * fields are only valid if START_VALID is set:
  8122. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8123. * VHT-SIG-A
  8124. * Value:
  8125. * 0 -> rx PPDU desc start fields are not valid
  8126. * 1 -> rx PPDU desc start fields are valid
  8127. * - RSSI0_PRI20
  8128. * Bits 7:0
  8129. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8130. * Value: RSSI dB units w.r.t. noise floor
  8131. *
  8132. * - RSSI0_EXT20
  8133. * Bits 7:0
  8134. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8135. * (if the rx bandwidth was >= 40 MHz)
  8136. * Value: RSSI dB units w.r.t. noise floor
  8137. * - RSSI0_EXT40
  8138. * Bits 7:0
  8139. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8140. * (if the rx bandwidth was >= 80 MHz)
  8141. * Value: RSSI dB units w.r.t. noise floor
  8142. * - RSSI0_EXT80
  8143. * Bits 7:0
  8144. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8145. * (if the rx bandwidth was >= 160 MHz)
  8146. * Value: RSSI dB units w.r.t. noise floor
  8147. *
  8148. * - RSSI1_PRI20
  8149. * Bits 7:0
  8150. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8151. * Value: RSSI dB units w.r.t. noise floor
  8152. * - RSSI1_EXT20
  8153. * Bits 7:0
  8154. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8155. * (if the rx bandwidth was >= 40 MHz)
  8156. * Value: RSSI dB units w.r.t. noise floor
  8157. * - RSSI1_EXT40
  8158. * Bits 7:0
  8159. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8160. * (if the rx bandwidth was >= 80 MHz)
  8161. * Value: RSSI dB units w.r.t. noise floor
  8162. * - RSSI1_EXT80
  8163. * Bits 7:0
  8164. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8165. * (if the rx bandwidth was >= 160 MHz)
  8166. * Value: RSSI dB units w.r.t. noise floor
  8167. *
  8168. * - RSSI2_PRI20
  8169. * Bits 7:0
  8170. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8171. * Value: RSSI dB units w.r.t. noise floor
  8172. * - RSSI2_EXT20
  8173. * Bits 7:0
  8174. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8175. * (if the rx bandwidth was >= 40 MHz)
  8176. * Value: RSSI dB units w.r.t. noise floor
  8177. * - RSSI2_EXT40
  8178. * Bits 7:0
  8179. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8180. * (if the rx bandwidth was >= 80 MHz)
  8181. * Value: RSSI dB units w.r.t. noise floor
  8182. * - RSSI2_EXT80
  8183. * Bits 7:0
  8184. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8185. * (if the rx bandwidth was >= 160 MHz)
  8186. * Value: RSSI dB units w.r.t. noise floor
  8187. *
  8188. * - RSSI3_PRI20
  8189. * Bits 7:0
  8190. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8191. * Value: RSSI dB units w.r.t. noise floor
  8192. * - RSSI3_EXT20
  8193. * Bits 7:0
  8194. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8195. * (if the rx bandwidth was >= 40 MHz)
  8196. * Value: RSSI dB units w.r.t. noise floor
  8197. * - RSSI3_EXT40
  8198. * Bits 7:0
  8199. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8200. * (if the rx bandwidth was >= 80 MHz)
  8201. * Value: RSSI dB units w.r.t. noise floor
  8202. * - RSSI3_EXT80
  8203. * Bits 7:0
  8204. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8205. * (if the rx bandwidth was >= 160 MHz)
  8206. * Value: RSSI dB units w.r.t. noise floor
  8207. *
  8208. * - TSF32
  8209. * Bits 31:0
  8210. * Purpose: specify the time the rx PPDU was received, in TSF units
  8211. * Value: 32 LSBs of the TSF
  8212. * - TIMESTAMP_MICROSEC
  8213. * Bits 31:0
  8214. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8215. * Value: PPDU rx time, in microseconds
  8216. * - VHT_SIG_A1
  8217. * Bits 23:0
  8218. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8219. * from the rx PPDU
  8220. * Value:
  8221. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8222. * VHT-SIG-A1 data.
  8223. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8224. * first 24 bits of the HT-SIG data.
  8225. * Otherwise, this field is invalid.
  8226. * Refer to the the 802.11 protocol for the definition of the
  8227. * HT-SIG and VHT-SIG-A1 fields
  8228. * - VHT_SIG_A2
  8229. * Bits 23:0
  8230. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8231. * from the rx PPDU
  8232. * Value:
  8233. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8234. * VHT-SIG-A2 data.
  8235. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8236. * last 24 bits of the HT-SIG data.
  8237. * Otherwise, this field is invalid.
  8238. * Refer to the the 802.11 protocol for the definition of the
  8239. * HT-SIG and VHT-SIG-A2 fields
  8240. * - PREAMBLE_TYPE
  8241. * Bits 31:24
  8242. * Purpose: indicate the PHY format of the received burst
  8243. * Value:
  8244. * 0x4: Legacy (OFDM/CCK)
  8245. * 0x8: HT
  8246. * 0x9: HT with TxBF
  8247. * 0xC: VHT
  8248. * 0xD: VHT with TxBF
  8249. * - SERVICE
  8250. * Bits 31:24
  8251. * Purpose: TBD
  8252. * Value: TBD
  8253. *
  8254. * Rx MSDU descriptor fields:
  8255. * - FW_RX_DESC_BYTES
  8256. * Bits 15:0
  8257. * Purpose: Indicate how many bytes in the Rx indication are used for
  8258. * FW Rx descriptors
  8259. *
  8260. * Payload fields:
  8261. * - MPDU_COUNT
  8262. * Bits 7:0
  8263. * Purpose: Indicate how many sequential MPDUs share the same status.
  8264. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8265. * - MPDU_STATUS
  8266. * Bits 15:8
  8267. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8268. * received successfully.
  8269. * Value:
  8270. * 0x1: success
  8271. * 0x2: FCS error
  8272. * 0x3: duplicate error
  8273. * 0x4: replay error
  8274. * 0x5: invalid peer
  8275. */
  8276. /* header fields */
  8277. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8278. #define HTT_RX_IND_EXT_TID_S 8
  8279. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8280. #define HTT_RX_IND_FLUSH_VALID_S 13
  8281. #define HTT_RX_IND_REL_VALID_M 0x4000
  8282. #define HTT_RX_IND_REL_VALID_S 14
  8283. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8284. #define HTT_RX_IND_PEER_ID_S 16
  8285. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8286. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8287. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8288. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8289. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8290. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8291. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8292. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8293. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8294. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8295. /* rx PPDU descriptor fields */
  8296. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8297. #define HTT_RX_IND_RSSI_CMB_S 0
  8298. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8299. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8300. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8301. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8302. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8303. #define HTT_RX_IND_PHY_ERR_S 24
  8304. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8305. #define HTT_RX_IND_LEGACY_RATE_S 25
  8306. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8307. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8308. #define HTT_RX_IND_END_VALID_M 0x40000000
  8309. #define HTT_RX_IND_END_VALID_S 30
  8310. #define HTT_RX_IND_START_VALID_M 0x80000000
  8311. #define HTT_RX_IND_START_VALID_S 31
  8312. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8313. #define HTT_RX_IND_RSSI_PRI20_S 0
  8314. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8315. #define HTT_RX_IND_RSSI_EXT20_S 8
  8316. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8317. #define HTT_RX_IND_RSSI_EXT40_S 16
  8318. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8319. #define HTT_RX_IND_RSSI_EXT80_S 24
  8320. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8321. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8322. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8323. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8324. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8325. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8326. #define HTT_RX_IND_SERVICE_M 0xff000000
  8327. #define HTT_RX_IND_SERVICE_S 24
  8328. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8329. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8330. /* rx MSDU descriptor fields */
  8331. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8332. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8333. /* payload fields */
  8334. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8335. #define HTT_RX_IND_MPDU_COUNT_S 0
  8336. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8337. #define HTT_RX_IND_MPDU_STATUS_S 8
  8338. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8339. do { \
  8340. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8341. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8342. } while (0)
  8343. #define HTT_RX_IND_EXT_TID_GET(word) \
  8344. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8345. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8346. do { \
  8347. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8348. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8349. } while (0)
  8350. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8351. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8352. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8353. do { \
  8354. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8355. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8356. } while (0)
  8357. #define HTT_RX_IND_REL_VALID_GET(word) \
  8358. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8359. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8362. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8363. } while (0)
  8364. #define HTT_RX_IND_PEER_ID_GET(word) \
  8365. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8366. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8367. do { \
  8368. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8369. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8370. } while (0)
  8371. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8372. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8373. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8374. do { \
  8375. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8376. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8377. } while (0)
  8378. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8379. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8380. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8381. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8382. do { \
  8383. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8384. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8385. } while (0)
  8386. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8387. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8388. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8389. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8390. do { \
  8391. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8392. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8393. } while (0)
  8394. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8395. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8396. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8397. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8398. do { \
  8399. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8400. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8401. } while (0)
  8402. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8403. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8404. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8405. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8406. do { \
  8407. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8408. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8409. } while (0)
  8410. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8411. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8412. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8413. /* FW rx PPDU descriptor fields */
  8414. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8415. do { \
  8416. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8417. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8418. } while (0)
  8419. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8420. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8421. HTT_RX_IND_RSSI_CMB_S)
  8422. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8423. do { \
  8424. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8425. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8426. } while (0)
  8427. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8428. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8429. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8430. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8431. do { \
  8432. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8433. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8434. } while (0)
  8435. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8436. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8437. HTT_RX_IND_PHY_ERR_CODE_S)
  8438. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8439. do { \
  8440. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8441. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8442. } while (0)
  8443. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8444. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8445. HTT_RX_IND_PHY_ERR_S)
  8446. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8447. do { \
  8448. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8449. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8450. } while (0)
  8451. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8452. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8453. HTT_RX_IND_LEGACY_RATE_S)
  8454. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8455. do { \
  8456. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8457. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8458. } while (0)
  8459. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8460. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8461. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8462. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8463. do { \
  8464. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8465. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8466. } while (0)
  8467. #define HTT_RX_IND_END_VALID_GET(word) \
  8468. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8469. HTT_RX_IND_END_VALID_S)
  8470. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8471. do { \
  8472. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8473. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8474. } while (0)
  8475. #define HTT_RX_IND_START_VALID_GET(word) \
  8476. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8477. HTT_RX_IND_START_VALID_S)
  8478. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8481. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8482. } while (0)
  8483. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8484. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8485. HTT_RX_IND_RSSI_PRI20_S)
  8486. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8487. do { \
  8488. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8489. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8490. } while (0)
  8491. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8492. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8493. HTT_RX_IND_RSSI_EXT20_S)
  8494. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8495. do { \
  8496. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8497. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8498. } while (0)
  8499. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8500. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8501. HTT_RX_IND_RSSI_EXT40_S)
  8502. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8503. do { \
  8504. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8505. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8506. } while (0)
  8507. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8508. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8509. HTT_RX_IND_RSSI_EXT80_S)
  8510. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8511. do { \
  8512. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8513. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8514. } while (0)
  8515. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8516. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8517. HTT_RX_IND_VHT_SIG_A1_S)
  8518. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8519. do { \
  8520. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8521. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8522. } while (0)
  8523. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8524. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8525. HTT_RX_IND_VHT_SIG_A2_S)
  8526. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8527. do { \
  8528. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8529. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8530. } while (0)
  8531. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8532. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8533. HTT_RX_IND_PREAMBLE_TYPE_S)
  8534. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8535. do { \
  8536. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8537. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8538. } while (0)
  8539. #define HTT_RX_IND_SERVICE_GET(word) \
  8540. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8541. HTT_RX_IND_SERVICE_S)
  8542. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8543. do { \
  8544. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8545. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8546. } while (0)
  8547. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8548. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8549. HTT_RX_IND_SA_ANT_MATRIX_S)
  8550. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8551. do { \
  8552. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8553. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8554. } while (0)
  8555. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8556. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8557. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8558. do { \
  8559. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8560. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8561. } while (0)
  8562. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8563. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8564. #define HTT_RX_IND_HL_BYTES \
  8565. (HTT_RX_IND_HDR_BYTES + \
  8566. 4 /* single FW rx MSDU descriptor */ + \
  8567. 4 /* single MPDU range information element */)
  8568. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8569. /* Could we use one macro entry? */
  8570. #define HTT_WORD_SET(word, field, value) \
  8571. do { \
  8572. HTT_CHECK_SET_VAL(field, value); \
  8573. (word) |= ((value) << field ## _S); \
  8574. } while (0)
  8575. #define HTT_WORD_GET(word, field) \
  8576. (((word) & field ## _M) >> field ## _S)
  8577. PREPACK struct hl_htt_rx_ind_base {
  8578. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8579. } POSTPACK;
  8580. /*
  8581. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8582. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8583. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8584. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8585. * htt_rx_ind_hl_rx_desc_t.
  8586. */
  8587. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8588. struct htt_rx_ind_hl_rx_desc_t {
  8589. A_UINT8 ver;
  8590. A_UINT8 len;
  8591. struct {
  8592. A_UINT8
  8593. first_msdu: 1,
  8594. last_msdu: 1,
  8595. c3_failed: 1,
  8596. c4_failed: 1,
  8597. ipv6: 1,
  8598. tcp: 1,
  8599. udp: 1,
  8600. reserved: 1;
  8601. } flags;
  8602. /* NOTE: no reserved space - don't append any new fields here */
  8603. };
  8604. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8605. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8606. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8607. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8608. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8609. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8610. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8611. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8612. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8613. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8614. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8615. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8616. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8617. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8618. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8619. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8620. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8621. /* This structure is used in HL, the basic descriptor information
  8622. * used by host. the structure is translated by FW from HW desc
  8623. * or generated by FW. But in HL monitor mode, the host would use
  8624. * the same structure with LL.
  8625. */
  8626. PREPACK struct hl_htt_rx_desc_base {
  8627. A_UINT32
  8628. seq_num:12,
  8629. encrypted:1,
  8630. chan_info_present:1,
  8631. resv0:2,
  8632. mcast_bcast:1,
  8633. fragment:1,
  8634. key_id_oct:8,
  8635. resv1:6;
  8636. A_UINT32
  8637. pn_31_0;
  8638. union {
  8639. struct {
  8640. A_UINT16 pn_47_32;
  8641. A_UINT16 pn_63_48;
  8642. } pn16;
  8643. A_UINT32 pn_63_32;
  8644. } u0;
  8645. A_UINT32
  8646. pn_95_64;
  8647. A_UINT32
  8648. pn_127_96;
  8649. } POSTPACK;
  8650. /*
  8651. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8652. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8653. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8654. * Please see htt_chan_change_t for description of the fields.
  8655. */
  8656. PREPACK struct htt_chan_info_t
  8657. {
  8658. A_UINT32 primary_chan_center_freq_mhz: 16,
  8659. contig_chan1_center_freq_mhz: 16;
  8660. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8661. phy_mode: 8,
  8662. reserved: 8;
  8663. } POSTPACK;
  8664. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8665. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8666. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8667. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8668. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8669. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8670. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8671. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8672. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8673. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8674. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8675. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8676. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8677. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8678. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8679. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8680. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8681. /* Channel information */
  8682. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8683. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8684. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8685. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8686. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8687. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8688. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8689. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8690. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8691. do { \
  8692. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8693. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8694. } while (0)
  8695. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8696. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8697. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8698. do { \
  8699. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8700. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8701. } while (0)
  8702. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8703. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8704. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8705. do { \
  8706. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8707. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8708. } while (0)
  8709. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8710. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8711. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8712. do { \
  8713. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8714. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8715. } while (0)
  8716. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8717. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8718. /*
  8719. * @brief target -> host message definition for FW offloaded pkts
  8720. *
  8721. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8722. *
  8723. * @details
  8724. * The following field definitions describe the format of the firmware
  8725. * offload deliver message sent from the target to the host.
  8726. *
  8727. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8728. *
  8729. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8730. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8731. * | reserved_1 | msg type |
  8732. * |--------------------------------------------------------------------------|
  8733. * | phy_timestamp_l32 |
  8734. * |--------------------------------------------------------------------------|
  8735. * | WORD2 (see below) |
  8736. * |--------------------------------------------------------------------------|
  8737. * | seqno | framectrl |
  8738. * |--------------------------------------------------------------------------|
  8739. * | reserved_3 | vdev_id | tid_num|
  8740. * |--------------------------------------------------------------------------|
  8741. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8742. * |--------------------------------------------------------------------------|
  8743. *
  8744. * where:
  8745. * STAT = status
  8746. * F = format (802.3 vs. 802.11)
  8747. *
  8748. * definition for word 2
  8749. *
  8750. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8751. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8752. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8753. * |--------------------------------------------------------------------------|
  8754. *
  8755. * where:
  8756. * PR = preamble
  8757. * BF = beamformed
  8758. */
  8759. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8760. {
  8761. A_UINT32 /* word 0 */
  8762. msg_type:8, /* [ 7: 0] */
  8763. reserved_1:24; /* [31: 8] */
  8764. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8765. A_UINT32 /* word 2 */
  8766. /* preamble:
  8767. * 0-OFDM,
  8768. * 1-CCk,
  8769. * 2-HT,
  8770. * 3-VHT
  8771. */
  8772. preamble: 2, /* [1:0] */
  8773. /* mcs:
  8774. * In case of HT preamble interpret
  8775. * MCS along with NSS.
  8776. * Valid values for HT are 0 to 7.
  8777. * HT mcs 0 with NSS 2 is mcs 8.
  8778. * Valid values for VHT are 0 to 9.
  8779. */
  8780. mcs: 4, /* [5:2] */
  8781. /* rate:
  8782. * This is applicable only for
  8783. * CCK and OFDM preamble type
  8784. * rate 0: OFDM 48 Mbps,
  8785. * 1: OFDM 24 Mbps,
  8786. * 2: OFDM 12 Mbps
  8787. * 3: OFDM 6 Mbps
  8788. * 4: OFDM 54 Mbps
  8789. * 5: OFDM 36 Mbps
  8790. * 6: OFDM 18 Mbps
  8791. * 7: OFDM 9 Mbps
  8792. * rate 0: CCK 11 Mbps Long
  8793. * 1: CCK 5.5 Mbps Long
  8794. * 2: CCK 2 Mbps Long
  8795. * 3: CCK 1 Mbps Long
  8796. * 4: CCK 11 Mbps Short
  8797. * 5: CCK 5.5 Mbps Short
  8798. * 6: CCK 2 Mbps Short
  8799. */
  8800. rate : 3, /* [ 8: 6] */
  8801. rssi : 8, /* [16: 9] units=dBm */
  8802. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8803. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8804. stbc : 1, /* [22] */
  8805. sgi : 1, /* [23] */
  8806. ldpc : 1, /* [24] */
  8807. beamformed: 1, /* [25] */
  8808. reserved_2: 6; /* [31:26] */
  8809. A_UINT32 /* word 3 */
  8810. framectrl:16, /* [15: 0] */
  8811. seqno:16; /* [31:16] */
  8812. A_UINT32 /* word 4 */
  8813. tid_num:5, /* [ 4: 0] actual TID number */
  8814. vdev_id:8, /* [12: 5] */
  8815. reserved_3:19; /* [31:13] */
  8816. A_UINT32 /* word 5 */
  8817. /* status:
  8818. * 0: tx_ok
  8819. * 1: retry
  8820. * 2: drop
  8821. * 3: filtered
  8822. * 4: abort
  8823. * 5: tid delete
  8824. * 6: sw abort
  8825. * 7: dropped by peer migration
  8826. */
  8827. status:3, /* [2:0] */
  8828. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8829. tx_mpdu_bytes:16, /* [19:4] */
  8830. /* Indicates retry count of offloaded/local generated Data tx frames */
  8831. tx_retry_cnt:6, /* [25:20] */
  8832. reserved_4:6; /* [31:26] */
  8833. } POSTPACK;
  8834. /* FW offload deliver ind message header fields */
  8835. /* DWORD one */
  8836. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8837. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8838. /* DWORD two */
  8839. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8840. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8841. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8842. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8843. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8844. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8845. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8846. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8847. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8848. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8849. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8850. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8851. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8852. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8853. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8854. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8855. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8856. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8857. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8858. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8859. /* DWORD three*/
  8860. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8861. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8862. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8863. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8864. /* DWORD four */
  8865. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8866. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8867. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8868. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8869. /* DWORD five */
  8870. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8871. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8872. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8873. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8874. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8875. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8876. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8877. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8878. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8879. do { \
  8880. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8881. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8882. } while (0)
  8883. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8884. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8885. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8886. do { \
  8887. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8888. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8889. } while (0)
  8890. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8891. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8892. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8893. do { \
  8894. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8895. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8896. } while (0)
  8897. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8898. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8899. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8900. do { \
  8901. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8902. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8903. } while (0)
  8904. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8905. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8906. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8907. do { \
  8908. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8909. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8910. } while (0)
  8911. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8912. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8913. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8914. do { \
  8915. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8916. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8917. } while (0)
  8918. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8919. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8920. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8921. do { \
  8922. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8923. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8924. } while (0)
  8925. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8926. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8927. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8928. do { \
  8929. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8930. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8931. } while (0)
  8932. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8933. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8934. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8935. do { \
  8936. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8937. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8938. } while (0)
  8939. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8940. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8941. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8942. do { \
  8943. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8944. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8945. } while (0)
  8946. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8947. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8948. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8949. do { \
  8950. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8951. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8952. } while (0)
  8953. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8954. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8955. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8956. do { \
  8957. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8958. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8959. } while (0)
  8960. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8961. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8962. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8963. do { \
  8964. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8965. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8966. } while (0)
  8967. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8968. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8969. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8970. do { \
  8971. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8972. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8973. } while (0)
  8974. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8975. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8976. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8977. do { \
  8978. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8979. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8980. } while (0)
  8981. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8982. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8983. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8984. do { \
  8985. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8986. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8987. } while (0)
  8988. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8989. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8990. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8991. do { \
  8992. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8993. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8994. } while (0)
  8995. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8996. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8997. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8998. do { \
  8999. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9000. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9001. } while (0)
  9002. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9003. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9004. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9005. do { \
  9006. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9007. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9008. } while (0)
  9009. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9010. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9011. /*
  9012. * @brief target -> host rx reorder flush message definition
  9013. *
  9014. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9015. *
  9016. * @details
  9017. * The following field definitions describe the format of the rx flush
  9018. * message sent from the target to the host.
  9019. * The message consists of a 4-octet header, followed by one or more
  9020. * 4-octet payload information elements.
  9021. *
  9022. * |31 24|23 8|7 0|
  9023. * |--------------------------------------------------------------|
  9024. * | TID | peer ID | msg type |
  9025. * |--------------------------------------------------------------|
  9026. * | seq num end | seq num start | MPDU status | reserved |
  9027. * |--------------------------------------------------------------|
  9028. * First DWORD:
  9029. * - MSG_TYPE
  9030. * Bits 7:0
  9031. * Purpose: identifies this as an rx flush message
  9032. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9033. * - PEER_ID
  9034. * Bits 23:8 (only bits 18:8 actually used)
  9035. * Purpose: identify which peer's rx data is being flushed
  9036. * Value: (rx) peer ID
  9037. * - TID
  9038. * Bits 31:24 (only bits 27:24 actually used)
  9039. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9040. * Value: traffic identifier
  9041. * Second DWORD:
  9042. * - MPDU_STATUS
  9043. * Bits 15:8
  9044. * Purpose:
  9045. * Indicate whether the flushed MPDUs should be discarded or processed.
  9046. * Value:
  9047. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9048. * stages of rx processing
  9049. * other: discard the MPDUs
  9050. * It is anticipated that flush messages will always have
  9051. * MPDU status == 1, but the status flag is included for
  9052. * flexibility.
  9053. * - SEQ_NUM_START
  9054. * Bits 23:16
  9055. * Purpose:
  9056. * Indicate the start of a series of consecutive MPDUs being flushed.
  9057. * Not all MPDUs within this range are necessarily valid - the host
  9058. * must check each sequence number within this range to see if the
  9059. * corresponding MPDU is actually present.
  9060. * Value:
  9061. * The sequence number for the first MPDU in the sequence.
  9062. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9063. * - SEQ_NUM_END
  9064. * Bits 30:24
  9065. * Purpose:
  9066. * Indicate the end of a series of consecutive MPDUs being flushed.
  9067. * Value:
  9068. * The sequence number one larger than the sequence number of the
  9069. * last MPDU being flushed.
  9070. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9071. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9072. * are to be released for further rx processing.
  9073. * Not all MPDUs within this range are necessarily valid - the host
  9074. * must check each sequence number within this range to see if the
  9075. * corresponding MPDU is actually present.
  9076. */
  9077. /* first DWORD */
  9078. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9079. #define HTT_RX_FLUSH_PEER_ID_S 8
  9080. #define HTT_RX_FLUSH_TID_M 0xff000000
  9081. #define HTT_RX_FLUSH_TID_S 24
  9082. /* second DWORD */
  9083. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9084. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9085. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9086. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9087. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9088. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9089. #define HTT_RX_FLUSH_BYTES 8
  9090. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9091. do { \
  9092. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9093. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9094. } while (0)
  9095. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9096. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9097. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9098. do { \
  9099. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9100. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9101. } while (0)
  9102. #define HTT_RX_FLUSH_TID_GET(word) \
  9103. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9104. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9105. do { \
  9106. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9107. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9108. } while (0)
  9109. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9110. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9111. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9112. do { \
  9113. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9114. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9115. } while (0)
  9116. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9117. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9118. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9119. do { \
  9120. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9121. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9122. } while (0)
  9123. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9124. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9125. /*
  9126. * @brief target -> host rx pn check indication message
  9127. *
  9128. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9129. *
  9130. * @details
  9131. * The following field definitions describe the format of the Rx PN check
  9132. * indication message sent from the target to the host.
  9133. * The message consists of a 4-octet header, followed by the start and
  9134. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9135. * IE is one octet containing the sequence number that failed the PN
  9136. * check.
  9137. *
  9138. * |31 24|23 8|7 0|
  9139. * |--------------------------------------------------------------|
  9140. * | TID | peer ID | msg type |
  9141. * |--------------------------------------------------------------|
  9142. * | Reserved | PN IE count | seq num end | seq num start|
  9143. * |--------------------------------------------------------------|
  9144. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9145. * |--------------------------------------------------------------|
  9146. * First DWORD:
  9147. * - MSG_TYPE
  9148. * Bits 7:0
  9149. * Purpose: Identifies this as an rx pn check indication message
  9150. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9151. * - PEER_ID
  9152. * Bits 23:8 (only bits 18:8 actually used)
  9153. * Purpose: identify which peer
  9154. * Value: (rx) peer ID
  9155. * - TID
  9156. * Bits 31:24 (only bits 27:24 actually used)
  9157. * Purpose: identify traffic identifier
  9158. * Value: traffic identifier
  9159. * Second DWORD:
  9160. * - SEQ_NUM_START
  9161. * Bits 7:0
  9162. * Purpose:
  9163. * Indicates the starting sequence number of the MPDU in this
  9164. * series of MPDUs that went though PN check.
  9165. * Value:
  9166. * The sequence number for the first MPDU in the sequence.
  9167. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9168. * - SEQ_NUM_END
  9169. * Bits 15:8
  9170. * Purpose:
  9171. * Indicates the ending sequence number of the MPDU in this
  9172. * series of MPDUs that went though PN check.
  9173. * Value:
  9174. * The sequence number one larger then the sequence number of the last
  9175. * MPDU being flushed.
  9176. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9177. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9178. * for invalid PN numbers and are ready to be released for further processing.
  9179. * Not all MPDUs within this range are necessarily valid - the host
  9180. * must check each sequence number within this range to see if the
  9181. * corresponding MPDU is actually present.
  9182. * - PN_IE_COUNT
  9183. * Bits 23:16
  9184. * Purpose:
  9185. * Used to determine the variable number of PN information elements in this
  9186. * message
  9187. *
  9188. * PN information elements:
  9189. * - PN_IE_x-
  9190. * Purpose:
  9191. * Each PN information element contains the sequence number of the MPDU that
  9192. * has failed the target PN check.
  9193. * Value:
  9194. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9195. * that failed the PN check.
  9196. */
  9197. /* first DWORD */
  9198. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9199. #define HTT_RX_PN_IND_PEER_ID_S 8
  9200. #define HTT_RX_PN_IND_TID_M 0xff000000
  9201. #define HTT_RX_PN_IND_TID_S 24
  9202. /* second DWORD */
  9203. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9204. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9205. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9206. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9207. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9208. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9209. #define HTT_RX_PN_IND_BYTES 8
  9210. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9211. do { \
  9212. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9213. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9214. } while (0)
  9215. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9216. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9217. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9218. do { \
  9219. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9220. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9221. } while (0)
  9222. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9223. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9224. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9225. do { \
  9226. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9227. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9228. } while (0)
  9229. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9230. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9231. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9232. do { \
  9233. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9234. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9235. } while (0)
  9236. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9237. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9238. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9239. do { \
  9240. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9241. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9242. } while (0)
  9243. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9244. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9245. /*
  9246. * @brief target -> host rx offload deliver message for LL system
  9247. *
  9248. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9249. *
  9250. * @details
  9251. * In a low latency system this message is sent whenever the offload
  9252. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9253. * The DMA of the actual packets into host memory is done before sending out
  9254. * this message. This message indicates only how many MSDUs to reap. The
  9255. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9256. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9257. * DMA'd by the MAC directly into host memory these packets do not contain
  9258. * the MAC descriptors in the header portion of the packet. Instead they contain
  9259. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9260. * message, the packets are delivered directly to the NW stack without going
  9261. * through the regular reorder buffering and PN checking path since it has
  9262. * already been done in target.
  9263. *
  9264. * |31 24|23 16|15 8|7 0|
  9265. * |-----------------------------------------------------------------------|
  9266. * | Total MSDU count | reserved | msg type |
  9267. * |-----------------------------------------------------------------------|
  9268. *
  9269. * @brief target -> host rx offload deliver message for HL system
  9270. *
  9271. * @details
  9272. * In a high latency system this message is sent whenever the offload manager
  9273. * flushes out the packets it has coalesced in its coalescing buffer. The
  9274. * actual packets are also carried along with this message. When the host
  9275. * receives this message, it is expected to deliver these packets to the NW
  9276. * stack directly instead of routing them through the reorder buffering and
  9277. * PN checking path since it has already been done in target.
  9278. *
  9279. * |31 24|23 16|15 8|7 0|
  9280. * |-----------------------------------------------------------------------|
  9281. * | Total MSDU count | reserved | msg type |
  9282. * |-----------------------------------------------------------------------|
  9283. * | peer ID | MSDU length |
  9284. * |-----------------------------------------------------------------------|
  9285. * | MSDU payload | FW Desc | tid | vdev ID |
  9286. * |-----------------------------------------------------------------------|
  9287. * | MSDU payload contd. |
  9288. * |-----------------------------------------------------------------------|
  9289. * | peer ID | MSDU length |
  9290. * |-----------------------------------------------------------------------|
  9291. * | MSDU payload | FW Desc | tid | vdev ID |
  9292. * |-----------------------------------------------------------------------|
  9293. * | MSDU payload contd. |
  9294. * |-----------------------------------------------------------------------|
  9295. *
  9296. */
  9297. /* first DWORD */
  9298. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9299. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9301. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9303. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9304. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9306. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9307. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9308. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9309. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9310. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9311. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9312. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9313. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9314. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9315. do { \
  9316. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9317. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9318. } while (0)
  9319. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9320. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9321. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9322. do { \
  9323. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9324. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9325. } while (0)
  9326. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9327. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9328. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9329. do { \
  9330. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9331. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9332. } while (0)
  9333. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9334. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9335. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9336. do { \
  9337. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9338. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9339. } while (0)
  9340. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9341. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9342. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9343. do { \
  9344. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9345. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9346. } while (0)
  9347. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9348. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9349. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9350. do { \
  9351. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9352. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9353. } while (0)
  9354. /**
  9355. * @brief target -> host rx peer map/unmap message definition
  9356. *
  9357. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9358. *
  9359. * @details
  9360. * The following diagram shows the format of the rx peer map message sent
  9361. * from the target to the host. This layout assumes the target operates
  9362. * as little-endian.
  9363. *
  9364. * This message always contains a SW peer ID. The main purpose of the
  9365. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9366. * with, so that the host can use that peer ID to determine which peer
  9367. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9368. * other purposes, such as identifying during tx completions which peer
  9369. * the tx frames in question were transmitted to.
  9370. *
  9371. * In certain generations of chips, the peer map message also contains
  9372. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9373. * to identify which peer the frame needs to be forwarded to (i.e. the
  9374. * peer assocated with the Destination MAC Address within the packet),
  9375. * and particularly which vdev needs to transmit the frame (for cases
  9376. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9377. * meaning as AST_INDEX_0.
  9378. * This DA-based peer ID that is provided for certain rx frames
  9379. * (the rx frames that need to be re-transmitted as tx frames)
  9380. * is the ID that the HW uses for referring to the peer in question,
  9381. * rather than the peer ID that the SW+FW use to refer to the peer.
  9382. *
  9383. *
  9384. * |31 24|23 16|15 8|7 0|
  9385. * |-----------------------------------------------------------------------|
  9386. * | SW peer ID | VDEV ID | msg type |
  9387. * |-----------------------------------------------------------------------|
  9388. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9389. * |-----------------------------------------------------------------------|
  9390. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9391. * |-----------------------------------------------------------------------|
  9392. *
  9393. *
  9394. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9395. *
  9396. * The following diagram shows the format of the rx peer unmap message sent
  9397. * from the target to the host.
  9398. *
  9399. * |31 24|23 16|15 8|7 0|
  9400. * |-----------------------------------------------------------------------|
  9401. * | SW peer ID | VDEV ID | msg type |
  9402. * |-----------------------------------------------------------------------|
  9403. *
  9404. * The following field definitions describe the format of the rx peer map
  9405. * and peer unmap messages sent from the target to the host.
  9406. * - MSG_TYPE
  9407. * Bits 7:0
  9408. * Purpose: identifies this as an rx peer map or peer unmap message
  9409. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9410. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9411. * - VDEV_ID
  9412. * Bits 15:8
  9413. * Purpose: Indicates which virtual device the peer is associated
  9414. * with.
  9415. * Value: vdev ID (used in the host to look up the vdev object)
  9416. * - PEER_ID (a.k.a. SW_PEER_ID)
  9417. * Bits 31:16
  9418. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9419. * freeing (unmap)
  9420. * Value: (rx) peer ID
  9421. * - MAC_ADDR_L32 (peer map only)
  9422. * Bits 31:0
  9423. * Purpose: Identifies which peer node the peer ID is for.
  9424. * Value: lower 4 bytes of peer node's MAC address
  9425. * - MAC_ADDR_U16 (peer map only)
  9426. * Bits 15:0
  9427. * Purpose: Identifies which peer node the peer ID is for.
  9428. * Value: upper 2 bytes of peer node's MAC address
  9429. * - HW_PEER_ID
  9430. * Bits 31:16
  9431. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9432. * address, so for rx frames marked for rx --> tx forwarding, the
  9433. * host can determine from the HW peer ID provided as meta-data with
  9434. * the rx frame which peer the frame is supposed to be forwarded to.
  9435. * Value: ID used by the MAC HW to identify the peer
  9436. */
  9437. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9438. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9439. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9440. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9441. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9442. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9443. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9444. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9445. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9446. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9447. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9448. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9449. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9450. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9451. do { \
  9452. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9453. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9454. } while (0)
  9455. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9456. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9457. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9458. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9459. do { \
  9460. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9461. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9462. } while (0)
  9463. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9464. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9465. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9466. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9467. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9468. do { \
  9469. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9470. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9471. } while (0)
  9472. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9473. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9474. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9475. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9476. #define HTT_RX_PEER_MAP_BYTES 12
  9477. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9478. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9479. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9480. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9481. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9482. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9483. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9484. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9485. #define HTT_RX_PEER_UNMAP_BYTES 4
  9486. /**
  9487. * @brief target -> host rx peer map V2 message definition
  9488. *
  9489. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9490. *
  9491. * @details
  9492. * The following diagram shows the format of the rx peer map v2 message sent
  9493. * from the target to the host. This layout assumes the target operates
  9494. * as little-endian.
  9495. *
  9496. * This message always contains a SW peer ID. The main purpose of the
  9497. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9498. * with, so that the host can use that peer ID to determine which peer
  9499. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9500. * other purposes, such as identifying during tx completions which peer
  9501. * the tx frames in question were transmitted to.
  9502. *
  9503. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9504. * is used during rx --> tx frame forwarding to identify which peer the
  9505. * frame needs to be forwarded to (i.e. the peer assocated with the
  9506. * Destination MAC Address within the packet), and particularly which vdev
  9507. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9508. * This DA-based peer ID that is provided for certain rx frames
  9509. * (the rx frames that need to be re-transmitted as tx frames)
  9510. * is the ID that the HW uses for referring to the peer in question,
  9511. * rather than the peer ID that the SW+FW use to refer to the peer.
  9512. *
  9513. * The HW peer id here is the same meaning as AST_INDEX_0.
  9514. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9515. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9516. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9517. * AST is valid.
  9518. *
  9519. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9520. * |-------------------------------------------------------------------------|
  9521. * | SW peer ID | VDEV ID | msg type |
  9522. * |-------------------------------------------------------------------------|
  9523. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9524. * |-------------------------------------------------------------------------|
  9525. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9526. * |-------------------------------------------------------------------------|
  9527. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9528. * |-------------------------------------------------------------------------|
  9529. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9530. * |-------------------------------------------------------------------------|
  9531. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9532. * |-------------------------------------------------------------------------|
  9533. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9534. * |-------------------------------------------------------------------------|
  9535. * | Reserved_2 |
  9536. * |-------------------------------------------------------------------------|
  9537. * Where:
  9538. * NH = Next Hop
  9539. * ASTVM = AST valid mask
  9540. * OA = on-chip AST valid bit
  9541. * ASTFM = AST flow mask
  9542. *
  9543. * The following field definitions describe the format of the rx peer map v2
  9544. * messages sent from the target to the host.
  9545. * - MSG_TYPE
  9546. * Bits 7:0
  9547. * Purpose: identifies this as an rx peer map v2 message
  9548. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9549. * - VDEV_ID
  9550. * Bits 15:8
  9551. * Purpose: Indicates which virtual device the peer is associated with.
  9552. * Value: vdev ID (used in the host to look up the vdev object)
  9553. * - SW_PEER_ID
  9554. * Bits 31:16
  9555. * Purpose: The peer ID (index) that WAL is allocating
  9556. * Value: (rx) peer ID
  9557. * - MAC_ADDR_L32
  9558. * Bits 31:0
  9559. * Purpose: Identifies which peer node the peer ID is for.
  9560. * Value: lower 4 bytes of peer node's MAC address
  9561. * - MAC_ADDR_U16
  9562. * Bits 15:0
  9563. * Purpose: Identifies which peer node the peer ID is for.
  9564. * Value: upper 2 bytes of peer node's MAC address
  9565. * - HW_PEER_ID / AST_INDEX_0
  9566. * Bits 31:16
  9567. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9568. * address, so for rx frames marked for rx --> tx forwarding, the
  9569. * host can determine from the HW peer ID provided as meta-data with
  9570. * the rx frame which peer the frame is supposed to be forwarded to.
  9571. * Value: ID used by the MAC HW to identify the peer
  9572. * - AST_HASH_VALUE
  9573. * Bits 15:0
  9574. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9575. * override feature.
  9576. * - NEXT_HOP
  9577. * Bit 16
  9578. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9579. * (Wireless Distribution System).
  9580. * - AST_VALID_MASK
  9581. * Bits 19:17
  9582. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9583. * - ONCHIP_AST_VALID_FLAG
  9584. * Bit 20
  9585. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9586. * is valid.
  9587. * - AST_INDEX_1
  9588. * Bits 15:0
  9589. * Purpose: indicate the second AST index for this peer
  9590. * - AST_0_FLOW_MASK
  9591. * Bits 19:16
  9592. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9593. * - AST_1_FLOW_MASK
  9594. * Bits 23:20
  9595. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9596. * - AST_2_FLOW_MASK
  9597. * Bits 27:24
  9598. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9599. * - AST_3_FLOW_MASK
  9600. * Bits 31:28
  9601. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9602. * - AST_INDEX_2
  9603. * Bits 15:0
  9604. * Purpose: indicate the third AST index for this peer
  9605. * - TID_VALID_HI_PRI
  9606. * Bits 23:16
  9607. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9608. * - TID_VALID_LOW_PRI
  9609. * Bits 31:24
  9610. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9611. * - AST_INDEX_3
  9612. * Bits 15:0
  9613. * Purpose: indicate the fourth AST index for this peer
  9614. * - ONCHIP_AST_IDX / RESERVED
  9615. * Bits 31:16
  9616. * Purpose: This field is valid only when split AST feature is enabled.
  9617. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9618. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9619. * address, this ast_idx is used for LMAC modules for RXPCU.
  9620. * Value: ID used by the LMAC HW to identify the peer
  9621. */
  9622. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9623. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9624. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9625. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9626. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9627. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9628. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9629. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9630. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9631. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9632. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9633. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9634. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9635. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9636. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9637. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9638. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9639. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9640. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9641. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9642. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9643. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9644. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9645. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9646. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9647. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9648. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9649. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9650. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9651. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9652. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9653. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9654. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9655. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9656. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9657. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9658. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9659. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9660. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9661. do { \
  9662. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9663. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9664. } while (0)
  9665. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9666. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9667. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9668. do { \
  9669. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9670. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9671. } while (0)
  9672. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9673. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9674. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9675. do { \
  9676. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9677. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9678. } while (0)
  9679. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9680. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9681. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9682. do { \
  9683. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9684. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9685. } while (0)
  9686. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9687. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9688. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9689. do { \
  9690. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9691. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9692. } while (0)
  9693. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9694. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9695. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9696. do { \
  9697. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9698. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9699. } while (0)
  9700. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9701. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9702. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9703. do { \
  9704. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9705. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9706. } while (0)
  9707. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9708. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9709. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9710. do { \
  9711. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9712. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9713. } while (0)
  9714. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9715. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9716. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9717. do { \
  9718. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9719. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9720. } while (0)
  9721. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9722. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9723. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9724. do { \
  9725. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9726. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9727. } while (0)
  9728. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9729. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9730. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9731. do { \
  9732. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9733. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9734. } while (0)
  9735. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9736. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9737. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9738. do { \
  9739. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9740. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9741. } while (0)
  9742. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9743. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9744. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9745. do { \
  9746. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9747. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9748. } while (0)
  9749. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9750. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9751. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9752. do { \
  9753. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9754. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9755. } while (0)
  9756. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9757. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9758. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9759. do { \
  9760. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9761. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9762. } while (0)
  9763. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9764. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9765. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9766. do { \
  9767. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9768. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9769. } while (0)
  9770. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9771. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9772. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9773. do { \
  9774. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9775. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9776. } while (0)
  9777. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9778. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9779. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9780. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9781. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9782. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9783. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9784. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9785. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9786. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9787. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9788. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9789. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9790. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9791. /**
  9792. * @brief target -> host rx peer map V3 message definition
  9793. *
  9794. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9795. *
  9796. * @details
  9797. * The following diagram shows the format of the rx peer map v3 message sent
  9798. * from the target to the host.
  9799. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9800. * This layout assumes the target operates as little-endian.
  9801. *
  9802. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9803. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9804. * | SW peer ID | VDEV ID | msg type |
  9805. * |-----------------+--------------------+-----------------+-----------------|
  9806. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9807. * |-----------------+--------------------+-----------------+-----------------|
  9808. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9809. * |-----------------+--------+-----------+-----------------+-----------------|
  9810. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9811. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9812. * | (8bits) | | (4bits) | |
  9813. * |-----------------+--------+--+--+--+--------------------------------------|
  9814. * | RESERVED |E |O | | |
  9815. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9816. * | |V |V | | |
  9817. * |-----------------+--------------------+-----------------------------------|
  9818. * | HTT_MSDU_IDX_ | RESERVED | |
  9819. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9820. * | (8bits) | | |
  9821. * |-----------------+--------------------+-----------------------------------|
  9822. * | Reserved_2 |
  9823. * |--------------------------------------------------------------------------|
  9824. * | Reserved_3 |
  9825. * |--------------------------------------------------------------------------|
  9826. *
  9827. * Where:
  9828. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9829. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9830. * NH = Next Hop
  9831. * The following field definitions describe the format of the rx peer map v3
  9832. * messages sent from the target to the host.
  9833. * - MSG_TYPE
  9834. * Bits 7:0
  9835. * Purpose: identifies this as a peer map v3 message
  9836. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9837. * - VDEV_ID
  9838. * Bits 15:8
  9839. * Purpose: Indicates which virtual device the peer is associated with.
  9840. * - SW_PEER_ID
  9841. * Bits 31:16
  9842. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9843. * - MAC_ADDR_L32
  9844. * Bits 31:0
  9845. * Purpose: Identifies which peer node the peer ID is for.
  9846. * Value: lower 4 bytes of peer node's MAC address
  9847. * - MAC_ADDR_U16
  9848. * Bits 15:0
  9849. * Purpose: Identifies which peer node the peer ID is for.
  9850. * Value: upper 2 bytes of peer node's MAC address
  9851. * - MULTICAST_SW_PEER_ID
  9852. * Bits 31:16
  9853. * Purpose: The multicast peer ID (index)
  9854. * Value: set to HTT_INVALID_PEER if not valid
  9855. * - HW_PEER_ID / AST_INDEX
  9856. * Bits 15:0
  9857. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9858. * address, so for rx frames marked for rx --> tx forwarding, the
  9859. * host can determine from the HW peer ID provided as meta-data with
  9860. * the rx frame which peer the frame is supposed to be forwarded to.
  9861. * - CACHE_SET_NUM
  9862. * Bits 19:16
  9863. * Purpose: Cache Set Number for AST_INDEX
  9864. * Cache set number that should be used to cache the index based
  9865. * search results, for address and flow search.
  9866. * This value should be equal to LSB 4 bits of the hash value
  9867. * of match data, in case of search index points to an entry which
  9868. * may be used in content based search also. The value can be
  9869. * anything when the entry pointed by search index will not be
  9870. * used for content based search.
  9871. * - HTT_MSDU_IDX_VALID_MASK
  9872. * Bits 31:24
  9873. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9874. * - ONCHIP_AST_IDX / RESERVED
  9875. * Bits 15:0
  9876. * Purpose: This field is valid only when split AST feature is enabled.
  9877. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9878. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9879. * address, this ast_idx is used for LMAC modules for RXPCU.
  9880. * - NEXT_HOP
  9881. * Bits 16
  9882. * Purpose: Flag indicates next_hop AST entry used for WDS
  9883. * (Wireless Distribution System).
  9884. * - ONCHIP_AST_VALID
  9885. * Bits 17
  9886. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9887. * - EXT_AST_VALID
  9888. * Bits 18
  9889. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9890. * - EXT_AST_INDEX
  9891. * Bits 15:0
  9892. * Purpose: This field describes Extended AST index
  9893. * Valid if EXT_AST_VALID flag set
  9894. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9895. * Bits 31:24
  9896. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9897. */
  9898. /* dword 0 */
  9899. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9900. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9901. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9902. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9903. /* dword 1 */
  9904. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9905. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9906. /* dword 2 */
  9907. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9908. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9909. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9910. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9911. /* dword 3 */
  9912. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9913. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9914. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9915. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9916. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9917. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9918. /* dword 4 */
  9919. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9920. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9921. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9922. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9923. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9924. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9925. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9926. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9927. /* dword 5 */
  9928. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9929. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9930. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9931. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9932. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9933. do { \
  9934. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9935. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9936. } while (0)
  9937. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9938. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9939. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9940. do { \
  9941. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9942. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9943. } while (0)
  9944. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9945. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9946. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9947. do { \
  9948. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9949. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9950. } while (0)
  9951. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9952. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9953. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9954. do { \
  9955. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9956. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9957. } while (0)
  9958. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9959. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9960. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9961. do { \
  9962. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9963. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9964. } while (0)
  9965. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9966. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9967. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9968. do { \
  9969. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9970. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9971. } while (0)
  9972. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9973. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9974. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9975. do { \
  9976. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9977. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9978. } while (0)
  9979. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9980. (((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)
  9981. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9982. do { \
  9983. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9984. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9985. } while (0)
  9986. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9987. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9988. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9989. do { \
  9990. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9991. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9992. } while (0)
  9993. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9994. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9995. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9996. do { \
  9997. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9998. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9999. } while (0)
  10000. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10001. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10002. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10003. do { \
  10004. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10005. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10006. } while (0)
  10007. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10008. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10009. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10010. do { \
  10011. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10012. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10013. } while (0)
  10014. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10015. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10016. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10019. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10020. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10021. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10023. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10024. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10025. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10026. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10027. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10028. /**
  10029. * @brief target -> host rx peer unmap V2 message definition
  10030. *
  10031. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10032. *
  10033. * The following diagram shows the format of the rx peer unmap message sent
  10034. * from the target to the host.
  10035. *
  10036. * |31 24|23 16|15 8|7 0|
  10037. * |-----------------------------------------------------------------------|
  10038. * | SW peer ID | VDEV ID | msg type |
  10039. * |-----------------------------------------------------------------------|
  10040. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10041. * |-----------------------------------------------------------------------|
  10042. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10043. * |-----------------------------------------------------------------------|
  10044. * | Peer Delete Duration |
  10045. * |-----------------------------------------------------------------------|
  10046. * | Reserved_0 | WDS Free Count |
  10047. * |-----------------------------------------------------------------------|
  10048. * | Reserved_1 |
  10049. * |-----------------------------------------------------------------------|
  10050. * | Reserved_2 |
  10051. * |-----------------------------------------------------------------------|
  10052. *
  10053. *
  10054. * The following field definitions describe the format of the rx peer unmap
  10055. * messages sent from the target to the host.
  10056. * - MSG_TYPE
  10057. * Bits 7:0
  10058. * Purpose: identifies this as an rx peer unmap v2 message
  10059. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10060. * - VDEV_ID
  10061. * Bits 15:8
  10062. * Purpose: Indicates which virtual device the peer is associated
  10063. * with.
  10064. * Value: vdev ID (used in the host to look up the vdev object)
  10065. * - SW_PEER_ID
  10066. * Bits 31:16
  10067. * Purpose: The peer ID (index) that WAL is freeing
  10068. * Value: (rx) peer ID
  10069. * - MAC_ADDR_L32
  10070. * Bits 31:0
  10071. * Purpose: Identifies which peer node the peer ID is for.
  10072. * Value: lower 4 bytes of peer node's MAC address
  10073. * - MAC_ADDR_U16
  10074. * Bits 15:0
  10075. * Purpose: Identifies which peer node the peer ID is for.
  10076. * Value: upper 2 bytes of peer node's MAC address
  10077. * - NEXT_HOP
  10078. * Bits 16
  10079. * Purpose: Bit indicates next_hop AST entry used for WDS
  10080. * (Wireless Distribution System).
  10081. * - PEER_DELETE_DURATION
  10082. * Bits 31:0
  10083. * Purpose: Time taken to delete peer, in msec,
  10084. * Used for monitoring / debugging PEER delete response delay
  10085. * - PEER_WDS_FREE_COUNT
  10086. * Bits 15:0
  10087. * Purpose: Count of WDS entries deleted associated to peer deleted
  10088. */
  10089. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10090. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10091. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10092. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10093. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10094. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10095. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10096. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10097. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10098. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10099. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10100. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10101. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10102. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10103. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10104. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10105. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10106. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10107. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10108. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10109. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10110. do { \
  10111. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10112. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10113. } while (0)
  10114. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10115. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10116. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10117. do { \
  10118. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10119. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10120. } while (0)
  10121. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10122. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10123. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10124. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10125. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10126. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10127. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10128. /**
  10129. * @brief target -> host rx peer mlo map message definition
  10130. *
  10131. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10132. *
  10133. * @details
  10134. * The following diagram shows the format of the rx mlo peer map message sent
  10135. * from the target to the host. This layout assumes the target operates
  10136. * as little-endian.
  10137. *
  10138. * MCC:
  10139. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10140. *
  10141. * WIN:
  10142. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10143. * It will be sent on the Assoc Link.
  10144. *
  10145. * This message always contains a MLO peer ID. The main purpose of the
  10146. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10147. * with, so that the host can use that MLO peer ID to determine which peer
  10148. * transmitted the rx frame.
  10149. *
  10150. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10151. * |-------------------------------------------------------------------------|
  10152. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10153. * |-------------------------------------------------------------------------|
  10154. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10155. * |-------------------------------------------------------------------------|
  10156. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10157. * |-------------------------------------------------------------------------|
  10158. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10159. * |-------------------------------------------------------------------------|
  10160. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10161. * |-------------------------------------------------------------------------|
  10162. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10163. * |-------------------------------------------------------------------------|
  10164. * |RSVD |
  10165. * |-------------------------------------------------------------------------|
  10166. * |RSVD |
  10167. * |-------------------------------------------------------------------------|
  10168. * | htt_tlv_hdr_t |
  10169. * |-------------------------------------------------------------------------|
  10170. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10171. * |-------------------------------------------------------------------------|
  10172. * | htt_tlv_hdr_t |
  10173. * |-------------------------------------------------------------------------|
  10174. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10175. * |-------------------------------------------------------------------------|
  10176. * | htt_tlv_hdr_t |
  10177. * |-------------------------------------------------------------------------|
  10178. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10179. * |-------------------------------------------------------------------------|
  10180. *
  10181. * Where:
  10182. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10183. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10184. * V (valid) - 1 Bit Bit17
  10185. * CHIPID - 3 Bits
  10186. * TIDMASK - 8 Bits
  10187. * CACHE_SET_NUM - 8 Bits
  10188. *
  10189. * The following field definitions describe the format of the rx MLO peer map
  10190. * messages sent from the target to the host.
  10191. * - MSG_TYPE
  10192. * Bits 7:0
  10193. * Purpose: identifies this as an rx mlo peer map message
  10194. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10195. *
  10196. * - MLO_PEER_ID
  10197. * Bits 23:8
  10198. * Purpose: The MLO peer ID (index).
  10199. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10200. * Value: MLO peer ID
  10201. *
  10202. * - NUMLINK
  10203. * Bits: 26:24 (3Bits)
  10204. * Purpose: Indicate the max number of logical links supported per client.
  10205. * Value: number of logical links
  10206. *
  10207. * - PRC
  10208. * Bits: 29:27 (3Bits)
  10209. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10210. * if there is migration of the primary chip.
  10211. * Value: Primary REO CHIPID
  10212. *
  10213. * - MAC_ADDR_L32
  10214. * Bits 31:0
  10215. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10216. * Value: lower 4 bytes of peer node's MAC address
  10217. *
  10218. * - MAC_ADDR_U16
  10219. * Bits 15:0
  10220. * Purpose: Identifies which peer node the peer ID is for.
  10221. * Value: upper 2 bytes of peer node's MAC address
  10222. *
  10223. * - PRIMARY_TCL_AST_IDX
  10224. * Bits 15:0
  10225. * Purpose: Primary TCL AST index for this peer.
  10226. *
  10227. * - V
  10228. * 1 Bit Position 16
  10229. * Purpose: If the ast idx is valid.
  10230. *
  10231. * - CHIPID
  10232. * Bits 19:17
  10233. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10234. *
  10235. * - TIDMASK
  10236. * Bits 27:20
  10237. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10238. *
  10239. * - CACHE_SET_NUM
  10240. * Bits 31:28
  10241. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10242. * Cache set number that should be used to cache the index based
  10243. * search results, for address and flow search.
  10244. * This value should be equal to LSB four bits of the hash value
  10245. * of match data, in case of search index points to an entry which
  10246. * may be used in content based search also. The value can be
  10247. * anything when the entry pointed by search index will not be
  10248. * used for content based search.
  10249. *
  10250. * - htt_tlv_hdr_t
  10251. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10252. *
  10253. * Bits 11:0
  10254. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10255. *
  10256. * Bits 23:12
  10257. * Purpose: Length, Length of the value that follows the header
  10258. *
  10259. * Bits 31:28
  10260. * Purpose: Reserved.
  10261. *
  10262. *
  10263. * - SW_PEER_ID
  10264. * Bits 15:0
  10265. * Purpose: The peer ID (index) that WAL is allocating
  10266. * Value: (rx) peer ID
  10267. *
  10268. * - VDEV_ID
  10269. * Bits 23:16
  10270. * Purpose: Indicates which virtual device the peer is associated with.
  10271. * Value: vdev ID (used in the host to look up the vdev object)
  10272. *
  10273. * - CHIPID
  10274. * Bits 26:24
  10275. * Purpose: Indicates which Chip id the peer is associated with.
  10276. * Value: chip ID (Provided by Host as part of QMI exchange)
  10277. */
  10278. typedef enum {
  10279. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10280. } MLO_PEER_MAP_TLV_TAG_ID;
  10281. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10282. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10283. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10284. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10285. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10286. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10287. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10288. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10289. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10290. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10291. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10292. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10293. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10294. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10295. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10296. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10297. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10298. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10299. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10300. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10301. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10302. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10303. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10304. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10305. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10306. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10307. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10308. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10309. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10310. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10311. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10312. do { \
  10313. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10314. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10315. } while (0)
  10316. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10317. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10318. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10319. do { \
  10320. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10321. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10322. } while (0)
  10323. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10324. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10325. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10326. do { \
  10327. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10328. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10329. } while (0)
  10330. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10331. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10332. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10333. do { \
  10334. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10335. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10336. } while (0)
  10337. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10338. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10339. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10340. do { \
  10341. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10342. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10343. } while (0)
  10344. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10345. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10346. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10347. do { \
  10348. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10349. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10350. } while (0)
  10351. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10352. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10353. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10354. do { \
  10355. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10356. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10357. } while (0)
  10358. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10359. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10360. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10361. do { \
  10362. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10363. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10364. } while (0)
  10365. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10366. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10367. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10368. do { \
  10369. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10370. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10371. } while (0)
  10372. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10373. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10374. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10375. do { \
  10376. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10377. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10378. } while (0)
  10379. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10380. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10381. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10382. do { \
  10383. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10384. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10385. } while (0)
  10386. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10387. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10388. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10389. do { \
  10390. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10391. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10392. } while (0)
  10393. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10394. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10395. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10396. do { \
  10397. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10398. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10399. } while (0)
  10400. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10401. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10402. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10403. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10404. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10405. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10406. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10407. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10408. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10409. *
  10410. * The following diagram shows the format of the rx mlo peer unmap message sent
  10411. * from the target to the host.
  10412. *
  10413. * |31 24|23 16|15 8|7 0|
  10414. * |-----------------------------------------------------------------------|
  10415. * | RSVD_24_31 | MLO peer ID | msg type |
  10416. * |-----------------------------------------------------------------------|
  10417. */
  10418. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10419. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10420. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10421. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10422. /**
  10423. * @brief target -> host message specifying security parameters
  10424. *
  10425. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10426. *
  10427. * @details
  10428. * The following diagram shows the format of the security specification
  10429. * message sent from the target to the host.
  10430. * This security specification message tells the host whether a PN check is
  10431. * necessary on rx data frames, and if so, how large the PN counter is.
  10432. * This message also tells the host about the security processing to apply
  10433. * to defragmented rx frames - specifically, whether a Message Integrity
  10434. * Check is required, and the Michael key to use.
  10435. *
  10436. * |31 24|23 16|15|14 8|7 0|
  10437. * |-----------------------------------------------------------------------|
  10438. * | peer ID | U| security type | msg type |
  10439. * |-----------------------------------------------------------------------|
  10440. * | Michael Key K0 |
  10441. * |-----------------------------------------------------------------------|
  10442. * | Michael Key K1 |
  10443. * |-----------------------------------------------------------------------|
  10444. * | WAPI RSC Low0 |
  10445. * |-----------------------------------------------------------------------|
  10446. * | WAPI RSC Low1 |
  10447. * |-----------------------------------------------------------------------|
  10448. * | WAPI RSC Hi0 |
  10449. * |-----------------------------------------------------------------------|
  10450. * | WAPI RSC Hi1 |
  10451. * |-----------------------------------------------------------------------|
  10452. *
  10453. * The following field definitions describe the format of the security
  10454. * indication message sent from the target to the host.
  10455. * - MSG_TYPE
  10456. * Bits 7:0
  10457. * Purpose: identifies this as a security specification message
  10458. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10459. * - SEC_TYPE
  10460. * Bits 14:8
  10461. * Purpose: specifies which type of security applies to the peer
  10462. * Value: htt_sec_type enum value
  10463. * - UNICAST
  10464. * Bit 15
  10465. * Purpose: whether this security is applied to unicast or multicast data
  10466. * Value: 1 -> unicast, 0 -> multicast
  10467. * - PEER_ID
  10468. * Bits 31:16
  10469. * Purpose: The ID number for the peer the security specification is for
  10470. * Value: peer ID
  10471. * - MICHAEL_KEY_K0
  10472. * Bits 31:0
  10473. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10474. * Value: Michael Key K0 (if security type is TKIP)
  10475. * - MICHAEL_KEY_K1
  10476. * Bits 31:0
  10477. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10478. * Value: Michael Key K1 (if security type is TKIP)
  10479. * - WAPI_RSC_LOW0
  10480. * Bits 31:0
  10481. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10482. * Value: WAPI RSC Low0 (if security type is WAPI)
  10483. * - WAPI_RSC_LOW1
  10484. * Bits 31:0
  10485. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10486. * Value: WAPI RSC Low1 (if security type is WAPI)
  10487. * - WAPI_RSC_HI0
  10488. * Bits 31:0
  10489. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10490. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10491. * - WAPI_RSC_HI1
  10492. * Bits 31:0
  10493. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10494. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10495. */
  10496. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10497. #define HTT_SEC_IND_SEC_TYPE_S 8
  10498. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10499. #define HTT_SEC_IND_UNICAST_S 15
  10500. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10501. #define HTT_SEC_IND_PEER_ID_S 16
  10502. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10503. do { \
  10504. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10505. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10506. } while (0)
  10507. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10508. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10509. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10510. do { \
  10511. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10512. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10513. } while (0)
  10514. #define HTT_SEC_IND_UNICAST_GET(word) \
  10515. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10516. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10517. do { \
  10518. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10519. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10520. } while (0)
  10521. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10522. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10523. #define HTT_SEC_IND_BYTES 28
  10524. /**
  10525. * @brief target -> host rx ADDBA / DELBA message definitions
  10526. *
  10527. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10528. *
  10529. * @details
  10530. * The following diagram shows the format of the rx ADDBA message sent
  10531. * from the target to the host:
  10532. *
  10533. * |31 20|19 16|15 8|7 0|
  10534. * |---------------------------------------------------------------------|
  10535. * | peer ID | TID | window size | msg type |
  10536. * |---------------------------------------------------------------------|
  10537. *
  10538. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10539. *
  10540. * The following diagram shows the format of the rx DELBA message sent
  10541. * from the target to the host:
  10542. *
  10543. * |31 20|19 16|15 10|9 8|7 0|
  10544. * |---------------------------------------------------------------------|
  10545. * | peer ID | TID | window size | IR| msg type |
  10546. * |---------------------------------------------------------------------|
  10547. *
  10548. * The following field definitions describe the format of the rx ADDBA
  10549. * and DELBA messages sent from the target to the host.
  10550. * - MSG_TYPE
  10551. * Bits 7:0
  10552. * Purpose: identifies this as an rx ADDBA or DELBA message
  10553. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10554. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10555. * - IR (initiator / recipient)
  10556. * Bits 9:8 (DELBA only)
  10557. * Purpose: specify whether the DELBA handshake was initiated by the
  10558. * local STA/AP, or by the peer STA/AP
  10559. * Value:
  10560. * 0 - unspecified
  10561. * 1 - initiator (a.k.a. originator)
  10562. * 2 - recipient (a.k.a. responder)
  10563. * 3 - unused / reserved
  10564. * - WIN_SIZE
  10565. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10566. * Purpose: Specifies the length of the block ack window (max = 64).
  10567. * Value:
  10568. * block ack window length specified by the received ADDBA/DELBA
  10569. * management message.
  10570. * - TID
  10571. * Bits 19:16
  10572. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10573. * Value:
  10574. * TID specified by the received ADDBA or DELBA management message.
  10575. * - PEER_ID
  10576. * Bits 31:20
  10577. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10578. * Value:
  10579. * ID (hash value) used by the host for fast, direct lookup of
  10580. * host SW peer info, including rx reorder states.
  10581. */
  10582. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10583. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10584. #define HTT_RX_ADDBA_TID_M 0xf0000
  10585. #define HTT_RX_ADDBA_TID_S 16
  10586. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10587. #define HTT_RX_ADDBA_PEER_ID_S 20
  10588. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10589. do { \
  10590. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10591. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10592. } while (0)
  10593. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10594. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10595. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10596. do { \
  10597. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10598. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10599. } while (0)
  10600. #define HTT_RX_ADDBA_TID_GET(word) \
  10601. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10602. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10603. do { \
  10604. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10605. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10606. } while (0)
  10607. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10608. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10609. #define HTT_RX_ADDBA_BYTES 4
  10610. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10611. #define HTT_RX_DELBA_INITIATOR_S 8
  10612. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10613. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10614. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10615. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10616. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10617. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10618. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10619. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10620. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10621. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10622. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10623. do { \
  10624. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10625. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10626. } while (0)
  10627. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10628. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10629. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10630. do { \
  10631. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10632. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10633. } while (0)
  10634. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10635. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10636. #define HTT_RX_DELBA_BYTES 4
  10637. /**
  10638. * @brief tx queue group information element definition
  10639. *
  10640. * @details
  10641. * The following diagram shows the format of the tx queue group
  10642. * information element, which can be included in target --> host
  10643. * messages to specify the number of tx "credits" (tx descriptors
  10644. * for LL, or tx buffers for HL) available to a particular group
  10645. * of host-side tx queues, and which host-side tx queues belong to
  10646. * the group.
  10647. *
  10648. * |31|30 24|23 16|15|14|13 0|
  10649. * |------------------------------------------------------------------------|
  10650. * | X| reserved | tx queue grp ID | A| S| credit count |
  10651. * |------------------------------------------------------------------------|
  10652. * | vdev ID mask | AC mask |
  10653. * |------------------------------------------------------------------------|
  10654. *
  10655. * The following definitions describe the fields within the tx queue group
  10656. * information element:
  10657. * - credit_count
  10658. * Bits 13:1
  10659. * Purpose: specify how many tx credits are available to the tx queue group
  10660. * Value: An absolute or relative, positive or negative credit value
  10661. * The 'A' bit specifies whether the value is absolute or relative.
  10662. * The 'S' bit specifies whether the value is positive or negative.
  10663. * A negative value can only be relative, not absolute.
  10664. * An absolute value replaces any prior credit value the host has for
  10665. * the tx queue group in question.
  10666. * A relative value is added to the prior credit value the host has for
  10667. * the tx queue group in question.
  10668. * - sign
  10669. * Bit 14
  10670. * Purpose: specify whether the credit count is positive or negative
  10671. * Value: 0 -> positive, 1 -> negative
  10672. * - absolute
  10673. * Bit 15
  10674. * Purpose: specify whether the credit count is absolute or relative
  10675. * Value: 0 -> relative, 1 -> absolute
  10676. * - txq_group_id
  10677. * Bits 23:16
  10678. * Purpose: indicate which tx queue group's credit and/or membership are
  10679. * being specified
  10680. * Value: 0 to max_tx_queue_groups-1
  10681. * - reserved
  10682. * Bits 30:16
  10683. * Value: 0x0
  10684. * - eXtension
  10685. * Bit 31
  10686. * Purpose: specify whether another tx queue group info element follows
  10687. * Value: 0 -> no more tx queue group information elements
  10688. * 1 -> another tx queue group information element immediately follows
  10689. * - ac_mask
  10690. * Bits 15:0
  10691. * Purpose: specify which Access Categories belong to the tx queue group
  10692. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10693. * the tx queue group.
  10694. * The AC bit-mask values are obtained by left-shifting by the
  10695. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10696. * - vdev_id_mask
  10697. * Bits 31:16
  10698. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10699. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10700. * belong to the tx queue group.
  10701. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10702. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10703. */
  10704. PREPACK struct htt_txq_group {
  10705. A_UINT32
  10706. credit_count: 14,
  10707. sign: 1,
  10708. absolute: 1,
  10709. tx_queue_group_id: 8,
  10710. reserved0: 7,
  10711. extension: 1;
  10712. A_UINT32
  10713. ac_mask: 16,
  10714. vdev_id_mask: 16;
  10715. } POSTPACK;
  10716. /* first word */
  10717. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10718. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10719. #define HTT_TXQ_GROUP_SIGN_S 14
  10720. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10721. #define HTT_TXQ_GROUP_ABS_S 15
  10722. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10723. #define HTT_TXQ_GROUP_ID_S 16
  10724. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10725. #define HTT_TXQ_GROUP_EXT_S 31
  10726. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10727. /* second word */
  10728. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10729. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10730. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10731. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10732. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10733. do { \
  10734. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10735. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10736. } while (0)
  10737. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10738. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10739. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10740. do { \
  10741. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10742. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10743. } while (0)
  10744. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10745. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10746. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10747. do { \
  10748. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10749. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10750. } while (0)
  10751. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10752. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10753. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10754. do { \
  10755. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10756. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10757. } while (0)
  10758. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10759. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10760. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10761. do { \
  10762. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10763. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10764. } while (0)
  10765. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10766. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10767. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10768. do { \
  10769. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10770. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10771. } while (0)
  10772. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10773. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10774. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10775. do { \
  10776. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10777. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10778. } while (0)
  10779. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10780. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10781. /**
  10782. * @brief target -> host TX completion indication message definition
  10783. *
  10784. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10785. *
  10786. * @details
  10787. * The following diagram shows the format of the TX completion indication sent
  10788. * from the target to the host
  10789. *
  10790. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10791. * |-------------------------------------------------------------------|
  10792. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10793. * |-------------------------------------------------------------------|
  10794. * payload:| MSDU1 ID | MSDU0 ID |
  10795. * |-------------------------------------------------------------------|
  10796. * : MSDU3 ID | MSDU2 ID :
  10797. * |-------------------------------------------------------------------|
  10798. * | struct htt_tx_compl_ind_append_retries |
  10799. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10800. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10801. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10802. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10803. * |-------------------------------------------------------------------|
  10804. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10805. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10806. * | MSDU0 tx_tsf64_low |
  10807. * |-------------------------------------------------------------------|
  10808. * | MSDU0 tx_tsf64_high |
  10809. * |-------------------------------------------------------------------|
  10810. * | MSDU1 tx_tsf64_low |
  10811. * |-------------------------------------------------------------------|
  10812. * | MSDU1 tx_tsf64_high |
  10813. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10814. * | phy_timestamp |
  10815. * |-------------------------------------------------------------------|
  10816. * | rate specs (see below) |
  10817. * |-------------------------------------------------------------------|
  10818. * | seqctrl | framectrl |
  10819. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10820. * Where:
  10821. * A0 = append (a.k.a. append0)
  10822. * A1 = append1
  10823. * TP = MSDU tx power presence
  10824. * A2 = append2
  10825. * A3 = append3
  10826. * A4 = append4
  10827. *
  10828. * The following field definitions describe the format of the TX completion
  10829. * indication sent from the target to the host
  10830. * Header fields:
  10831. * - msg_type
  10832. * Bits 7:0
  10833. * Purpose: identifies this as HTT TX completion indication
  10834. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10835. * - status
  10836. * Bits 10:8
  10837. * Purpose: the TX completion status of payload fragmentations descriptors
  10838. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10839. * - tid
  10840. * Bits 14:11
  10841. * Purpose: the tid associated with those fragmentation descriptors. It is
  10842. * valid or not, depending on the tid_invalid bit.
  10843. * Value: 0 to 15
  10844. * - tid_invalid
  10845. * Bits 15:15
  10846. * Purpose: this bit indicates whether the tid field is valid or not
  10847. * Value: 0 indicates valid; 1 indicates invalid
  10848. * - num
  10849. * Bits 23:16
  10850. * Purpose: the number of payload in this indication
  10851. * Value: 1 to 255
  10852. * - append (a.k.a. append0)
  10853. * Bits 24:24
  10854. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10855. * the number of tx retries for one MSDU at the end of this message
  10856. * Value: 0 indicates no appending; 1 indicates appending
  10857. * - append1
  10858. * Bits 25:25
  10859. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10860. * contains the timestamp info for each TX msdu id in payload.
  10861. * The order of the timestamps matches the order of the MSDU IDs.
  10862. * Note that a big-endian host needs to account for the reordering
  10863. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10864. * conversion) when determining which tx timestamp corresponds to
  10865. * which MSDU ID.
  10866. * Value: 0 indicates no appending; 1 indicates appending
  10867. * - msdu_tx_power_presence
  10868. * Bits 26:26
  10869. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10870. * for each MSDU referenced by the TX_COMPL_IND message.
  10871. * The tx power is reported in 0.5 dBm units.
  10872. * The order of the per-MSDU tx power reports matches the order
  10873. * of the MSDU IDs.
  10874. * Note that a big-endian host needs to account for the reordering
  10875. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10876. * conversion) when determining which Tx Power corresponds to
  10877. * which MSDU ID.
  10878. * Value: 0 indicates MSDU tx power reports are not appended,
  10879. * 1 indicates MSDU tx power reports are appended
  10880. * - append2
  10881. * Bits 27:27
  10882. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10883. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10884. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10885. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10886. * for each MSDU, for convenience.
  10887. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10888. * this append2 bit is set).
  10889. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10890. * dB above the noise floor.
  10891. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10892. * 1 indicates MSDU ACK RSSI values are appended.
  10893. * - append3
  10894. * Bits 28:28
  10895. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10896. * contains the tx tsf info based on wlan global TSF for
  10897. * each TX msdu id in payload.
  10898. * The order of the tx tsf matches the order of the MSDU IDs.
  10899. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10900. * values to indicate the the lower 32 bits and higher 32 bits of
  10901. * the tx tsf.
  10902. * The tx_tsf64 here represents the time MSDU was acked and the
  10903. * tx_tsf64 has microseconds units.
  10904. * Value: 0 indicates no appending; 1 indicates appending
  10905. * - append4
  10906. * Bits 29:29
  10907. * Purpose: Indicate whether data frame control fields and fields required
  10908. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10909. * message. The order of the this message matches the order of
  10910. * the MSDU IDs.
  10911. * Value: 0 indicates frame control fields and fields required for
  10912. * radio tap header values are not appended,
  10913. * 1 indicates frame control fields and fields required for
  10914. * radio tap header values are appended.
  10915. * Payload fields:
  10916. * - hmsdu_id
  10917. * Bits 15:0
  10918. * Purpose: this ID is used to track the Tx buffer in host
  10919. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10920. */
  10921. PREPACK struct htt_tx_data_hdr_information {
  10922. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10923. A_UINT32 /* word 1 */
  10924. /* preamble:
  10925. * 0-OFDM,
  10926. * 1-CCk,
  10927. * 2-HT,
  10928. * 3-VHT
  10929. */
  10930. preamble: 2, /* [1:0] */
  10931. /* mcs:
  10932. * In case of HT preamble interpret
  10933. * MCS along with NSS.
  10934. * Valid values for HT are 0 to 7.
  10935. * HT mcs 0 with NSS 2 is mcs 8.
  10936. * Valid values for VHT are 0 to 9.
  10937. */
  10938. mcs: 4, /* [5:2] */
  10939. /* rate:
  10940. * This is applicable only for
  10941. * CCK and OFDM preamble type
  10942. * rate 0: OFDM 48 Mbps,
  10943. * 1: OFDM 24 Mbps,
  10944. * 2: OFDM 12 Mbps
  10945. * 3: OFDM 6 Mbps
  10946. * 4: OFDM 54 Mbps
  10947. * 5: OFDM 36 Mbps
  10948. * 6: OFDM 18 Mbps
  10949. * 7: OFDM 9 Mbps
  10950. * rate 0: CCK 11 Mbps Long
  10951. * 1: CCK 5.5 Mbps Long
  10952. * 2: CCK 2 Mbps Long
  10953. * 3: CCK 1 Mbps Long
  10954. * 4: CCK 11 Mbps Short
  10955. * 5: CCK 5.5 Mbps Short
  10956. * 6: CCK 2 Mbps Short
  10957. */
  10958. rate : 3, /* [ 8: 6] */
  10959. rssi : 8, /* [16: 9] units=dBm */
  10960. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10961. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10962. stbc : 1, /* [22] */
  10963. sgi : 1, /* [23] */
  10964. ldpc : 1, /* [24] */
  10965. beamformed: 1, /* [25] */
  10966. /* tx_retry_cnt:
  10967. * Indicates retry count of data tx frames provided by the host.
  10968. */
  10969. tx_retry_cnt: 6; /* [31:26] */
  10970. A_UINT32 /* word 2 */
  10971. framectrl:16, /* [15: 0] */
  10972. seqno:16; /* [31:16] */
  10973. } POSTPACK;
  10974. #define HTT_TX_COMPL_IND_STATUS_S 8
  10975. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10976. #define HTT_TX_COMPL_IND_TID_S 11
  10977. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10978. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10979. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10980. #define HTT_TX_COMPL_IND_NUM_S 16
  10981. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10982. #define HTT_TX_COMPL_IND_APPEND_S 24
  10983. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10984. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10985. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10986. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10987. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10988. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10989. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10990. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10991. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10992. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10993. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10994. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10995. do { \
  10996. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10997. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10998. } while (0)
  10999. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11000. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11001. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11002. do { \
  11003. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11004. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11005. } while (0)
  11006. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11007. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11008. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11009. do { \
  11010. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11011. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11012. } while (0)
  11013. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11014. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11015. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11016. do { \
  11017. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11018. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11019. } while (0)
  11020. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11021. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11022. HTT_TX_COMPL_IND_TID_INV_S)
  11023. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11024. do { \
  11025. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11026. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11027. } while (0)
  11028. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11029. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11030. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11031. do { \
  11032. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11033. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11034. } while (0)
  11035. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11036. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11037. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11038. do { \
  11039. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11040. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11041. } while (0)
  11042. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11043. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11044. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11045. do { \
  11046. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11047. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11048. } while (0)
  11049. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11050. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11051. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11052. do { \
  11053. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11054. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11055. } while (0)
  11056. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11057. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11058. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11059. do { \
  11060. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11061. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11062. } while (0)
  11063. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11064. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11065. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11066. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11067. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11068. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11069. #define HTT_TX_COMPL_IND_STAT_OK 0
  11070. /* DISCARD:
  11071. * current meaning:
  11072. * MSDUs were queued for transmission but filtered by HW or SW
  11073. * without any over the air attempts
  11074. * legacy meaning (HL Rome):
  11075. * MSDUs were discarded by the target FW without any over the air
  11076. * attempts due to lack of space
  11077. */
  11078. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11079. /* NO_ACK:
  11080. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11081. */
  11082. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11083. /* POSTPONE:
  11084. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11085. * be downloaded again later (in the appropriate order), when they are
  11086. * deliverable.
  11087. */
  11088. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11089. /*
  11090. * The PEER_DEL tx completion status is used for HL cases
  11091. * where the peer the frame is for has been deleted.
  11092. * The host has already discarded its copy of the frame, but
  11093. * it still needs the tx completion to restore its credit.
  11094. */
  11095. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11096. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11097. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11098. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11099. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11100. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11101. PREPACK struct htt_tx_compl_ind_base {
  11102. A_UINT32 hdr;
  11103. A_UINT16 payload[1/*or more*/];
  11104. } POSTPACK;
  11105. PREPACK struct htt_tx_compl_ind_append_retries {
  11106. A_UINT16 msdu_id;
  11107. A_UINT8 tx_retries;
  11108. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11109. 0: this is the last append_retries struct */
  11110. } POSTPACK;
  11111. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11112. A_UINT32 timestamp[1/*or more*/];
  11113. } POSTPACK;
  11114. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11115. A_UINT32 tx_tsf64_low;
  11116. A_UINT32 tx_tsf64_high;
  11117. } POSTPACK;
  11118. /* htt_tx_data_hdr_information payload extension fields: */
  11119. /* DWORD zero */
  11120. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11121. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11122. /* DWORD one */
  11123. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11124. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11125. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11126. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11127. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11128. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11129. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11130. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11131. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11132. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11133. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11134. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11135. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11136. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11137. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11138. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11139. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11140. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11141. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11142. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11143. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11144. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11145. /* DWORD two */
  11146. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11147. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11148. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11149. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11150. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11151. do { \
  11152. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11153. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11154. } while (0)
  11155. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11156. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11157. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11158. do { \
  11159. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11160. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11161. } while (0)
  11162. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11163. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11164. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11165. do { \
  11166. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11167. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11168. } while (0)
  11169. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11170. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11171. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11172. do { \
  11173. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11174. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11175. } while (0)
  11176. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11177. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11178. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11179. do { \
  11180. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11181. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11182. } while (0)
  11183. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11184. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11185. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11186. do { \
  11187. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11188. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11189. } while (0)
  11190. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11191. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11192. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11193. do { \
  11194. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11195. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11196. } while (0)
  11197. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11198. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11199. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11200. do { \
  11201. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11202. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11203. } while (0)
  11204. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11205. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11206. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11207. do { \
  11208. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11209. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11210. } while (0)
  11211. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11212. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11213. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11214. do { \
  11215. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11216. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11217. } while (0)
  11218. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11219. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11220. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11221. do { \
  11222. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11223. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11224. } while (0)
  11225. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11226. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11227. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11228. do { \
  11229. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11230. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11231. } while (0)
  11232. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11233. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11234. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11235. do { \
  11236. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11237. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11238. } while (0)
  11239. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11240. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11241. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11242. do { \
  11243. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11244. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11245. } while (0)
  11246. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11247. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11248. /**
  11249. * @brief target -> host rate-control update indication message
  11250. *
  11251. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11252. *
  11253. * @details
  11254. * The following diagram shows the format of the RC Update message
  11255. * sent from the target to the host, while processing the tx-completion
  11256. * of a transmitted PPDU.
  11257. *
  11258. * |31 24|23 16|15 8|7 0|
  11259. * |-------------------------------------------------------------|
  11260. * | peer ID | vdev ID | msg_type |
  11261. * |-------------------------------------------------------------|
  11262. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11263. * |-------------------------------------------------------------|
  11264. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11265. * |-------------------------------------------------------------|
  11266. * | : |
  11267. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11268. * | : |
  11269. * |-------------------------------------------------------------|
  11270. * | : |
  11271. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11272. * | : |
  11273. * |-------------------------------------------------------------|
  11274. * : :
  11275. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11276. *
  11277. */
  11278. typedef struct {
  11279. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11280. A_UINT32 rate_code_flags;
  11281. A_UINT32 flags; /* Encodes information such as excessive
  11282. retransmission, aggregate, some info
  11283. from .11 frame control,
  11284. STBC, LDPC, (SGI and Tx Chain Mask
  11285. are encoded in ptx_rc->flags field),
  11286. AMPDU truncation (BT/time based etc.),
  11287. RTS/CTS attempt */
  11288. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11289. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11290. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11291. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11292. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11293. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11294. } HTT_RC_TX_DONE_PARAMS;
  11295. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11296. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11297. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11298. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11299. #define HTT_RC_UPDATE_VDEVID_S 8
  11300. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11301. #define HTT_RC_UPDATE_PEERID_S 16
  11302. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11303. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11304. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11305. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11306. do { \
  11307. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11308. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11309. } while (0)
  11310. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11311. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11312. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11313. do { \
  11314. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11315. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11316. } while (0)
  11317. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11318. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11319. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11320. do { \
  11321. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11322. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11323. } while (0)
  11324. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11325. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11326. /**
  11327. * @brief target -> host rx fragment indication message definition
  11328. *
  11329. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11330. *
  11331. * @details
  11332. * The following field definitions describe the format of the rx fragment
  11333. * indication message sent from the target to the host.
  11334. * The rx fragment indication message shares the format of the
  11335. * rx indication message, but not all fields from the rx indication message
  11336. * are relevant to the rx fragment indication message.
  11337. *
  11338. *
  11339. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11340. * |-----------+-------------------+---------------------+-------------|
  11341. * | peer ID | |FV| ext TID | msg type |
  11342. * |-------------------------------------------------------------------|
  11343. * | | flush | flush |
  11344. * | | end | start |
  11345. * | | seq num | seq num |
  11346. * |-------------------------------------------------------------------|
  11347. * | reserved | FW rx desc bytes |
  11348. * |-------------------------------------------------------------------|
  11349. * | | FW MSDU Rx |
  11350. * | | desc B0 |
  11351. * |-------------------------------------------------------------------|
  11352. * Header fields:
  11353. * - MSG_TYPE
  11354. * Bits 7:0
  11355. * Purpose: identifies this as an rx fragment indication message
  11356. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11357. * - EXT_TID
  11358. * Bits 12:8
  11359. * Purpose: identify the traffic ID of the rx data, including
  11360. * special "extended" TID values for multicast, broadcast, and
  11361. * non-QoS data frames
  11362. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11363. * - FLUSH_VALID (FV)
  11364. * Bit 13
  11365. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11366. * is valid
  11367. * Value:
  11368. * 1 -> flush IE is valid and needs to be processed
  11369. * 0 -> flush IE is not valid and should be ignored
  11370. * - PEER_ID
  11371. * Bits 31:16
  11372. * Purpose: Identify, by ID, which peer sent the rx data
  11373. * Value: ID of the peer who sent the rx data
  11374. * - FLUSH_SEQ_NUM_START
  11375. * Bits 5:0
  11376. * Purpose: Indicate the start of a series of MPDUs to flush
  11377. * Not all MPDUs within this series are necessarily valid - the host
  11378. * must check each sequence number within this range to see if the
  11379. * corresponding MPDU is actually present.
  11380. * This field is only valid if the FV bit is set.
  11381. * Value:
  11382. * The sequence number for the first MPDUs to check to flush.
  11383. * The sequence number is masked by 0x3f.
  11384. * - FLUSH_SEQ_NUM_END
  11385. * Bits 11:6
  11386. * Purpose: Indicate the end of a series of MPDUs to flush
  11387. * Value:
  11388. * The sequence number one larger than the sequence number of the
  11389. * last MPDU to check to flush.
  11390. * The sequence number is masked by 0x3f.
  11391. * Not all MPDUs within this series are necessarily valid - the host
  11392. * must check each sequence number within this range to see if the
  11393. * corresponding MPDU is actually present.
  11394. * This field is only valid if the FV bit is set.
  11395. * Rx descriptor fields:
  11396. * - FW_RX_DESC_BYTES
  11397. * Bits 15:0
  11398. * Purpose: Indicate how many bytes in the Rx indication are used for
  11399. * FW Rx descriptors
  11400. * Value: 1
  11401. */
  11402. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11403. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11404. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11405. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11406. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11407. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11408. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11409. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11410. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11411. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11412. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11413. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11414. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11415. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11416. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11417. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11418. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11419. #define HTT_RX_FRAG_IND_BYTES \
  11420. (4 /* msg hdr */ + \
  11421. 4 /* flush spec */ + \
  11422. 4 /* (unused) FW rx desc bytes spec */ + \
  11423. 4 /* FW rx desc */)
  11424. /**
  11425. * @brief target -> host test message definition
  11426. *
  11427. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11428. *
  11429. * @details
  11430. * The following field definitions describe the format of the test
  11431. * message sent from the target to the host.
  11432. * The message consists of a 4-octet header, followed by a variable
  11433. * number of 32-bit integer values, followed by a variable number
  11434. * of 8-bit character values.
  11435. *
  11436. * |31 16|15 8|7 0|
  11437. * |-----------------------------------------------------------|
  11438. * | num chars | num ints | msg type |
  11439. * |-----------------------------------------------------------|
  11440. * | int 0 |
  11441. * |-----------------------------------------------------------|
  11442. * | int 1 |
  11443. * |-----------------------------------------------------------|
  11444. * | ... |
  11445. * |-----------------------------------------------------------|
  11446. * | char 3 | char 2 | char 1 | char 0 |
  11447. * |-----------------------------------------------------------|
  11448. * | | | ... | char 4 |
  11449. * |-----------------------------------------------------------|
  11450. * - MSG_TYPE
  11451. * Bits 7:0
  11452. * Purpose: identifies this as a test message
  11453. * Value: HTT_MSG_TYPE_TEST
  11454. * - NUM_INTS
  11455. * Bits 15:8
  11456. * Purpose: indicate how many 32-bit integers follow the message header
  11457. * - NUM_CHARS
  11458. * Bits 31:16
  11459. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11460. */
  11461. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11462. #define HTT_RX_TEST_NUM_INTS_S 8
  11463. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11464. #define HTT_RX_TEST_NUM_CHARS_S 16
  11465. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11466. do { \
  11467. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11468. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11469. } while (0)
  11470. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11471. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11472. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11473. do { \
  11474. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11475. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11476. } while (0)
  11477. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11478. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11479. /**
  11480. * @brief target -> host packet log message
  11481. *
  11482. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11483. *
  11484. * @details
  11485. * The following field definitions describe the format of the packet log
  11486. * message sent from the target to the host.
  11487. * The message consists of a 4-octet header,followed by a variable number
  11488. * of 32-bit character values.
  11489. *
  11490. * |31 16|15 12|11 10|9 8|7 0|
  11491. * |------------------------------------------------------------------|
  11492. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11493. * |------------------------------------------------------------------|
  11494. * | payload |
  11495. * |------------------------------------------------------------------|
  11496. * - MSG_TYPE
  11497. * Bits 7:0
  11498. * Purpose: identifies this as a pktlog message
  11499. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11500. * - mac_id
  11501. * Bits 9:8
  11502. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11503. * Value: 0-3
  11504. * - pdev_id
  11505. * Bits 11:10
  11506. * Purpose: pdev_id
  11507. * Value: 0-3
  11508. * 0 (for rings at SOC level),
  11509. * 1/2/3 PDEV -> 0/1/2
  11510. * - payload_size
  11511. * Bits 31:16
  11512. * Purpose: explicitly specify the payload size
  11513. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11514. */
  11515. PREPACK struct htt_pktlog_msg {
  11516. A_UINT32 header;
  11517. A_UINT32 payload[1/* or more */];
  11518. } POSTPACK;
  11519. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11520. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11521. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11522. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11523. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11524. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11525. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11526. do { \
  11527. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11528. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11529. } while (0)
  11530. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11531. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11532. HTT_T2H_PKTLOG_MAC_ID_S)
  11533. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11534. do { \
  11535. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11536. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11537. } while (0)
  11538. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11539. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11540. HTT_T2H_PKTLOG_PDEV_ID_S)
  11541. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11542. do { \
  11543. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11544. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11545. } while (0)
  11546. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11547. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11548. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11549. /*
  11550. * Rx reorder statistics
  11551. * NB: all the fields must be defined in 4 octets size.
  11552. */
  11553. struct rx_reorder_stats {
  11554. /* Non QoS MPDUs received */
  11555. A_UINT32 deliver_non_qos;
  11556. /* MPDUs received in-order */
  11557. A_UINT32 deliver_in_order;
  11558. /* Flush due to reorder timer expired */
  11559. A_UINT32 deliver_flush_timeout;
  11560. /* Flush due to move out of window */
  11561. A_UINT32 deliver_flush_oow;
  11562. /* Flush due to DELBA */
  11563. A_UINT32 deliver_flush_delba;
  11564. /* MPDUs dropped due to FCS error */
  11565. A_UINT32 fcs_error;
  11566. /* MPDUs dropped due to monitor mode non-data packet */
  11567. A_UINT32 mgmt_ctrl;
  11568. /* Unicast-data MPDUs dropped due to invalid peer */
  11569. A_UINT32 invalid_peer;
  11570. /* MPDUs dropped due to duplication (non aggregation) */
  11571. A_UINT32 dup_non_aggr;
  11572. /* MPDUs dropped due to processed before */
  11573. A_UINT32 dup_past;
  11574. /* MPDUs dropped due to duplicate in reorder queue */
  11575. A_UINT32 dup_in_reorder;
  11576. /* Reorder timeout happened */
  11577. A_UINT32 reorder_timeout;
  11578. /* invalid bar ssn */
  11579. A_UINT32 invalid_bar_ssn;
  11580. /* reorder reset due to bar ssn */
  11581. A_UINT32 ssn_reset;
  11582. /* Flush due to delete peer */
  11583. A_UINT32 deliver_flush_delpeer;
  11584. /* Flush due to offload*/
  11585. A_UINT32 deliver_flush_offload;
  11586. /* Flush due to out of buffer*/
  11587. A_UINT32 deliver_flush_oob;
  11588. /* MPDUs dropped due to PN check fail */
  11589. A_UINT32 pn_fail;
  11590. /* MPDUs dropped due to unable to allocate memory */
  11591. A_UINT32 store_fail;
  11592. /* Number of times the tid pool alloc succeeded */
  11593. A_UINT32 tid_pool_alloc_succ;
  11594. /* Number of times the MPDU pool alloc succeeded */
  11595. A_UINT32 mpdu_pool_alloc_succ;
  11596. /* Number of times the MSDU pool alloc succeeded */
  11597. A_UINT32 msdu_pool_alloc_succ;
  11598. /* Number of times the tid pool alloc failed */
  11599. A_UINT32 tid_pool_alloc_fail;
  11600. /* Number of times the MPDU pool alloc failed */
  11601. A_UINT32 mpdu_pool_alloc_fail;
  11602. /* Number of times the MSDU pool alloc failed */
  11603. A_UINT32 msdu_pool_alloc_fail;
  11604. /* Number of times the tid pool freed */
  11605. A_UINT32 tid_pool_free;
  11606. /* Number of times the MPDU pool freed */
  11607. A_UINT32 mpdu_pool_free;
  11608. /* Number of times the MSDU pool freed */
  11609. A_UINT32 msdu_pool_free;
  11610. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11611. A_UINT32 msdu_queued;
  11612. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11613. A_UINT32 msdu_recycled;
  11614. /* Number of MPDUs with invalid peer but A2 found in AST */
  11615. A_UINT32 invalid_peer_a2_in_ast;
  11616. /* Number of MPDUs with invalid peer but A3 found in AST */
  11617. A_UINT32 invalid_peer_a3_in_ast;
  11618. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11619. A_UINT32 invalid_peer_bmc_mpdus;
  11620. /* Number of MSDUs with err attention word */
  11621. A_UINT32 rxdesc_err_att;
  11622. /* Number of MSDUs with flag of peer_idx_invalid */
  11623. A_UINT32 rxdesc_err_peer_idx_inv;
  11624. /* Number of MSDUs with flag of peer_idx_timeout */
  11625. A_UINT32 rxdesc_err_peer_idx_to;
  11626. /* Number of MSDUs with flag of overflow */
  11627. A_UINT32 rxdesc_err_ov;
  11628. /* Number of MSDUs with flag of msdu_length_err */
  11629. A_UINT32 rxdesc_err_msdu_len;
  11630. /* Number of MSDUs with flag of mpdu_length_err */
  11631. A_UINT32 rxdesc_err_mpdu_len;
  11632. /* Number of MSDUs with flag of tkip_mic_err */
  11633. A_UINT32 rxdesc_err_tkip_mic;
  11634. /* Number of MSDUs with flag of decrypt_err */
  11635. A_UINT32 rxdesc_err_decrypt;
  11636. /* Number of MSDUs with flag of fcs_err */
  11637. A_UINT32 rxdesc_err_fcs;
  11638. /* Number of Unicast (bc_mc bit is not set in attention word)
  11639. * frames with invalid peer handler
  11640. */
  11641. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11642. /* Number of unicast frame directly (direct bit is set in attention word)
  11643. * to DUT with invalid peer handler
  11644. */
  11645. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11646. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11647. * frames with invalid peer handler
  11648. */
  11649. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11650. /* Number of MSDUs dropped due to no first MSDU flag */
  11651. A_UINT32 rxdesc_no_1st_msdu;
  11652. /* Number of MSDUs droped due to ring overflow */
  11653. A_UINT32 msdu_drop_ring_ov;
  11654. /* Number of MSDUs dropped due to FC mismatch */
  11655. A_UINT32 msdu_drop_fc_mismatch;
  11656. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11657. A_UINT32 msdu_drop_mgmt_remote_ring;
  11658. /* Number of MSDUs dropped due to errors not reported in attention word */
  11659. A_UINT32 msdu_drop_misc;
  11660. /* Number of MSDUs go to offload before reorder */
  11661. A_UINT32 offload_msdu_wal;
  11662. /* Number of data frame dropped by offload after reorder */
  11663. A_UINT32 offload_msdu_reorder;
  11664. /* Number of MPDUs with sequence number in the past and within the BA window */
  11665. A_UINT32 dup_past_within_window;
  11666. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11667. A_UINT32 dup_past_outside_window;
  11668. /* Number of MSDUs with decrypt/MIC error */
  11669. A_UINT32 rxdesc_err_decrypt_mic;
  11670. /* Number of data MSDUs received on both local and remote rings */
  11671. A_UINT32 data_msdus_on_both_rings;
  11672. /* MPDUs never filled */
  11673. A_UINT32 holes_not_filled;
  11674. };
  11675. /*
  11676. * Rx Remote buffer statistics
  11677. * NB: all the fields must be defined in 4 octets size.
  11678. */
  11679. struct rx_remote_buffer_mgmt_stats {
  11680. /* Total number of MSDUs reaped for Rx processing */
  11681. A_UINT32 remote_reaped;
  11682. /* MSDUs recycled within firmware */
  11683. A_UINT32 remote_recycled;
  11684. /* MSDUs stored by Data Rx */
  11685. A_UINT32 data_rx_msdus_stored;
  11686. /* Number of HTT indications from WAL Rx MSDU */
  11687. A_UINT32 wal_rx_ind;
  11688. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11689. A_UINT32 wal_rx_ind_unconsumed;
  11690. /* Number of HTT indications from Data Rx MSDU */
  11691. A_UINT32 data_rx_ind;
  11692. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11693. A_UINT32 data_rx_ind_unconsumed;
  11694. /* Number of HTT indications from ATHBUF */
  11695. A_UINT32 athbuf_rx_ind;
  11696. /* Number of remote buffers requested for refill */
  11697. A_UINT32 refill_buf_req;
  11698. /* Number of remote buffers filled by the host */
  11699. A_UINT32 refill_buf_rsp;
  11700. /* Number of times MAC hw_index = f/w write_index */
  11701. A_INT32 mac_no_bufs;
  11702. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11703. A_INT32 fw_indices_equal;
  11704. /* Number of times f/w finds no buffers to post */
  11705. A_INT32 host_no_bufs;
  11706. };
  11707. /*
  11708. * TXBF MU/SU packets and NDPA statistics
  11709. * NB: all the fields must be defined in 4 octets size.
  11710. */
  11711. struct rx_txbf_musu_ndpa_pkts_stats {
  11712. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11713. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11714. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11715. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11716. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11717. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11718. };
  11719. /*
  11720. * htt_dbg_stats_status -
  11721. * present - The requested stats have been delivered in full.
  11722. * This indicates that either the stats information was contained
  11723. * in its entirety within this message, or else this message
  11724. * completes the delivery of the requested stats info that was
  11725. * partially delivered through earlier STATS_CONF messages.
  11726. * partial - The requested stats have been delivered in part.
  11727. * One or more subsequent STATS_CONF messages with the same
  11728. * cookie value will be sent to deliver the remainder of the
  11729. * information.
  11730. * error - The requested stats could not be delivered, for example due
  11731. * to a shortage of memory to construct a message holding the
  11732. * requested stats.
  11733. * invalid - The requested stat type is either not recognized, or the
  11734. * target is configured to not gather the stats type in question.
  11735. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11736. * series_done - This special value indicates that no further stats info
  11737. * elements are present within a series of stats info elems
  11738. * (within a stats upload confirmation message).
  11739. */
  11740. enum htt_dbg_stats_status {
  11741. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11742. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11743. HTT_DBG_STATS_STATUS_ERROR = 2,
  11744. HTT_DBG_STATS_STATUS_INVALID = 3,
  11745. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11746. };
  11747. /**
  11748. * @brief target -> host statistics upload
  11749. *
  11750. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11751. *
  11752. * @details
  11753. * The following field definitions describe the format of the HTT target
  11754. * to host stats upload confirmation message.
  11755. * The message contains a cookie echoed from the HTT host->target stats
  11756. * upload request, which identifies which request the confirmation is
  11757. * for, and a series of tag-length-value stats information elements.
  11758. * The tag-length header for each stats info element also includes a
  11759. * status field, to indicate whether the request for the stat type in
  11760. * question was fully met, partially met, unable to be met, or invalid
  11761. * (if the stat type in question is disabled in the target).
  11762. * A special value of all 1's in this status field is used to indicate
  11763. * the end of the series of stats info elements.
  11764. *
  11765. *
  11766. * |31 16|15 8|7 5|4 0|
  11767. * |------------------------------------------------------------|
  11768. * | reserved | msg type |
  11769. * |------------------------------------------------------------|
  11770. * | cookie LSBs |
  11771. * |------------------------------------------------------------|
  11772. * | cookie MSBs |
  11773. * |------------------------------------------------------------|
  11774. * | stats entry length | reserved | S |stat type|
  11775. * |------------------------------------------------------------|
  11776. * | |
  11777. * | type-specific stats info |
  11778. * | |
  11779. * |------------------------------------------------------------|
  11780. * | stats entry length | reserved | S |stat type|
  11781. * |------------------------------------------------------------|
  11782. * | |
  11783. * | type-specific stats info |
  11784. * | |
  11785. * |------------------------------------------------------------|
  11786. * | n/a | reserved | 111 | n/a |
  11787. * |------------------------------------------------------------|
  11788. * Header fields:
  11789. * - MSG_TYPE
  11790. * Bits 7:0
  11791. * Purpose: identifies this is a statistics upload confirmation message
  11792. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11793. * - COOKIE_LSBS
  11794. * Bits 31:0
  11795. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11796. * message with its preceding host->target stats request message.
  11797. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11798. * - COOKIE_MSBS
  11799. * Bits 31:0
  11800. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11801. * message with its preceding host->target stats request message.
  11802. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11803. *
  11804. * Stats Information Element tag-length header fields:
  11805. * - STAT_TYPE
  11806. * Bits 4:0
  11807. * Purpose: identifies the type of statistics info held in the
  11808. * following information element
  11809. * Value: htt_dbg_stats_type
  11810. * - STATUS
  11811. * Bits 7:5
  11812. * Purpose: indicate whether the requested stats are present
  11813. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11814. * the completion of the stats entry series
  11815. * - LENGTH
  11816. * Bits 31:16
  11817. * Purpose: indicate the stats information size
  11818. * Value: This field specifies the number of bytes of stats information
  11819. * that follows the element tag-length header.
  11820. * It is expected but not required that this length is a multiple of
  11821. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11822. * subsequent stats entry header will begin on a 4-byte aligned
  11823. * boundary.
  11824. */
  11825. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11826. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11827. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11828. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11829. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11830. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11831. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11832. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11833. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11834. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11835. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11836. do { \
  11837. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11838. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11839. } while (0)
  11840. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11841. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11842. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11843. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11844. do { \
  11845. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11846. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11847. } while (0)
  11848. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11849. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11850. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11851. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11852. do { \
  11853. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11854. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11855. } while (0)
  11856. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11857. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11858. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11859. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11860. #define HTT_MAX_AGGR 64
  11861. #define HTT_HL_MAX_AGGR 18
  11862. /**
  11863. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11864. *
  11865. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11866. *
  11867. * @details
  11868. * The following field definitions describe the format of the HTT host
  11869. * to target frag_desc/msdu_ext bank configuration message.
  11870. * The message contains the based address and the min and max id of the
  11871. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11872. * MSDU_EXT/FRAG_DESC.
  11873. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11874. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11875. * the hardware does the mapping/translation.
  11876. *
  11877. * Total banks that can be configured is configured to 16.
  11878. *
  11879. * This should be called before any TX has be initiated by the HTT
  11880. *
  11881. * |31 16|15 8|7 5|4 0|
  11882. * |------------------------------------------------------------|
  11883. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11884. * |------------------------------------------------------------|
  11885. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11886. #if HTT_PADDR64
  11887. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11888. #endif
  11889. * |------------------------------------------------------------|
  11890. * | ... |
  11891. * |------------------------------------------------------------|
  11892. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11893. #if HTT_PADDR64
  11894. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11895. #endif
  11896. * |------------------------------------------------------------|
  11897. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11898. * |------------------------------------------------------------|
  11899. * | ... |
  11900. * |------------------------------------------------------------|
  11901. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11902. * |------------------------------------------------------------|
  11903. * Header fields:
  11904. * - MSG_TYPE
  11905. * Bits 7:0
  11906. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11907. * for systems with 64-bit format for bus addresses:
  11908. * - BANKx_BASE_ADDRESS_LO
  11909. * Bits 31:0
  11910. * Purpose: Provide a mechanism to specify the base address of the
  11911. * MSDU_EXT bank physical/bus address.
  11912. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11913. * - BANKx_BASE_ADDRESS_HI
  11914. * Bits 31:0
  11915. * Purpose: Provide a mechanism to specify the base address of the
  11916. * MSDU_EXT bank physical/bus address.
  11917. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11918. * for systems with 32-bit format for bus addresses:
  11919. * - BANKx_BASE_ADDRESS
  11920. * Bits 31:0
  11921. * Purpose: Provide a mechanism to specify the base address of the
  11922. * MSDU_EXT bank physical/bus address.
  11923. * Value: MSDU_EXT bank physical / bus address
  11924. * - BANKx_MIN_ID
  11925. * Bits 15:0
  11926. * Purpose: Provide a mechanism to specify the min index that needs to
  11927. * mapped.
  11928. * - BANKx_MAX_ID
  11929. * Bits 31:16
  11930. * Purpose: Provide a mechanism to specify the max index that needs to
  11931. * mapped.
  11932. *
  11933. */
  11934. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11935. * safe value.
  11936. * @note MAX supported banks is 16.
  11937. */
  11938. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11939. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11940. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11941. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11942. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11943. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11944. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11945. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11946. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11947. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11948. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11949. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11950. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11951. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11952. do { \
  11953. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11954. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11955. } while (0)
  11956. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11957. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11958. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11959. do { \
  11960. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11961. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11962. } while (0)
  11963. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11964. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11965. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11966. do { \
  11967. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11968. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11969. } while (0)
  11970. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11971. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11972. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11973. do { \
  11974. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11975. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11976. } while (0)
  11977. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11978. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11979. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11980. do { \
  11981. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11982. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11983. } while (0)
  11984. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11985. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11986. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11987. do { \
  11988. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11989. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11990. } while (0)
  11991. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11992. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11993. /*
  11994. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11995. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11996. * addresses are stored in a XXX-bit field.
  11997. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11998. * htt_tx_frag_desc64_bank_cfg_t structs.
  11999. */
  12000. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12001. _paddr_bits_, \
  12002. _paddr__bank_base_address_) \
  12003. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12004. /** word 0 \
  12005. * msg_type: 8, \
  12006. * pdev_id: 2, \
  12007. * swap: 1, \
  12008. * reserved0: 5, \
  12009. * num_banks: 8, \
  12010. * desc_size: 8; \
  12011. */ \
  12012. A_UINT32 word0; \
  12013. /* \
  12014. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12015. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12016. * the second A_UINT32). \
  12017. */ \
  12018. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12019. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12020. } POSTPACK
  12021. /* define htt_tx_frag_desc32_bank_cfg_t */
  12022. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12023. /* define htt_tx_frag_desc64_bank_cfg_t */
  12024. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12025. /*
  12026. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12027. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12028. */
  12029. #if HTT_PADDR64
  12030. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12031. #else
  12032. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12033. #endif
  12034. /**
  12035. * @brief target -> host HTT TX Credit total count update message definition
  12036. *
  12037. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12038. *
  12039. *|31 16|15|14 9| 8 |7 0 |
  12040. *|---------------------+--+----------+-------+----------|
  12041. *|cur htt credit delta | Q| reserved | sign | msg type |
  12042. *|------------------------------------------------------|
  12043. *
  12044. * Header fields:
  12045. * - MSG_TYPE
  12046. * Bits 7:0
  12047. * Purpose: identifies this as a htt tx credit delta update message
  12048. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12049. * - SIGN
  12050. * Bits 8
  12051. * identifies whether credit delta is positive or negative
  12052. * Value:
  12053. * - 0x0: credit delta is positive, rebalance in some buffers
  12054. * - 0x1: credit delta is negative, rebalance out some buffers
  12055. * - reserved
  12056. * Bits 14:9
  12057. * Value: 0x0
  12058. * - TXQ_GRP
  12059. * Bit 15
  12060. * Purpose: indicates whether any tx queue group information elements
  12061. * are appended to the tx credit update message
  12062. * Value: 0 -> no tx queue group information element is present
  12063. * 1 -> a tx queue group information element immediately follows
  12064. * - DELTA_COUNT
  12065. * Bits 31:16
  12066. * Purpose: Specify current htt credit delta absolute count
  12067. */
  12068. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12069. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12070. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12071. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12072. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12073. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12074. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12075. do { \
  12076. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12077. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12078. } while (0)
  12079. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12080. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12081. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12082. do { \
  12083. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12084. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12085. } while (0)
  12086. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12087. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12088. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12089. do { \
  12090. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12091. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12092. } while (0)
  12093. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12094. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12095. #define HTT_TX_CREDIT_MSG_BYTES 4
  12096. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12097. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12098. /**
  12099. * @brief HTT WDI_IPA Operation Response Message
  12100. *
  12101. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12102. *
  12103. * @details
  12104. * HTT WDI_IPA Operation Response message is sent by target
  12105. * to host confirming suspend or resume operation.
  12106. * |31 24|23 16|15 8|7 0|
  12107. * |----------------+----------------+----------------+----------------|
  12108. * | op_code | Rsvd | msg_type |
  12109. * |-------------------------------------------------------------------|
  12110. * | Rsvd | Response len |
  12111. * |-------------------------------------------------------------------|
  12112. * | |
  12113. * | Response-type specific info |
  12114. * | |
  12115. * | |
  12116. * |-------------------------------------------------------------------|
  12117. * Header fields:
  12118. * - MSG_TYPE
  12119. * Bits 7:0
  12120. * Purpose: Identifies this as WDI_IPA Operation Response message
  12121. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12122. * - OP_CODE
  12123. * Bits 31:16
  12124. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12125. * value: = enum htt_wdi_ipa_op_code
  12126. * - RSP_LEN
  12127. * Bits 16:0
  12128. * Purpose: length for the response-type specific info
  12129. * value: = length in bytes for response-type specific info
  12130. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12131. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12132. */
  12133. PREPACK struct htt_wdi_ipa_op_response_t
  12134. {
  12135. /* DWORD 0: flags and meta-data */
  12136. A_UINT32
  12137. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12138. reserved1: 8,
  12139. op_code: 16;
  12140. A_UINT32
  12141. rsp_len: 16,
  12142. reserved2: 16;
  12143. } POSTPACK;
  12144. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12145. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12146. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12147. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12148. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12149. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12150. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12151. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12152. do { \
  12153. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12154. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12155. } while (0)
  12156. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12157. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12158. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12159. do { \
  12160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12161. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12162. } while (0)
  12163. enum htt_phy_mode {
  12164. htt_phy_mode_11a = 0,
  12165. htt_phy_mode_11g = 1,
  12166. htt_phy_mode_11b = 2,
  12167. htt_phy_mode_11g_only = 3,
  12168. htt_phy_mode_11na_ht20 = 4,
  12169. htt_phy_mode_11ng_ht20 = 5,
  12170. htt_phy_mode_11na_ht40 = 6,
  12171. htt_phy_mode_11ng_ht40 = 7,
  12172. htt_phy_mode_11ac_vht20 = 8,
  12173. htt_phy_mode_11ac_vht40 = 9,
  12174. htt_phy_mode_11ac_vht80 = 10,
  12175. htt_phy_mode_11ac_vht20_2g = 11,
  12176. htt_phy_mode_11ac_vht40_2g = 12,
  12177. htt_phy_mode_11ac_vht80_2g = 13,
  12178. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12179. htt_phy_mode_11ac_vht160 = 15,
  12180. htt_phy_mode_max,
  12181. };
  12182. /**
  12183. * @brief target -> host HTT channel change indication
  12184. *
  12185. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12186. *
  12187. * @details
  12188. * Specify when a channel change occurs.
  12189. * This allows the host to precisely determine which rx frames arrived
  12190. * on the old channel and which rx frames arrived on the new channel.
  12191. *
  12192. *|31 |7 0 |
  12193. *|-------------------------------------------+----------|
  12194. *| reserved | msg type |
  12195. *|------------------------------------------------------|
  12196. *| primary_chan_center_freq_mhz |
  12197. *|------------------------------------------------------|
  12198. *| contiguous_chan1_center_freq_mhz |
  12199. *|------------------------------------------------------|
  12200. *| contiguous_chan2_center_freq_mhz |
  12201. *|------------------------------------------------------|
  12202. *| phy_mode |
  12203. *|------------------------------------------------------|
  12204. *
  12205. * Header fields:
  12206. * - MSG_TYPE
  12207. * Bits 7:0
  12208. * Purpose: identifies this as a htt channel change indication message
  12209. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12210. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12211. * Bits 31:0
  12212. * Purpose: identify the (center of the) new 20 MHz primary channel
  12213. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12214. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12215. * Bits 31:0
  12216. * Purpose: identify the (center of the) contiguous frequency range
  12217. * comprising the new channel.
  12218. * For example, if the new channel is a 80 MHz channel extending
  12219. * 60 MHz beyond the primary channel, this field would be 30 larger
  12220. * than the primary channel center frequency field.
  12221. * Value: center frequency of the contiguous frequency range comprising
  12222. * the full channel in MHz units
  12223. * (80+80 channels also use the CONTIG_CHAN2 field)
  12224. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12225. * Bits 31:0
  12226. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12227. * within a VHT 80+80 channel.
  12228. * This field is only relevant for VHT 80+80 channels.
  12229. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12230. * channel (arbitrary value for cases besides VHT 80+80)
  12231. * - PHY_MODE
  12232. * Bits 31:0
  12233. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12234. * and band
  12235. * Value: htt_phy_mode enum value
  12236. */
  12237. PREPACK struct htt_chan_change_t
  12238. {
  12239. /* DWORD 0: flags and meta-data */
  12240. A_UINT32
  12241. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12242. reserved1: 24;
  12243. A_UINT32 primary_chan_center_freq_mhz;
  12244. A_UINT32 contig_chan1_center_freq_mhz;
  12245. A_UINT32 contig_chan2_center_freq_mhz;
  12246. A_UINT32 phy_mode;
  12247. } POSTPACK;
  12248. /*
  12249. * Due to historical / backwards-compatibility reasons, maintain the
  12250. * below htt_chan_change_msg struct definition, which needs to be
  12251. * consistent with the above htt_chan_change_t struct definition
  12252. * (aside from the htt_chan_change_t definition including the msg_type
  12253. * dword within the message, and the htt_chan_change_msg only containing
  12254. * the payload of the message that follows the msg_type dword).
  12255. */
  12256. PREPACK struct htt_chan_change_msg {
  12257. A_UINT32 chan_mhz; /* frequency in mhz */
  12258. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12259. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12260. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12261. } POSTPACK;
  12262. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12263. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12264. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12265. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12266. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12267. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12268. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12269. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12270. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12271. do { \
  12272. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12273. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12274. } while (0)
  12275. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12276. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12277. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12278. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12279. do { \
  12280. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12281. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12282. } while (0)
  12283. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12284. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12285. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12286. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12287. do { \
  12288. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12289. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12290. } while (0)
  12291. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12292. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12293. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12294. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12295. do { \
  12296. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12297. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12298. } while (0)
  12299. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12300. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12301. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12302. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12303. /**
  12304. * @brief rx offload packet error message
  12305. *
  12306. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12307. *
  12308. * @details
  12309. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12310. * of target payload like mic err.
  12311. *
  12312. * |31 24|23 16|15 8|7 0|
  12313. * |----------------+----------------+----------------+----------------|
  12314. * | tid | vdev_id | msg_sub_type | msg_type |
  12315. * |-------------------------------------------------------------------|
  12316. * : (sub-type dependent content) :
  12317. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12318. * Header fields:
  12319. * - msg_type
  12320. * Bits 7:0
  12321. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12322. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12323. * - msg_sub_type
  12324. * Bits 15:8
  12325. * Purpose: Identifies which type of rx error is reported by this message
  12326. * value: htt_rx_ofld_pkt_err_type
  12327. * - vdev_id
  12328. * Bits 23:16
  12329. * Purpose: Identifies which vdev received the erroneous rx frame
  12330. * value:
  12331. * - tid
  12332. * Bits 31:24
  12333. * Purpose: Identifies the traffic type of the rx frame
  12334. * value:
  12335. *
  12336. * - The payload fields used if the sub-type == MIC error are shown below.
  12337. * Note - MIC err is per MSDU, while PN is per MPDU.
  12338. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12339. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12340. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12341. * instead of sending separate HTT messages for each wrong MSDU within
  12342. * the MPDU.
  12343. *
  12344. * |31 24|23 16|15 8|7 0|
  12345. * |----------------+----------------+----------------+----------------|
  12346. * | Rsvd | key_id | peer_id |
  12347. * |-------------------------------------------------------------------|
  12348. * | receiver MAC addr 31:0 |
  12349. * |-------------------------------------------------------------------|
  12350. * | Rsvd | receiver MAC addr 47:32 |
  12351. * |-------------------------------------------------------------------|
  12352. * | transmitter MAC addr 31:0 |
  12353. * |-------------------------------------------------------------------|
  12354. * | Rsvd | transmitter MAC addr 47:32 |
  12355. * |-------------------------------------------------------------------|
  12356. * | PN 31:0 |
  12357. * |-------------------------------------------------------------------|
  12358. * | Rsvd | PN 47:32 |
  12359. * |-------------------------------------------------------------------|
  12360. * - peer_id
  12361. * Bits 15:0
  12362. * Purpose: identifies which peer is frame is from
  12363. * value:
  12364. * - key_id
  12365. * Bits 23:16
  12366. * Purpose: identifies key_id of rx frame
  12367. * value:
  12368. * - RA_31_0 (receiver MAC addr 31:0)
  12369. * Bits 31:0
  12370. * Purpose: identifies by MAC address which vdev received the frame
  12371. * value: MAC address lower 4 bytes
  12372. * - RA_47_32 (receiver MAC addr 47:32)
  12373. * Bits 15:0
  12374. * Purpose: identifies by MAC address which vdev received the frame
  12375. * value: MAC address upper 2 bytes
  12376. * - TA_31_0 (transmitter MAC addr 31:0)
  12377. * Bits 31:0
  12378. * Purpose: identifies by MAC address which peer transmitted the frame
  12379. * value: MAC address lower 4 bytes
  12380. * - TA_47_32 (transmitter MAC addr 47:32)
  12381. * Bits 15:0
  12382. * Purpose: identifies by MAC address which peer transmitted the frame
  12383. * value: MAC address upper 2 bytes
  12384. * - PN_31_0
  12385. * Bits 31:0
  12386. * Purpose: Identifies pn of rx frame
  12387. * value: PN lower 4 bytes
  12388. * - PN_47_32
  12389. * Bits 15:0
  12390. * Purpose: Identifies pn of rx frame
  12391. * value:
  12392. * TKIP or CCMP: PN upper 2 bytes
  12393. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12394. */
  12395. enum htt_rx_ofld_pkt_err_type {
  12396. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12397. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12398. };
  12399. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12400. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12401. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12402. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12403. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12404. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12405. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12406. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12407. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12408. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12409. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12410. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12411. do { \
  12412. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12413. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12414. } while (0)
  12415. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12416. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12417. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12418. do { \
  12419. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12420. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12421. } while (0)
  12422. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12423. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12424. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12425. do { \
  12426. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12427. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12428. } while (0)
  12429. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12442. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12443. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12444. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12445. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12446. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12447. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12448. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12449. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12450. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12451. do { \
  12452. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12453. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12454. } while (0)
  12455. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12456. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12457. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12458. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12459. do { \
  12460. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12461. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12462. } while (0)
  12463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12464. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12465. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12466. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12467. do { \
  12468. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12469. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12470. } while (0)
  12471. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12472. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12473. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12474. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12475. do { \
  12476. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12477. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12478. } while (0)
  12479. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12480. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12481. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12482. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12483. do { \
  12484. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12485. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12486. } while (0)
  12487. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12488. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12489. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12490. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12491. do { \
  12492. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12493. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12494. } while (0)
  12495. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12496. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12497. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12498. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12499. do { \
  12500. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12501. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12502. } while (0)
  12503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12504. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12505. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12507. do { \
  12508. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12509. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12510. } while (0)
  12511. /**
  12512. * @brief target -> host peer rate report message
  12513. *
  12514. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12515. *
  12516. * @details
  12517. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12518. * justified rate of all the peers.
  12519. *
  12520. * |31 24|23 16|15 8|7 0|
  12521. * |----------------+----------------+----------------+----------------|
  12522. * | peer_count | | msg_type |
  12523. * |-------------------------------------------------------------------|
  12524. * : Payload (variant number of peer rate report) :
  12525. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12526. * Header fields:
  12527. * - msg_type
  12528. * Bits 7:0
  12529. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12530. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12531. * - reserved
  12532. * Bits 15:8
  12533. * Purpose:
  12534. * value:
  12535. * - peer_count
  12536. * Bits 31:16
  12537. * Purpose: Specify how many peer rate report elements are present in the payload.
  12538. * value:
  12539. *
  12540. * Payload:
  12541. * There are variant number of peer rate report follow the first 32 bits.
  12542. * The peer rate report is defined as follows.
  12543. *
  12544. * |31 20|19 16|15 0|
  12545. * |-----------------------+---------+---------------------------------|-
  12546. * | reserved | phy | peer_id | \
  12547. * |-------------------------------------------------------------------| -> report #0
  12548. * | rate | /
  12549. * |-----------------------+---------+---------------------------------|-
  12550. * | reserved | phy | peer_id | \
  12551. * |-------------------------------------------------------------------| -> report #1
  12552. * | rate | /
  12553. * |-----------------------+---------+---------------------------------|-
  12554. * | reserved | phy | peer_id | \
  12555. * |-------------------------------------------------------------------| -> report #2
  12556. * | rate | /
  12557. * |-------------------------------------------------------------------|-
  12558. * : :
  12559. * : :
  12560. * : :
  12561. * :-------------------------------------------------------------------:
  12562. *
  12563. * - peer_id
  12564. * Bits 15:0
  12565. * Purpose: identify the peer
  12566. * value:
  12567. * - phy
  12568. * Bits 19:16
  12569. * Purpose: identify which phy is in use
  12570. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12571. * Please see enum htt_peer_report_phy_type for detail.
  12572. * - reserved
  12573. * Bits 31:20
  12574. * Purpose:
  12575. * value:
  12576. * - rate
  12577. * Bits 31:0
  12578. * Purpose: represent the justified rate of the peer specified by peer_id
  12579. * value:
  12580. */
  12581. enum htt_peer_rate_report_phy_type {
  12582. HTT_PEER_RATE_REPORT_11B = 0,
  12583. HTT_PEER_RATE_REPORT_11A_G,
  12584. HTT_PEER_RATE_REPORT_11N,
  12585. HTT_PEER_RATE_REPORT_11AC,
  12586. };
  12587. #define HTT_PEER_RATE_REPORT_SIZE 8
  12588. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12589. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12590. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12591. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12592. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12593. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12594. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12595. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12596. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12597. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12598. do { \
  12599. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12600. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12601. } while (0)
  12602. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12603. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12604. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12605. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12606. do { \
  12607. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12608. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12609. } while (0)
  12610. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12611. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12612. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12613. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12614. do { \
  12615. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12616. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12617. } while (0)
  12618. /**
  12619. * @brief target -> host flow pool map message
  12620. *
  12621. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12622. *
  12623. * @details
  12624. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12625. * a flow of descriptors.
  12626. *
  12627. * This message is in TLV format and indicates the parameters to be setup a
  12628. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12629. * receive descriptors from a specified pool.
  12630. *
  12631. * The message would appear as follows:
  12632. *
  12633. * |31 24|23 16|15 8|7 0|
  12634. * |----------------+----------------+----------------+----------------|
  12635. * header | reserved | num_flows | msg_type |
  12636. * |-------------------------------------------------------------------|
  12637. * | |
  12638. * : payload :
  12639. * | |
  12640. * |-------------------------------------------------------------------|
  12641. *
  12642. * The header field is one DWORD long and is interpreted as follows:
  12643. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12644. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12645. * this message
  12646. * b'16-31 - reserved: These bits are reserved for future use
  12647. *
  12648. * Payload:
  12649. * The payload would contain multiple objects of the following structure. Each
  12650. * object represents a flow.
  12651. *
  12652. * |31 24|23 16|15 8|7 0|
  12653. * |----------------+----------------+----------------+----------------|
  12654. * header | reserved | num_flows | msg_type |
  12655. * |-------------------------------------------------------------------|
  12656. * payload0| flow_type |
  12657. * |-------------------------------------------------------------------|
  12658. * | flow_id |
  12659. * |-------------------------------------------------------------------|
  12660. * | reserved0 | flow_pool_id |
  12661. * |-------------------------------------------------------------------|
  12662. * | reserved1 | flow_pool_size |
  12663. * |-------------------------------------------------------------------|
  12664. * | reserved2 |
  12665. * |-------------------------------------------------------------------|
  12666. * payload1| flow_type |
  12667. * |-------------------------------------------------------------------|
  12668. * | flow_id |
  12669. * |-------------------------------------------------------------------|
  12670. * | reserved0 | flow_pool_id |
  12671. * |-------------------------------------------------------------------|
  12672. * | reserved1 | flow_pool_size |
  12673. * |-------------------------------------------------------------------|
  12674. * | reserved2 |
  12675. * |-------------------------------------------------------------------|
  12676. * | . |
  12677. * | . |
  12678. * | . |
  12679. * |-------------------------------------------------------------------|
  12680. *
  12681. * Each payload is 5 DWORDS long and is interpreted as follows:
  12682. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12683. * this flow is associated. It can be VDEV, peer,
  12684. * or tid (AC). Based on enum htt_flow_type.
  12685. *
  12686. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12687. * object. For flow_type vdev it is set to the
  12688. * vdevid, for peer it is peerid and for tid, it is
  12689. * tid_num.
  12690. *
  12691. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12692. * in the host for this flow
  12693. * b'16:31 - reserved0: This field in reserved for the future. In case
  12694. * we have a hierarchical implementation (HCM) of
  12695. * pools, it can be used to indicate the ID of the
  12696. * parent-pool.
  12697. *
  12698. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12699. * Descriptors for this flow will be
  12700. * allocated from this pool in the host.
  12701. * b'16:31 - reserved1: This field in reserved for the future. In case
  12702. * we have a hierarchical implementation of pools,
  12703. * it can be used to indicate the max number of
  12704. * descriptors in the pool. The b'0:15 can be used
  12705. * to indicate min number of descriptors in the
  12706. * HCM scheme.
  12707. *
  12708. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12709. * we have a hierarchical implementation of pools,
  12710. * b'0:15 can be used to indicate the
  12711. * priority-based borrowing (PBB) threshold of
  12712. * the flow's pool. The b'16:31 are still left
  12713. * reserved.
  12714. */
  12715. enum htt_flow_type {
  12716. FLOW_TYPE_VDEV = 0,
  12717. /* Insert new flow types above this line */
  12718. };
  12719. PREPACK struct htt_flow_pool_map_payload_t {
  12720. A_UINT32 flow_type;
  12721. A_UINT32 flow_id;
  12722. A_UINT32 flow_pool_id:16,
  12723. reserved0:16;
  12724. A_UINT32 flow_pool_size:16,
  12725. reserved1:16;
  12726. A_UINT32 reserved2;
  12727. } POSTPACK;
  12728. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12729. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12730. (sizeof(struct htt_flow_pool_map_payload_t))
  12731. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12732. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12733. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12734. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12735. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12736. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12737. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12738. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12739. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12740. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12741. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12742. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12743. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12744. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12745. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12746. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12747. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12748. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12749. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12750. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12751. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12752. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12753. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12754. do { \
  12755. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12756. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12757. } while (0)
  12758. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12759. do { \
  12760. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12761. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12762. } while (0)
  12763. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12764. do { \
  12765. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12766. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12767. } while (0)
  12768. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12769. do { \
  12770. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12771. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12772. } while (0)
  12773. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12774. do { \
  12775. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12776. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12777. } while (0)
  12778. /**
  12779. * @brief target -> host flow pool unmap message
  12780. *
  12781. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12782. *
  12783. * @details
  12784. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12785. * down a flow of descriptors.
  12786. * This message indicates that for the flow (whose ID is provided) is wanting
  12787. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12788. * pool of descriptors from where descriptors are being allocated for this
  12789. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12790. * be unmapped by the host.
  12791. *
  12792. * The message would appear as follows:
  12793. *
  12794. * |31 24|23 16|15 8|7 0|
  12795. * |----------------+----------------+----------------+----------------|
  12796. * | reserved0 | msg_type |
  12797. * |-------------------------------------------------------------------|
  12798. * | flow_type |
  12799. * |-------------------------------------------------------------------|
  12800. * | flow_id |
  12801. * |-------------------------------------------------------------------|
  12802. * | reserved1 | flow_pool_id |
  12803. * |-------------------------------------------------------------------|
  12804. *
  12805. * The message is interpreted as follows:
  12806. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12807. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12808. * b'8:31 - reserved0: Reserved for future use
  12809. *
  12810. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12811. * this flow is associated. It can be VDEV, peer,
  12812. * or tid (AC). Based on enum htt_flow_type.
  12813. *
  12814. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12815. * object. For flow_type vdev it is set to the
  12816. * vdevid, for peer it is peerid and for tid, it is
  12817. * tid_num.
  12818. *
  12819. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12820. * used in the host for this flow
  12821. * b'16:31 - reserved0: This field in reserved for the future.
  12822. *
  12823. */
  12824. PREPACK struct htt_flow_pool_unmap_t {
  12825. A_UINT32 msg_type:8,
  12826. reserved0:24;
  12827. A_UINT32 flow_type;
  12828. A_UINT32 flow_id;
  12829. A_UINT32 flow_pool_id:16,
  12830. reserved1:16;
  12831. } POSTPACK;
  12832. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12833. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12834. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12835. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12836. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12837. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12838. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12839. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12840. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12841. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12842. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12843. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12844. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12845. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12846. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12847. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12848. do { \
  12849. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12850. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12851. } while (0)
  12852. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12853. do { \
  12854. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12855. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12856. } while (0)
  12857. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12858. do { \
  12859. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12860. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12861. } while (0)
  12862. /**
  12863. * @brief target -> host SRING setup done message
  12864. *
  12865. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12866. *
  12867. * @details
  12868. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12869. * SRNG ring setup is done
  12870. *
  12871. * This message indicates whether the last setup operation is successful.
  12872. * It will be sent to host when host set respose_required bit in
  12873. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12874. * The message would appear as follows:
  12875. *
  12876. * |31 24|23 16|15 8|7 0|
  12877. * |--------------- +----------------+----------------+----------------|
  12878. * | setup_status | ring_id | pdev_id | msg_type |
  12879. * |-------------------------------------------------------------------|
  12880. *
  12881. * The message is interpreted as follows:
  12882. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12883. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12884. * b'8:15 - pdev_id:
  12885. * 0 (for rings at SOC/UMAC level),
  12886. * 1/2/3 mac id (for rings at LMAC level)
  12887. * b'16:23 - ring_id: Identify the ring which is set up
  12888. * More details can be got from enum htt_srng_ring_id
  12889. * b'24:31 - setup_status: Indicate status of setup operation
  12890. * Refer to htt_ring_setup_status
  12891. */
  12892. PREPACK struct htt_sring_setup_done_t {
  12893. A_UINT32 msg_type: 8,
  12894. pdev_id: 8,
  12895. ring_id: 8,
  12896. setup_status: 8;
  12897. } POSTPACK;
  12898. enum htt_ring_setup_status {
  12899. htt_ring_setup_status_ok = 0,
  12900. htt_ring_setup_status_error,
  12901. };
  12902. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12903. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12904. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12905. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12906. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12907. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12908. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12909. do { \
  12910. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12911. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12912. } while (0)
  12913. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12914. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12915. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12916. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12917. HTT_SRING_SETUP_DONE_RING_ID_S)
  12918. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12919. do { \
  12920. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12921. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12922. } while (0)
  12923. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12924. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12925. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12926. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12927. HTT_SRING_SETUP_DONE_STATUS_S)
  12928. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12929. do { \
  12930. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12931. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12932. } while (0)
  12933. /**
  12934. * @brief target -> flow map flow info
  12935. *
  12936. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12937. *
  12938. * @details
  12939. * HTT TX map flow entry with tqm flow pointer
  12940. * Sent from firmware to host to add tqm flow pointer in corresponding
  12941. * flow search entry. Flow metadata is replayed back to host as part of this
  12942. * struct to enable host to find the specific flow search entry
  12943. *
  12944. * The message would appear as follows:
  12945. *
  12946. * |31 28|27 18|17 14|13 8|7 0|
  12947. * |-------+------------------------------------------+----------------|
  12948. * | rsvd0 | fse_hsh_idx | msg_type |
  12949. * |-------------------------------------------------------------------|
  12950. * | rsvd1 | tid | peer_id |
  12951. * |-------------------------------------------------------------------|
  12952. * | tqm_flow_pntr_lo |
  12953. * |-------------------------------------------------------------------|
  12954. * | tqm_flow_pntr_hi |
  12955. * |-------------------------------------------------------------------|
  12956. * | fse_meta_data |
  12957. * |-------------------------------------------------------------------|
  12958. *
  12959. * The message is interpreted as follows:
  12960. *
  12961. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12962. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12963. *
  12964. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12965. * for this flow entry
  12966. *
  12967. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12968. *
  12969. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12970. *
  12971. * dword1 - b'14:17 - tid
  12972. *
  12973. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12974. *
  12975. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12976. *
  12977. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12978. *
  12979. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12980. * given by host
  12981. */
  12982. PREPACK struct htt_tx_map_flow_info {
  12983. A_UINT32
  12984. msg_type: 8,
  12985. fse_hsh_idx: 20,
  12986. rsvd0: 4;
  12987. A_UINT32
  12988. peer_id: 14,
  12989. tid: 4,
  12990. rsvd1: 14;
  12991. A_UINT32 tqm_flow_pntr_lo;
  12992. A_UINT32 tqm_flow_pntr_hi;
  12993. struct htt_tx_flow_metadata fse_meta_data;
  12994. } POSTPACK;
  12995. /* DWORD 0 */
  12996. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12997. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12998. /* DWORD 1 */
  12999. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13000. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13001. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13002. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13003. /* DWORD 0 */
  13004. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13005. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13006. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13007. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13008. do { \
  13009. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13010. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13011. } while (0)
  13012. /* DWORD 1 */
  13013. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13014. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13015. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13016. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13017. do { \
  13018. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13019. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13020. } while (0)
  13021. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13022. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13023. HTT_TX_MAP_FLOW_INFO_TID_S)
  13024. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13025. do { \
  13026. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13027. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13028. } while (0)
  13029. /*
  13030. * htt_dbg_ext_stats_status -
  13031. * present - The requested stats have been delivered in full.
  13032. * This indicates that either the stats information was contained
  13033. * in its entirety within this message, or else this message
  13034. * completes the delivery of the requested stats info that was
  13035. * partially delivered through earlier STATS_CONF messages.
  13036. * partial - The requested stats have been delivered in part.
  13037. * One or more subsequent STATS_CONF messages with the same
  13038. * cookie value will be sent to deliver the remainder of the
  13039. * information.
  13040. * error - The requested stats could not be delivered, for example due
  13041. * to a shortage of memory to construct a message holding the
  13042. * requested stats.
  13043. * invalid - The requested stat type is either not recognized, or the
  13044. * target is configured to not gather the stats type in question.
  13045. */
  13046. enum htt_dbg_ext_stats_status {
  13047. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13048. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13049. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13050. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13051. };
  13052. /**
  13053. * @brief target -> host ppdu stats upload
  13054. *
  13055. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13056. *
  13057. * @details
  13058. * The following field definitions describe the format of the HTT target
  13059. * to host ppdu stats indication message.
  13060. *
  13061. *
  13062. * |31 16|15 12|11 10|9 8|7 0 |
  13063. * |----------------------------------------------------------------------|
  13064. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13065. * |----------------------------------------------------------------------|
  13066. * | ppdu_id |
  13067. * |----------------------------------------------------------------------|
  13068. * | Timestamp in us |
  13069. * |----------------------------------------------------------------------|
  13070. * | reserved |
  13071. * |----------------------------------------------------------------------|
  13072. * | type-specific stats info |
  13073. * | (see htt_ppdu_stats.h) |
  13074. * |----------------------------------------------------------------------|
  13075. * Header fields:
  13076. * - MSG_TYPE
  13077. * Bits 7:0
  13078. * Purpose: Identifies this is a PPDU STATS indication
  13079. * message.
  13080. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13081. * - mac_id
  13082. * Bits 9:8
  13083. * Purpose: mac_id of this ppdu_id
  13084. * Value: 0-3
  13085. * - pdev_id
  13086. * Bits 11:10
  13087. * Purpose: pdev_id of this ppdu_id
  13088. * Value: 0-3
  13089. * 0 (for rings at SOC level),
  13090. * 1/2/3 PDEV -> 0/1/2
  13091. * - payload_size
  13092. * Bits 31:16
  13093. * Purpose: total tlv size
  13094. * Value: payload_size in bytes
  13095. */
  13096. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13097. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13098. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13099. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13100. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13101. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13102. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13103. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13104. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13105. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13106. do { \
  13107. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13108. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13109. } while (0)
  13110. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13111. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13112. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13113. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13114. do { \
  13115. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13116. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13117. } while (0)
  13118. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13119. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13120. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13121. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13122. do { \
  13123. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13124. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13125. } while (0)
  13126. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13127. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13128. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13129. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13130. do { \
  13131. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13132. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13133. } while (0)
  13134. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13135. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13136. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13137. /* htt_t2h_ppdu_stats_ind_hdr_t
  13138. * This struct contains the fields within the header of the
  13139. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13140. * stats info.
  13141. * This struct assumes little-endian layout, and thus is only
  13142. * suitable for use within processors known to be little-endian
  13143. * (such as the target).
  13144. * In contrast, the above macros provide endian-portable methods
  13145. * to get and set the bitfields within this PPDU_STATS_IND header.
  13146. */
  13147. typedef struct {
  13148. A_UINT32 msg_type: 8, /* bits 7:0 */
  13149. mac_id: 2, /* bits 9:8 */
  13150. pdev_id: 2, /* bits 11:10 */
  13151. reserved1: 4, /* bits 15:12 */
  13152. payload_size: 16; /* bits 31:16 */
  13153. A_UINT32 ppdu_id;
  13154. A_UINT32 timestamp_us;
  13155. A_UINT32 reserved2;
  13156. } htt_t2h_ppdu_stats_ind_hdr_t;
  13157. /**
  13158. * @brief target -> host extended statistics upload
  13159. *
  13160. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13161. *
  13162. * @details
  13163. * The following field definitions describe the format of the HTT target
  13164. * to host stats upload confirmation message.
  13165. * The message contains a cookie echoed from the HTT host->target stats
  13166. * upload request, which identifies which request the confirmation is
  13167. * for, and a single stats can span over multiple HTT stats indication
  13168. * due to the HTT message size limitation so every HTT ext stats indication
  13169. * will have tag-length-value stats information elements.
  13170. * The tag-length header for each HTT stats IND message also includes a
  13171. * status field, to indicate whether the request for the stat type in
  13172. * question was fully met, partially met, unable to be met, or invalid
  13173. * (if the stat type in question is disabled in the target).
  13174. * A Done bit 1's indicate the end of the of stats info elements.
  13175. *
  13176. *
  13177. * |31 16|15 12|11|10 8|7 5|4 0|
  13178. * |--------------------------------------------------------------|
  13179. * | reserved | msg type |
  13180. * |--------------------------------------------------------------|
  13181. * | cookie LSBs |
  13182. * |--------------------------------------------------------------|
  13183. * | cookie MSBs |
  13184. * |--------------------------------------------------------------|
  13185. * | stats entry length | rsvd | D| S | stat type |
  13186. * |--------------------------------------------------------------|
  13187. * | type-specific stats info |
  13188. * | (see htt_stats.h) |
  13189. * |--------------------------------------------------------------|
  13190. * Header fields:
  13191. * - MSG_TYPE
  13192. * Bits 7:0
  13193. * Purpose: Identifies this is a extended statistics upload confirmation
  13194. * message.
  13195. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13196. * - COOKIE_LSBS
  13197. * Bits 31:0
  13198. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13199. * message with its preceding host->target stats request message.
  13200. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13201. * - COOKIE_MSBS
  13202. * Bits 31:0
  13203. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13204. * message with its preceding host->target stats request message.
  13205. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13206. *
  13207. * Stats Information Element tag-length header fields:
  13208. * - STAT_TYPE
  13209. * Bits 7:0
  13210. * Purpose: identifies the type of statistics info held in the
  13211. * following information element
  13212. * Value: htt_dbg_ext_stats_type
  13213. * - STATUS
  13214. * Bits 10:8
  13215. * Purpose: indicate whether the requested stats are present
  13216. * Value: htt_dbg_ext_stats_status
  13217. * - DONE
  13218. * Bits 11
  13219. * Purpose:
  13220. * Indicates the completion of the stats entry, this will be the last
  13221. * stats conf HTT segment for the requested stats type.
  13222. * Value:
  13223. * 0 -> the stats retrieval is ongoing
  13224. * 1 -> the stats retrieval is complete
  13225. * - LENGTH
  13226. * Bits 31:16
  13227. * Purpose: indicate the stats information size
  13228. * Value: This field specifies the number of bytes of stats information
  13229. * that follows the element tag-length header.
  13230. * It is expected but not required that this length is a multiple of
  13231. * 4 bytes.
  13232. */
  13233. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13234. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13235. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13236. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13237. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13238. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13239. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13240. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13241. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13242. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13243. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13244. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13245. do { \
  13246. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13247. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13248. } while (0)
  13249. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13250. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13251. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13252. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13253. do { \
  13254. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13255. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13256. } while (0)
  13257. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13258. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13259. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13260. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13261. do { \
  13262. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13263. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13264. } while (0)
  13265. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13266. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13267. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13268. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13269. do { \
  13270. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13271. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13272. } while (0)
  13273. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13274. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13275. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13276. typedef enum {
  13277. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13278. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13279. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13280. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13281. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13282. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13283. /* Reserved from 128 - 255 for target internal use.*/
  13284. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13285. } HTT_PEER_TYPE;
  13286. /** macro to convert MAC address from char array to HTT word format */
  13287. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13288. (phtt_mac_addr)->mac_addr31to0 = \
  13289. (((c_macaddr)[0] << 0) | \
  13290. ((c_macaddr)[1] << 8) | \
  13291. ((c_macaddr)[2] << 16) | \
  13292. ((c_macaddr)[3] << 24)); \
  13293. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13294. } while (0)
  13295. /**
  13296. * @brief target -> host monitor mac header indication message
  13297. *
  13298. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13299. *
  13300. * @details
  13301. * The following diagram shows the format of the monitor mac header message
  13302. * sent from the target to the host.
  13303. * This message is primarily sent when promiscuous rx mode is enabled.
  13304. * One message is sent per rx PPDU.
  13305. *
  13306. * |31 24|23 16|15 8|7 0|
  13307. * |-------------------------------------------------------------|
  13308. * | peer_id | reserved0 | msg_type |
  13309. * |-------------------------------------------------------------|
  13310. * | reserved1 | num_mpdu |
  13311. * |-------------------------------------------------------------|
  13312. * | struct hw_rx_desc |
  13313. * | (see wal_rx_desc.h) |
  13314. * |-------------------------------------------------------------|
  13315. * | struct ieee80211_frame_addr4 |
  13316. * | (see ieee80211_defs.h) |
  13317. * |-------------------------------------------------------------|
  13318. * | struct ieee80211_frame_addr4 |
  13319. * | (see ieee80211_defs.h) |
  13320. * |-------------------------------------------------------------|
  13321. * | ...... |
  13322. * |-------------------------------------------------------------|
  13323. *
  13324. * Header fields:
  13325. * - msg_type
  13326. * Bits 7:0
  13327. * Purpose: Identifies this is a monitor mac header indication message.
  13328. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13329. * - peer_id
  13330. * Bits 31:16
  13331. * Purpose: Software peer id given by host during association,
  13332. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13333. * for rx PPDUs received from unassociated peers.
  13334. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13335. * - num_mpdu
  13336. * Bits 15:0
  13337. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13338. * delivered within the message.
  13339. * Value: 1 to 32
  13340. * num_mpdu is limited to a maximum value of 32, due to buffer
  13341. * size limits. For PPDUs with more than 32 MPDUs, only the
  13342. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13343. * the PPDU will be provided.
  13344. */
  13345. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13346. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13347. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13348. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13349. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13350. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13351. do { \
  13352. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13353. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13354. } while (0)
  13355. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13356. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13357. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13358. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13359. do { \
  13360. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13361. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13362. } while (0)
  13363. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13364. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13365. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13366. /**
  13367. * @brief target -> host flow pool resize Message
  13368. *
  13369. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13370. *
  13371. * @details
  13372. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13373. * the flow pool associated with the specified ID is resized
  13374. *
  13375. * The message would appear as follows:
  13376. *
  13377. * |31 16|15 8|7 0|
  13378. * |---------------------------------+----------------+----------------|
  13379. * | reserved0 | Msg type |
  13380. * |-------------------------------------------------------------------|
  13381. * | flow pool new size | flow pool ID |
  13382. * |-------------------------------------------------------------------|
  13383. *
  13384. * The message is interpreted as follows:
  13385. * b'0:7 - msg_type: This will be set to 0x21
  13386. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13387. *
  13388. * b'0:15 - flow pool ID: Existing flow pool ID
  13389. *
  13390. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13391. *
  13392. */
  13393. PREPACK struct htt_flow_pool_resize_t {
  13394. A_UINT32 msg_type:8,
  13395. reserved0:24;
  13396. A_UINT32 flow_pool_id:16,
  13397. flow_pool_new_size:16;
  13398. } POSTPACK;
  13399. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13400. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13401. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13402. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13403. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13404. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13405. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13406. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13407. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13408. do { \
  13409. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13410. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13411. } while (0)
  13412. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13413. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13414. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13415. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13416. do { \
  13417. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13418. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13419. } while (0)
  13420. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13421. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13422. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13423. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13424. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13425. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13426. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13427. /*
  13428. * The read and write indices point to the data within the host buffer.
  13429. * Because the first 4 bytes of the host buffer is used for the read index and
  13430. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13431. * The read index and write index are the byte offsets from the base of the
  13432. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13433. * Refer the ASCII text picture below.
  13434. */
  13435. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13436. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13437. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13438. /*
  13439. ***************************************************************************
  13440. *
  13441. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13442. *
  13443. ***************************************************************************
  13444. *
  13445. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13446. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13447. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13448. * written into the Host memory region mentioned below.
  13449. *
  13450. * Read index is updated by the Host. At any point of time, the read index will
  13451. * indicate the index that will next be read by the Host. The read index is
  13452. * in units of bytes offset from the base of the meta-data buffer.
  13453. *
  13454. * Write index is updated by the FW. At any point of time, the write index will
  13455. * indicate from where the FW can start writing any new data. The write index is
  13456. * in units of bytes offset from the base of the meta-data buffer.
  13457. *
  13458. * If the Host is not fast enough in reading the CFR data, any new capture data
  13459. * would be dropped if there is no space left to write the new captures.
  13460. *
  13461. * The last 4 bytes of the memory region will have the magic pattern
  13462. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13463. * not overrun the host buffer.
  13464. *
  13465. * ,--------------------. read and write indices store the
  13466. * | | byte offset from the base of the
  13467. * | ,--------+--------. meta-data buffer to the next
  13468. * | | | | location within the data buffer
  13469. * | | v v that will be read / written
  13470. * ************************************************************************
  13471. * * Read * Write * * Magic *
  13472. * * index * index * CFR data1 ...... CFR data N * pattern *
  13473. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13474. * ************************************************************************
  13475. * |<---------- data buffer ---------->|
  13476. *
  13477. * |<----------------- meta-data buffer allocated in Host ----------------|
  13478. *
  13479. * Note:
  13480. * - Considering the 4 bytes needed to store the Read index (R) and the
  13481. * Write index (W), the initial value is as follows:
  13482. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13483. * - Buffer empty condition:
  13484. * R = W
  13485. *
  13486. * Regarding CFR data format:
  13487. * --------------------------
  13488. *
  13489. * Each CFR tone is stored in HW as 16-bits with the following format:
  13490. * {bits[15:12], bits[11:6], bits[5:0]} =
  13491. * {unsigned exponent (4 bits),
  13492. * signed mantissa_real (6 bits),
  13493. * signed mantissa_imag (6 bits)}
  13494. *
  13495. * CFR_real = mantissa_real * 2^(exponent-5)
  13496. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13497. *
  13498. *
  13499. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13500. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13501. *
  13502. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13503. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13504. * .
  13505. * .
  13506. * .
  13507. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13508. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13509. */
  13510. /* Bandwidth of peer CFR captures */
  13511. typedef enum {
  13512. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13513. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13514. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13515. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13516. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13517. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13518. } HTT_PEER_CFR_CAPTURE_BW;
  13519. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13520. * was captured
  13521. */
  13522. typedef enum {
  13523. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13524. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13525. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13526. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13527. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13528. } HTT_PEER_CFR_CAPTURE_MODE;
  13529. typedef enum {
  13530. /* This message type is currently used for the below purpose:
  13531. *
  13532. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13533. * wmi_peer_cfr_capture_cmd.
  13534. * If payload_present bit is set to 0 then the associated memory region
  13535. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13536. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13537. * message; the CFR dump will be present at the end of the message,
  13538. * after the chan_phy_mode.
  13539. */
  13540. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13541. /* Always keep this last */
  13542. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13543. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13544. /**
  13545. * @brief target -> host CFR dump completion indication message definition
  13546. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13547. *
  13548. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13549. *
  13550. * @details
  13551. * The following diagram shows the format of the Channel Frequency Response
  13552. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13553. * the channel capture of a peer is copied by Firmware into the Host memory
  13554. *
  13555. * **************************************************************************
  13556. *
  13557. * Message format when the CFR capture message type is
  13558. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13559. *
  13560. * **************************************************************************
  13561. *
  13562. * |31 16|15 |8|7 0|
  13563. * |----------------------------------------------------------------|
  13564. * header: | reserved |P| msg_type |
  13565. * word 0 | | | |
  13566. * |----------------------------------------------------------------|
  13567. * payload: | cfr_capture_msg_type |
  13568. * word 1 | |
  13569. * |----------------------------------------------------------------|
  13570. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13571. * word 2 | | | | | | | | |
  13572. * |----------------------------------------------------------------|
  13573. * | mac_addr31to0 |
  13574. * word 3 | |
  13575. * |----------------------------------------------------------------|
  13576. * | unused / reserved | mac_addr47to32 |
  13577. * word 4 | | |
  13578. * |----------------------------------------------------------------|
  13579. * | index |
  13580. * word 5 | |
  13581. * |----------------------------------------------------------------|
  13582. * | length |
  13583. * word 6 | |
  13584. * |----------------------------------------------------------------|
  13585. * | timestamp |
  13586. * word 7 | |
  13587. * |----------------------------------------------------------------|
  13588. * | counter |
  13589. * word 8 | |
  13590. * |----------------------------------------------------------------|
  13591. * | chan_mhz |
  13592. * word 9 | |
  13593. * |----------------------------------------------------------------|
  13594. * | band_center_freq1 |
  13595. * word 10 | |
  13596. * |----------------------------------------------------------------|
  13597. * | band_center_freq2 |
  13598. * word 11 | |
  13599. * |----------------------------------------------------------------|
  13600. * | chan_phy_mode |
  13601. * word 12 | |
  13602. * |----------------------------------------------------------------|
  13603. * where,
  13604. * P - payload present bit (payload_present explained below)
  13605. * req_id - memory request id (mem_req_id explained below)
  13606. * S - status field (status explained below)
  13607. * capbw - capture bandwidth (capture_bw explained below)
  13608. * mode - mode of capture (mode explained below)
  13609. * sts - space time streams (sts_count explained below)
  13610. * chbw - channel bandwidth (channel_bw explained below)
  13611. * captype - capture type (cap_type explained below)
  13612. *
  13613. * The following field definitions describe the format of the CFR dump
  13614. * completion indication sent from the target to the host
  13615. *
  13616. * Header fields:
  13617. *
  13618. * Word 0
  13619. * - msg_type
  13620. * Bits 7:0
  13621. * Purpose: Identifies this as CFR TX completion indication
  13622. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13623. * - payload_present
  13624. * Bit 8
  13625. * Purpose: Identifies how CFR data is sent to host
  13626. * Value: 0 - If CFR Payload is written to host memory
  13627. * 1 - If CFR Payload is sent as part of HTT message
  13628. * (This is the requirement for SDIO/USB where it is
  13629. * not possible to write CFR data to host memory)
  13630. * - reserved
  13631. * Bits 31:9
  13632. * Purpose: Reserved
  13633. * Value: 0
  13634. *
  13635. * Payload fields:
  13636. *
  13637. * Word 1
  13638. * - cfr_capture_msg_type
  13639. * Bits 31:0
  13640. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13641. * to specify the format used for the remainder of the message
  13642. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13643. * (currently only MSG_TYPE_1 is defined)
  13644. *
  13645. * Word 2
  13646. * - mem_req_id
  13647. * Bits 6:0
  13648. * Purpose: Contain the mem request id of the region where the CFR capture
  13649. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13650. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13651. this value is invalid)
  13652. * - status
  13653. * Bit 7
  13654. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13655. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13656. * - capture_bw
  13657. * Bits 10:8
  13658. * Purpose: Carry the bandwidth of the CFR capture
  13659. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13660. * - mode
  13661. * Bits 13:11
  13662. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13663. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13664. * - sts_count
  13665. * Bits 16:14
  13666. * Purpose: Carry the number of space time streams
  13667. * Value: Number of space time streams
  13668. * - channel_bw
  13669. * Bits 19:17
  13670. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13671. * measurement
  13672. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13673. * - cap_type
  13674. * Bits 23:20
  13675. * Purpose: Carry the type of the capture
  13676. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13677. * - vdev_id
  13678. * Bits 31:24
  13679. * Purpose: Carry the virtual device id
  13680. * Value: vdev ID
  13681. *
  13682. * Word 3
  13683. * - mac_addr31to0
  13684. * Bits 31:0
  13685. * Purpose: Contain the bits 31:0 of the peer MAC address
  13686. * Value: Bits 31:0 of the peer MAC address
  13687. *
  13688. * Word 4
  13689. * - mac_addr47to32
  13690. * Bits 15:0
  13691. * Purpose: Contain the bits 47:32 of the peer MAC address
  13692. * Value: Bits 47:32 of the peer MAC address
  13693. *
  13694. * Word 5
  13695. * - index
  13696. * Bits 31:0
  13697. * Purpose: Contain the index at which this CFR dump was written in the Host
  13698. * allocated memory. This index is the number of bytes from the base address.
  13699. * Value: Index position
  13700. *
  13701. * Word 6
  13702. * - length
  13703. * Bits 31:0
  13704. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13705. * Value: Length of the CFR capture of the peer
  13706. *
  13707. * Word 7
  13708. * - timestamp
  13709. * Bits 31:0
  13710. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13711. * clock used for this timestamp is private to the target and not visible to
  13712. * the host i.e., Host can interpret only the relative timestamp deltas from
  13713. * one message to the next, but can't interpret the absolute timestamp from a
  13714. * single message.
  13715. * Value: Timestamp in microseconds
  13716. *
  13717. * Word 8
  13718. * - counter
  13719. * Bits 31:0
  13720. * Purpose: Carry the count of the current CFR capture from FW. This is
  13721. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13722. * in host memory)
  13723. * Value: Count of the current CFR capture
  13724. *
  13725. * Word 9
  13726. * - chan_mhz
  13727. * Bits 31:0
  13728. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13729. * Value: Primary 20 channel frequency
  13730. *
  13731. * Word 10
  13732. * - band_center_freq1
  13733. * Bits 31:0
  13734. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13735. * Value: Center frequency 1 in MHz
  13736. *
  13737. * Word 11
  13738. * - band_center_freq2
  13739. * Bits 31:0
  13740. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13741. * the VDEV
  13742. * 80plus80 mode
  13743. * Value: Center frequency 2 in MHz
  13744. *
  13745. * Word 12
  13746. * - chan_phy_mode
  13747. * Bits 31:0
  13748. * Purpose: Carry the phy mode of the channel, of the VDEV
  13749. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13750. */
  13751. PREPACK struct htt_cfr_dump_ind_type_1 {
  13752. A_UINT32 mem_req_id:7,
  13753. status:1,
  13754. capture_bw:3,
  13755. mode:3,
  13756. sts_count:3,
  13757. channel_bw:3,
  13758. cap_type:4,
  13759. vdev_id:8;
  13760. htt_mac_addr addr;
  13761. A_UINT32 index;
  13762. A_UINT32 length;
  13763. A_UINT32 timestamp;
  13764. A_UINT32 counter;
  13765. struct htt_chan_change_msg chan;
  13766. } POSTPACK;
  13767. PREPACK struct htt_cfr_dump_compl_ind {
  13768. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13769. union {
  13770. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13771. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13772. /* If there is a need to change the memory layout and its associated
  13773. * HTT indication format, a new CFR capture message type can be
  13774. * introduced and added into this union.
  13775. */
  13776. };
  13777. } POSTPACK;
  13778. /*
  13779. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13780. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13781. */
  13782. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13783. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13784. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13785. do { \
  13786. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13787. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13788. } while(0)
  13789. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13790. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13791. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13792. /*
  13793. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13794. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13795. */
  13796. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13797. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13798. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13799. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13800. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13803. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13804. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13805. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13806. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13807. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13808. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13809. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13810. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13811. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13812. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13813. do { \
  13814. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13815. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13816. } while (0)
  13817. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13818. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13819. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13820. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13821. do { \
  13822. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13823. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13824. } while (0)
  13825. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13826. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13827. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13828. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13829. do { \
  13830. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13831. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13832. } while (0)
  13833. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13834. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13835. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13836. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13837. do { \
  13838. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13839. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13840. } while (0)
  13841. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13842. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13843. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13844. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13845. do { \
  13846. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13847. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13848. } while (0)
  13849. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13850. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13851. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13852. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13853. do { \
  13854. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13855. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13856. } while (0)
  13857. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13858. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13859. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13860. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13861. do { \
  13862. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13863. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13864. } while (0)
  13865. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13866. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13867. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13868. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13869. do { \
  13870. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13871. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13872. } while (0)
  13873. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13874. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13875. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13876. /**
  13877. * @brief target -> host peer (PPDU) stats message
  13878. *
  13879. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13880. *
  13881. * @details
  13882. * This message is generated by FW when FW is sending stats to host
  13883. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13884. * This message is sent autonomously by the target rather than upon request
  13885. * by the host.
  13886. * The following field definitions describe the format of the HTT target
  13887. * to host peer stats indication message.
  13888. *
  13889. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13890. * or more PPDU stats records.
  13891. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13892. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13893. * then the message would start with the
  13894. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13895. * below.
  13896. *
  13897. * |31 16|15|14|13 11|10 9|8|7 0|
  13898. * |-------------------------------------------------------------|
  13899. * | reserved |MSG_TYPE |
  13900. * |-------------------------------------------------------------|
  13901. * rec 0 | TLV header |
  13902. * rec 0 |-------------------------------------------------------------|
  13903. * rec 0 | ppdu successful bytes |
  13904. * rec 0 |-------------------------------------------------------------|
  13905. * rec 0 | ppdu retry bytes |
  13906. * rec 0 |-------------------------------------------------------------|
  13907. * rec 0 | ppdu failed bytes |
  13908. * rec 0 |-------------------------------------------------------------|
  13909. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13910. * rec 0 |-------------------------------------------------------------|
  13911. * rec 0 | retried MSDUs | successful MSDUs |
  13912. * rec 0 |-------------------------------------------------------------|
  13913. * rec 0 | TX duration | failed MSDUs |
  13914. * rec 0 |-------------------------------------------------------------|
  13915. * ...
  13916. * |-------------------------------------------------------------|
  13917. * rec N | TLV header |
  13918. * rec N |-------------------------------------------------------------|
  13919. * rec N | ppdu successful bytes |
  13920. * rec N |-------------------------------------------------------------|
  13921. * rec N | ppdu retry bytes |
  13922. * rec N |-------------------------------------------------------------|
  13923. * rec N | ppdu failed bytes |
  13924. * rec N |-------------------------------------------------------------|
  13925. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13926. * rec N |-------------------------------------------------------------|
  13927. * rec N | retried MSDUs | successful MSDUs |
  13928. * rec N |-------------------------------------------------------------|
  13929. * rec N | TX duration | failed MSDUs |
  13930. * rec N |-------------------------------------------------------------|
  13931. *
  13932. * where:
  13933. * A = is A-MPDU flag
  13934. * BA = block-ack failure flags
  13935. * BW = bandwidth spec
  13936. * SG = SGI enabled spec
  13937. * S = skipped rate ctrl
  13938. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13939. *
  13940. * Header
  13941. * ------
  13942. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13943. * dword0 - b'8:31 - reserved : Reserved for future use
  13944. *
  13945. * payload include below peer_stats information
  13946. * --------------------------------------------
  13947. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13948. * @tx_success_bytes : total successful bytes in the PPDU.
  13949. * @tx_retry_bytes : total retried bytes in the PPDU.
  13950. * @tx_failed_bytes : total failed bytes in the PPDU.
  13951. * @tx_ratecode : rate code used for the PPDU.
  13952. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13953. * @ba_ack_failed : BA/ACK failed for this PPDU
  13954. * b00 -> BA received
  13955. * b01 -> BA failed once
  13956. * b10 -> BA failed twice, when HW retry is enabled.
  13957. * @bw : BW
  13958. * b00 -> 20 MHz
  13959. * b01 -> 40 MHz
  13960. * b10 -> 80 MHz
  13961. * b11 -> 160 MHz (or 80+80)
  13962. * @sg : SGI enabled
  13963. * @s : skipped ratectrl
  13964. * @peer_id : peer id
  13965. * @tx_success_msdus : successful MSDUs
  13966. * @tx_retry_msdus : retried MSDUs
  13967. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13968. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13969. */
  13970. /**
  13971. * @brief target -> host backpressure event
  13972. *
  13973. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13974. *
  13975. * @details
  13976. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13977. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13978. * This message will only be sent if the backpressure condition has existed
  13979. * continuously for an initial period (100 ms).
  13980. * Repeat messages with updated information will be sent after each
  13981. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13982. * This message indicates the ring id along with current head and tail index
  13983. * locations (i.e. write and read indices).
  13984. * The backpressure time indicates the time in ms for which continous
  13985. * backpressure has been observed in the ring.
  13986. *
  13987. * The message format is as follows:
  13988. *
  13989. * |31 24|23 16|15 8|7 0|
  13990. * |----------------+----------------+----------------+----------------|
  13991. * | ring_id | ring_type | pdev_id | msg_type |
  13992. * |-------------------------------------------------------------------|
  13993. * | tail_idx | head_idx |
  13994. * |-------------------------------------------------------------------|
  13995. * | backpressure_time_ms |
  13996. * |-------------------------------------------------------------------|
  13997. *
  13998. * The message is interpreted as follows:
  13999. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14000. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14001. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14002. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14003. the msg is for LMAC ring.
  14004. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14005. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14006. * htt_backpressure_lmac_ring_id. This represents
  14007. * the ring id for which continous backpressure is seen
  14008. *
  14009. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14010. * the ring indicated by the ring_id
  14011. *
  14012. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14013. * the ring indicated by the ring id
  14014. *
  14015. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14016. * backpressure has been seen in the ring
  14017. * indicated by the ring_id.
  14018. * Units = milliseconds
  14019. */
  14020. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14021. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14022. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14023. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14024. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14025. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14026. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14027. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14028. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14029. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14030. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14031. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14032. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14033. do { \
  14034. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14035. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14036. } while (0)
  14037. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14038. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14039. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14040. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14041. do { \
  14042. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14043. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14044. } while (0)
  14045. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14046. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14047. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14048. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14049. do { \
  14050. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14051. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14052. } while (0)
  14053. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14054. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14055. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14056. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14057. do { \
  14058. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14059. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14060. } while (0)
  14061. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14062. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14063. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14064. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14065. do { \
  14066. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14067. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14068. } while (0)
  14069. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14070. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14071. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14072. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14073. do { \
  14074. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14075. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14076. } while (0)
  14077. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14078. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14079. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14080. enum htt_backpressure_ring_type {
  14081. HTT_SW_RING_TYPE_UMAC,
  14082. HTT_SW_RING_TYPE_LMAC,
  14083. HTT_SW_RING_TYPE_MAX,
  14084. };
  14085. /* Ring id for which the message is sent to host */
  14086. enum htt_backpressure_umac_ringid {
  14087. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14088. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14089. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14090. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14091. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14092. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14093. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14094. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14095. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14096. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14097. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14098. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14099. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14100. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14101. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14102. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14103. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14104. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14105. HTT_SW_UMAC_RING_IDX_MAX,
  14106. };
  14107. enum htt_backpressure_lmac_ringid {
  14108. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14109. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14110. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14111. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14112. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14113. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14114. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14115. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14116. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14117. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14118. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14119. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14120. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14121. HTT_SW_LMAC_RING_IDX_MAX,
  14122. };
  14123. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14124. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14125. pdev_id: 8,
  14126. ring_type: 8, /* htt_backpressure_ring_type */
  14127. /*
  14128. * ring_id holds an enum value from either
  14129. * htt_backpressure_umac_ringid or
  14130. * htt_backpressure_lmac_ringid, based on
  14131. * the ring_type setting.
  14132. */
  14133. ring_id: 8;
  14134. A_UINT16 head_idx;
  14135. A_UINT16 tail_idx;
  14136. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14137. } POSTPACK;
  14138. /*
  14139. * Defines two 32 bit words that can be used by the target to indicate a per
  14140. * user RU allocation and rate information.
  14141. *
  14142. * This information is currently provided in the "sw_response_reference_ptr"
  14143. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14144. * "rx_ppdu_end_user_stats" TLV.
  14145. *
  14146. * VALID:
  14147. * The consumer of these words must explicitly check the valid bit,
  14148. * and only attempt interpretation of any of the remaining fields if
  14149. * the valid bit is set to 1.
  14150. *
  14151. * VERSION:
  14152. * The consumer of these words must also explicitly check the version bit,
  14153. * and only use the V0 definition if the VERSION field is set to 0.
  14154. *
  14155. * Version 1 is currently undefined, with the exception of the VALID and
  14156. * VERSION fields.
  14157. *
  14158. * Version 0:
  14159. *
  14160. * The fields below are duplicated per BW.
  14161. *
  14162. * The consumer must determine which BW field to use, based on the UL OFDMA
  14163. * PPDU BW indicated by HW.
  14164. *
  14165. * RU_START: RU26 start index for the user.
  14166. * Note that this is always using the RU26 index, regardless
  14167. * of the actual RU assigned to the user
  14168. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14169. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14170. *
  14171. * For example, 20MHz (the value in the top row is RU_START)
  14172. *
  14173. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14174. * RU Size 1 (52): | | | | | |
  14175. * RU Size 2 (106): | | | |
  14176. * RU Size 3 (242): | |
  14177. *
  14178. * RU_SIZE: Indicates the RU size, as defined by enum
  14179. * htt_ul_ofdma_user_info_ru_size.
  14180. *
  14181. * LDPC: LDPC enabled (if 0, BCC is used)
  14182. *
  14183. * DCM: DCM enabled
  14184. *
  14185. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14186. * |---------------------------------+--------------------------------|
  14187. * |Ver|Valid| FW internal |
  14188. * |---------------------------------+--------------------------------|
  14189. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14190. * |---------------------------------+--------------------------------|
  14191. */
  14192. enum htt_ul_ofdma_user_info_ru_size {
  14193. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14194. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14195. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14196. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14197. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14198. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14199. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14200. };
  14201. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14202. struct htt_ul_ofdma_user_info_v0 {
  14203. A_UINT32 word0;
  14204. A_UINT32 word1;
  14205. };
  14206. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14207. A_UINT32 w0_fw_rsvd:30; \
  14208. A_UINT32 w0_valid:1; \
  14209. A_UINT32 w0_version:1;
  14210. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14211. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14212. };
  14213. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14214. A_UINT32 w1_nss:3; \
  14215. A_UINT32 w1_mcs:4; \
  14216. A_UINT32 w1_ldpc:1; \
  14217. A_UINT32 w1_dcm:1; \
  14218. A_UINT32 w1_ru_start:7; \
  14219. A_UINT32 w1_ru_size:3; \
  14220. A_UINT32 w1_trig_type:4; \
  14221. A_UINT32 w1_unused:9;
  14222. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14223. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14224. };
  14225. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14226. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14227. union {
  14228. A_UINT32 word0;
  14229. struct {
  14230. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14231. };
  14232. };
  14233. union {
  14234. A_UINT32 word1;
  14235. struct {
  14236. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14237. };
  14238. };
  14239. } POSTPACK;
  14240. enum HTT_UL_OFDMA_TRIG_TYPE {
  14241. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14242. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14243. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14244. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14245. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14246. };
  14247. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14248. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14249. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14250. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14251. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14261. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14263. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14264. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14265. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14266. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14267. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14268. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14269. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14270. /*--- word 0 ---*/
  14271. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14272. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14273. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14274. do { \
  14275. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14276. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14277. } while (0)
  14278. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14279. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14280. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14281. do { \
  14282. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14283. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14284. } while (0)
  14285. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14286. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14287. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14288. do { \
  14289. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14290. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14291. } while (0)
  14292. /*--- word 1 ---*/
  14293. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14294. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14295. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14296. do { \
  14297. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14298. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14299. } while (0)
  14300. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14301. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14302. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14303. do { \
  14304. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14305. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14306. } while (0)
  14307. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14308. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14309. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14310. do { \
  14311. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14312. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14313. } while (0)
  14314. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14315. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14316. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14317. do { \
  14318. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14319. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14320. } while (0)
  14321. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14322. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14323. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14324. do { \
  14325. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14326. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14327. } while (0)
  14328. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14329. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14330. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14331. do { \
  14332. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14333. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14334. } while (0)
  14335. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14336. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14337. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14338. do { \
  14339. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14340. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14341. } while (0)
  14342. /**
  14343. * @brief target -> host channel calibration data message
  14344. *
  14345. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14346. *
  14347. * @brief host -> target channel calibration data message
  14348. *
  14349. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14350. *
  14351. * @details
  14352. * The following field definitions describe the format of the channel
  14353. * calibration data message sent from the target to the host when
  14354. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14355. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14356. * The message is defined as htt_chan_caldata_msg followed by a variable
  14357. * number of 32-bit character values.
  14358. *
  14359. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14360. * |------------------------------------------------------------------|
  14361. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14362. * |------------------------------------------------------------------|
  14363. * | payload size | mhz |
  14364. * |------------------------------------------------------------------|
  14365. * | center frequency 2 | center frequency 1 |
  14366. * |------------------------------------------------------------------|
  14367. * | check sum |
  14368. * |------------------------------------------------------------------|
  14369. * | payload |
  14370. * |------------------------------------------------------------------|
  14371. * message info field:
  14372. * - MSG_TYPE
  14373. * Bits 7:0
  14374. * Purpose: identifies this as a channel calibration data message
  14375. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14376. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14377. * - SUB_TYPE
  14378. * Bits 11:8
  14379. * Purpose: T2H: indicates whether target is providing chan cal data
  14380. * to the host to store, or requesting that the host
  14381. * download previously-stored data.
  14382. * H2T: indicates whether the host is providing the requested
  14383. * channel cal data, or if it is rejecting the data
  14384. * request because it does not have the requested data.
  14385. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14386. * - CHKSUM_VALID
  14387. * Bit 12
  14388. * Purpose: indicates if the checksum field is valid
  14389. * value:
  14390. * - FRAG
  14391. * Bit 19:16
  14392. * Purpose: indicates the fragment index for message
  14393. * value: 0 for first fragment, 1 for second fragment, ...
  14394. * - APPEND
  14395. * Bit 20
  14396. * Purpose: indicates if this is the last fragment
  14397. * value: 0 = final fragment, 1 = more fragments will be appended
  14398. *
  14399. * channel and payload size field
  14400. * - MHZ
  14401. * Bits 15:0
  14402. * Purpose: indicates the channel primary frequency
  14403. * Value:
  14404. * - PAYLOAD_SIZE
  14405. * Bits 31:16
  14406. * Purpose: indicates the bytes of calibration data in payload
  14407. * Value:
  14408. *
  14409. * center frequency field
  14410. * - CENTER FREQUENCY 1
  14411. * Bits 15:0
  14412. * Purpose: indicates the channel center frequency
  14413. * Value: channel center frequency, in MHz units
  14414. * - CENTER FREQUENCY 2
  14415. * Bits 31:16
  14416. * Purpose: indicates the secondary channel center frequency,
  14417. * only for 11acvht 80plus80 mode
  14418. * Value: secondary channel center frequeny, in MHz units, if applicable
  14419. *
  14420. * checksum field
  14421. * - CHECK_SUM
  14422. * Bits 31:0
  14423. * Purpose: check the payload data, it is just for this fragment.
  14424. * This is intended for the target to check that the channel
  14425. * calibration data returned by the host is the unmodified data
  14426. * that was previously provided to the host by the target.
  14427. * value: checksum of fragment payload
  14428. */
  14429. PREPACK struct htt_chan_caldata_msg {
  14430. /* DWORD 0: message info */
  14431. A_UINT32
  14432. msg_type: 8,
  14433. sub_type: 4 ,
  14434. chksum_valid: 1, /** 1:valid, 0:invalid */
  14435. reserved1: 3,
  14436. frag_idx: 4, /** fragment index for calibration data */
  14437. appending: 1, /** 0: no fragment appending,
  14438. * 1: extra fragment appending */
  14439. reserved2: 11;
  14440. /* DWORD 1: channel and payload size */
  14441. A_UINT32
  14442. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14443. payload_size: 16; /** unit: bytes */
  14444. /* DWORD 2: center frequency */
  14445. A_UINT32
  14446. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14447. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14448. * valid only for 11acvht 80plus80 mode */
  14449. /* DWORD 3: check sum */
  14450. A_UINT32 chksum;
  14451. /* variable length for calibration data */
  14452. A_UINT32 payload[1/* or more */];
  14453. } POSTPACK;
  14454. /* T2H SUBTYPE */
  14455. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14456. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14457. /* H2T SUBTYPE */
  14458. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14459. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14460. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14461. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14462. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14463. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14464. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14465. do { \
  14466. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14467. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14468. } while (0)
  14469. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14470. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14471. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14472. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14473. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14474. do { \
  14475. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14476. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14477. } while (0)
  14478. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14479. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14480. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14481. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14482. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14483. do { \
  14484. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14485. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14486. } while (0)
  14487. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14488. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14489. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14490. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14491. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14492. do { \
  14493. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14494. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14495. } while (0)
  14496. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14497. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14498. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14499. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14500. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14501. do { \
  14502. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14503. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14504. } while (0)
  14505. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14506. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14507. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14508. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14509. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14510. do { \
  14511. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14512. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14513. } while (0)
  14514. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14515. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14516. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14517. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14518. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14519. do { \
  14520. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14521. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14522. } while (0)
  14523. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14524. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14525. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14526. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14527. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14528. do { \
  14529. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14530. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14531. } while (0)
  14532. /**
  14533. * @brief target -> host FSE CMEM based send
  14534. *
  14535. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14536. *
  14537. * @details
  14538. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14539. * FSE placement in CMEM is enabled.
  14540. *
  14541. * This message sends the non-secure CMEM base address.
  14542. * It will be sent to host in response to message
  14543. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14544. * The message would appear as follows:
  14545. *
  14546. * |31 24|23 16|15 8|7 0|
  14547. * |----------------+----------------+----------------+----------------|
  14548. * | reserved | num_entries | msg_type |
  14549. * |----------------+----------------+----------------+----------------|
  14550. * | base_address_lo |
  14551. * |----------------+----------------+----------------+----------------|
  14552. * | base_address_hi |
  14553. * |-------------------------------------------------------------------|
  14554. *
  14555. * The message is interpreted as follows:
  14556. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14557. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14558. * b'8:15 - number_entries: Indicated the number of entries
  14559. * programmed.
  14560. * b'16:31 - reserved.
  14561. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14562. * CMEM base address
  14563. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14564. * CMEM base address
  14565. */
  14566. PREPACK struct htt_cmem_base_send_t {
  14567. A_UINT32 msg_type: 8,
  14568. num_entries: 8,
  14569. reserved: 16;
  14570. A_UINT32 base_address_lo;
  14571. A_UINT32 base_address_hi;
  14572. } POSTPACK;
  14573. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14574. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14575. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14576. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14577. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14578. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14579. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14580. do { \
  14581. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14582. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14583. } while (0)
  14584. /**
  14585. * @brief - HTT PPDU ID format
  14586. *
  14587. * @details
  14588. * The following field definitions describe the format of the PPDU ID.
  14589. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14590. *
  14591. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14592. * +--------------------------------------------------------------------------
  14593. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14594. * +--------------------------------------------------------------------------
  14595. *
  14596. * sch id :Schedule command id
  14597. * Bits [11 : 0] : monotonically increasing counter to track the
  14598. * PPDU posted to a specific transmit queue.
  14599. *
  14600. * hwq_id: Hardware Queue ID.
  14601. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14602. *
  14603. * mac_id: MAC ID
  14604. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14605. *
  14606. * seq_idx: Sequence index.
  14607. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14608. * a particular TXOP.
  14609. *
  14610. * tqm_cmd: HWSCH/TQM flag.
  14611. * Bit [23] : Always set to 0.
  14612. *
  14613. * seq_cmd_type: Sequence command type.
  14614. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14615. * Refer to enum HTT_STATS_FTYPE for values.
  14616. */
  14617. PREPACK struct htt_ppdu_id {
  14618. A_UINT32
  14619. sch_id: 12,
  14620. hwq_id: 5,
  14621. mac_id: 2,
  14622. seq_idx: 2,
  14623. reserved1: 2,
  14624. tqm_cmd: 1,
  14625. seq_cmd_type: 6,
  14626. reserved2: 2;
  14627. } POSTPACK;
  14628. #define HTT_PPDU_ID_SCH_ID_S 0
  14629. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14630. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14631. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14632. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14633. do { \
  14634. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14635. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14636. } while (0)
  14637. #define HTT_PPDU_ID_HWQ_ID_S 12
  14638. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14639. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14640. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14641. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14642. do { \
  14643. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14644. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14645. } while (0)
  14646. #define HTT_PPDU_ID_MAC_ID_S 17
  14647. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14648. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14649. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14650. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14651. do { \
  14652. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14653. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14654. } while (0)
  14655. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14656. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14657. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14658. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14659. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14660. do { \
  14661. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14662. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14663. } while (0)
  14664. #define HTT_PPDU_ID_TQM_CMD_S 23
  14665. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14666. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14667. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14668. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14669. do { \
  14670. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14671. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14672. } while (0)
  14673. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14674. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14675. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14676. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14677. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14678. do { \
  14679. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14680. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14681. } while (0)
  14682. /**
  14683. * @brief target -> RX PEER METADATA V0 format
  14684. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14685. * message from target, and will confirm to the target which peer metadata
  14686. * version to use in the wmi_init message.
  14687. *
  14688. * The following diagram shows the format of the RX PEER METADATA.
  14689. *
  14690. * |31 24|23 16|15 8|7 0|
  14691. * |-----------------------------------------------------------------------|
  14692. * | Reserved | VDEV ID | PEER ID |
  14693. * |-----------------------------------------------------------------------|
  14694. */
  14695. PREPACK struct htt_rx_peer_metadata_v0 {
  14696. A_UINT32
  14697. peer_id: 16,
  14698. vdev_id: 8,
  14699. reserved1: 8;
  14700. } POSTPACK;
  14701. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14702. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14703. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14704. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14705. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14706. do { \
  14707. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14708. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14709. } while (0)
  14710. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14711. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14712. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14713. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14714. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14715. do { \
  14716. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14717. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14718. } while (0)
  14719. /**
  14720. * @brief target -> RX PEER METADATA V1 format
  14721. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14722. * message from target, and will confirm to the target which peer metadata
  14723. * version to use in the wmi_init message.
  14724. *
  14725. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14726. *
  14727. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14728. * |-----------------------------------------------------------------------|
  14729. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14730. * |-----------------------------------------------------------------------|
  14731. */
  14732. PREPACK struct htt_rx_peer_metadata_v1 {
  14733. A_UINT32
  14734. peer_id: 13,
  14735. ml_peer_valid: 1,
  14736. reserved1: 2,
  14737. vdev_id: 8,
  14738. lmac_id: 2,
  14739. chip_id: 3,
  14740. reserved2: 3;
  14741. } POSTPACK;
  14742. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14743. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14744. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14745. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14746. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14747. do { \
  14748. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14749. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14750. } while (0)
  14751. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14752. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14753. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14754. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14755. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14756. do { \
  14757. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14758. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14759. } while (0)
  14760. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14761. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14762. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14763. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14764. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14765. do { \
  14766. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14767. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14768. } while (0)
  14769. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14770. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14771. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14772. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14773. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14774. do { \
  14775. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14776. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14777. } while (0)
  14778. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14779. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14780. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14781. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14782. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14783. do { \
  14784. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14785. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14786. } while (0)
  14787. /*
  14788. * In some systems, the host SW wants to specify priorities between
  14789. * different MSDU / flow queues within the same peer-TID.
  14790. * The below enums are used for the host to identify to the target
  14791. * which MSDU queue's priority it wants to adjust.
  14792. */
  14793. /*
  14794. * The MSDUQ index describe index of TCL HW, where each index is
  14795. * used for queuing particular types of MSDUs.
  14796. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14797. */
  14798. enum HTT_MSDUQ_INDEX {
  14799. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14800. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14801. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14802. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14803. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14804. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14805. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14806. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14807. HTT_MSDUQ_MAX_INDEX,
  14808. };
  14809. /* MSDU qtype definition */
  14810. enum HTT_MSDU_QTYPE {
  14811. /*
  14812. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14813. * relative priority. Instead, the relative priority of CRIT_0 versus
  14814. * CRIT_1 is controlled by the FW, through the configuration parameters
  14815. * it applies to the queues.
  14816. */
  14817. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14818. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14819. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14820. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14821. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14822. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  14823. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  14824. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  14825. /* New MSDU_QTYPE should be added above this line */
  14826. /*
  14827. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14828. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14829. * any host/target message definitions. The QTYPE_MAX value can
  14830. * only be used internally within the host or within the target.
  14831. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14832. * it must regard the unexpected value as a default qtype value,
  14833. * or ignore it.
  14834. */
  14835. HTT_MSDU_QTYPE_MAX,
  14836. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14837. };
  14838. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14839. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14840. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14841. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14842. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14843. };
  14844. /**
  14845. * @brief target -> host mlo timestamp offset indication
  14846. *
  14847. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14848. *
  14849. * @details
  14850. * The following field definitions describe the format of the HTT target
  14851. * to host mlo timestamp offset indication message.
  14852. *
  14853. *
  14854. * |31 16|15 12|11 10|9 8|7 0 |
  14855. * |----------------------------------------------------------------------|
  14856. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14857. * |----------------------------------------------------------------------|
  14858. * | Sync time stamp lo in us |
  14859. * |----------------------------------------------------------------------|
  14860. * | Sync time stamp hi in us |
  14861. * |----------------------------------------------------------------------|
  14862. * | mlo time stamp offset lo in us |
  14863. * |----------------------------------------------------------------------|
  14864. * | mlo time stamp offset hi in us |
  14865. * |----------------------------------------------------------------------|
  14866. * | mlo time stamp offset clocks in clock ticks |
  14867. * |----------------------------------------------------------------------|
  14868. * |31 26|25 16|15 0 |
  14869. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14870. * | | compensation in clks | |
  14871. * |----------------------------------------------------------------------|
  14872. * |31 22|21 0 |
  14873. * | rsvd 3 | mlo time stamp comp timer period |
  14874. * |----------------------------------------------------------------------|
  14875. * The message is interpreted as follows:
  14876. *
  14877. * dword0 - b'0:7 - msg_type: This will be set to
  14878. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14879. * value: 0x28
  14880. *
  14881. * dword0 - b'9:8 - pdev_id
  14882. *
  14883. * dword0 - b'11:10 - chip_id
  14884. *
  14885. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14886. *
  14887. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14888. *
  14889. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14890. * which last sync interrupt was received
  14891. *
  14892. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14893. * which last sync interrupt was received
  14894. *
  14895. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14896. *
  14897. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14898. *
  14899. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14900. *
  14901. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14902. *
  14903. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14904. * for sub us resolution
  14905. *
  14906. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14907. *
  14908. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14909. * is applied, in us
  14910. *
  14911. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14912. */
  14913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14914. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14915. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14917. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14918. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14919. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14920. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14922. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14923. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14924. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14925. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14926. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14927. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14928. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14929. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14930. do { \
  14931. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14932. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14933. } while (0)
  14934. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14935. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14936. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14937. do { \
  14938. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14939. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14940. } while (0)
  14941. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14942. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14943. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14944. do { \
  14945. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14946. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14947. } while (0)
  14948. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14949. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14950. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14951. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14952. do { \
  14953. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14954. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14955. } while (0)
  14956. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14957. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14958. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14959. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14960. do { \
  14961. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14962. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14963. } while (0)
  14964. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14965. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14966. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14967. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14968. do { \
  14969. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14970. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14971. } while (0)
  14972. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14973. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14974. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14975. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14976. do { \
  14977. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14978. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14979. } while (0)
  14980. typedef struct {
  14981. A_UINT32 msg_type: 8, /* bits 7:0 */
  14982. pdev_id: 2, /* bits 9:8 */
  14983. chip_id: 2, /* bits 11:10 */
  14984. reserved1: 4, /* bits 15:12 */
  14985. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14986. A_UINT32 sync_timestamp_lo_us;
  14987. A_UINT32 sync_timestamp_hi_us;
  14988. A_UINT32 mlo_timestamp_offset_lo_us;
  14989. A_UINT32 mlo_timestamp_offset_hi_us;
  14990. A_UINT32 mlo_timestamp_offset_clks;
  14991. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14992. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14993. reserved2: 6; /* bits 31:26 */
  14994. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14995. reserved3: 10; /* bits 31:22 */
  14996. } htt_t2h_mlo_offset_ind_t;
  14997. /*
  14998. * @brief target -> host VDEV TX RX STATS
  14999. *
  15000. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15001. *
  15002. * @details
  15003. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15004. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15005. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15006. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15007. * periodically by target even in the absence of any further HTT request
  15008. * messages from host.
  15009. *
  15010. * The message is formatted as follows:
  15011. *
  15012. * |31 16|15 8|7 0|
  15013. * |---------------------------------+----------------+----------------|
  15014. * | payload_size | pdev_id | msg_type |
  15015. * |---------------------------------+----------------+----------------|
  15016. * | reserved0 |
  15017. * |-------------------------------------------------------------------|
  15018. * | reserved1 |
  15019. * |-------------------------------------------------------------------|
  15020. * | reserved2 |
  15021. * |-------------------------------------------------------------------|
  15022. * | |
  15023. * | VDEV specific Tx Rx stats info |
  15024. * | |
  15025. * |-------------------------------------------------------------------|
  15026. *
  15027. * The message is interpreted as follows:
  15028. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15029. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15030. * b'8:15 - pdev_id
  15031. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15032. * message header fields (msg_type through reserved2)
  15033. * dword1 - b'0:31 - reserved0.
  15034. * dword2 - b'0:31 - reserved1.
  15035. * dword3 - b'0:31 - reserved2.
  15036. */
  15037. typedef struct {
  15038. A_UINT32 msg_type: 8,
  15039. pdev_id: 8,
  15040. payload_size: 16;
  15041. A_UINT32 reserved0;
  15042. A_UINT32 reserved1;
  15043. A_UINT32 reserved2;
  15044. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15045. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15046. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15047. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15048. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15049. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15050. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15051. do { \
  15052. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15053. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15054. } while (0)
  15055. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15056. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15057. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15058. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15059. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15060. do { \
  15061. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15062. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15063. } while (0)
  15064. /* SOC related stats */
  15065. typedef struct {
  15066. htt_tlv_hdr_t tlv_hdr;
  15067. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15068. * This can be due to either the peer is deleted or deletion is ongoing
  15069. * */
  15070. A_UINT32 inv_peers_msdu_drop_count_lo;
  15071. A_UINT32 inv_peers_msdu_drop_count_hi;
  15072. } htt_t2h_soc_txrx_stats_common_tlv;
  15073. /* VDEV HW Tx/Rx stats */
  15074. typedef struct {
  15075. htt_tlv_hdr_t tlv_hdr;
  15076. A_UINT32 vdev_id;
  15077. /* Rx msdu byte cnt */
  15078. A_UINT32 rx_msdu_byte_cnt_lo;
  15079. A_UINT32 rx_msdu_byte_cnt_hi;
  15080. /* Rx msdu cnt */
  15081. A_UINT32 rx_msdu_cnt_lo;
  15082. A_UINT32 rx_msdu_cnt_hi;
  15083. /* tx msdu byte cnt */
  15084. A_UINT32 tx_msdu_byte_cnt_lo;
  15085. A_UINT32 tx_msdu_byte_cnt_hi;
  15086. /* tx msdu cnt */
  15087. A_UINT32 tx_msdu_cnt_lo;
  15088. A_UINT32 tx_msdu_cnt_hi;
  15089. /* tx excessive retry discarded msdu cnt*/
  15090. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15091. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15092. /* TX congestion ctrl msdu drop cnt */
  15093. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15094. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15095. /* discarded tx msdus cnt coz of time to live expiry */
  15096. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15097. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15098. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15099. #endif