htt.h 764 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714
  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_MAX_TAG,
  637. } htt_tlv_tag_t;
  638. #define HTT_STATS_TLV_TAG_M 0x00000fff
  639. #define HTT_STATS_TLV_TAG_S 0
  640. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  641. #define HTT_STATS_TLV_LENGTH_S 12
  642. #define HTT_STATS_TLV_TAG_GET(_var) \
  643. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  644. HTT_STATS_TLV_TAG_S)
  645. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  646. do { \
  647. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  648. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  649. } while (0)
  650. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  651. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  652. HTT_STATS_TLV_LENGTH_S)
  653. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  654. do { \
  655. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  656. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  657. } while (0)
  658. /*=== host -> target messages ===============================================*/
  659. enum htt_h2t_msg_type {
  660. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  661. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  662. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  663. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  664. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  665. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  666. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  667. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  668. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  669. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  670. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  671. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  672. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  673. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  674. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  675. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  676. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  677. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  678. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  679. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  680. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  681. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  682. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  683. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  684. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  685. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  686. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  687. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  688. /* keep this last */
  689. HTT_H2T_NUM_MSGS
  690. };
  691. /*
  692. * HTT host to target message type -
  693. * stored in bits 7:0 of the first word of the message
  694. */
  695. #define HTT_H2T_MSG_TYPE_M 0xff
  696. #define HTT_H2T_MSG_TYPE_S 0
  697. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  698. do { \
  699. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  700. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  701. } while (0)
  702. #define HTT_H2T_MSG_TYPE_GET(word) \
  703. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  704. /**
  705. * @brief host -> target version number request message definition
  706. *
  707. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  708. *
  709. *
  710. * |31 24|23 16|15 8|7 0|
  711. * |----------------+----------------+----------------+----------------|
  712. * | reserved | msg type |
  713. * |-------------------------------------------------------------------|
  714. * : option request TLV (optional) |
  715. * :...................................................................:
  716. *
  717. * The VER_REQ message may consist of a single 4-byte word, or may be
  718. * extended with TLVs that specify which HTT options the host is requesting
  719. * from the target.
  720. * The following option TLVs may be appended to the VER_REQ message:
  721. * - HL_SUPPRESS_TX_COMPL_IND
  722. * - HL_MAX_TX_QUEUE_GROUPS
  723. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  724. * may be appended to the VER_REQ message (but only one TLV of each type).
  725. *
  726. * Header fields:
  727. * - MSG_TYPE
  728. * Bits 7:0
  729. * Purpose: identifies this as a version number request message
  730. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  731. */
  732. #define HTT_VER_REQ_BYTES 4
  733. /* TBDXXX: figure out a reasonable number */
  734. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  735. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  736. /**
  737. * @brief HTT tx MSDU descriptor
  738. *
  739. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  740. *
  741. * @details
  742. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  743. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  744. * the target firmware needs for the FW's tx processing, particularly
  745. * for creating the HW msdu descriptor.
  746. * The same HTT tx descriptor is used for HL and LL systems, though
  747. * a few fields within the tx descriptor are used only by LL or
  748. * only by HL.
  749. * The HTT tx descriptor is defined in two manners: by a struct with
  750. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  751. * definitions.
  752. * The target should use the struct def, for simplicitly and clarity,
  753. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  754. * neutral. Specifically, the host shall use the get/set macros built
  755. * around the mask + shift defs.
  756. */
  757. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  758. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  759. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  760. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  761. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  764. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  765. #define HTT_TX_VDEV_ID_WORD 0
  766. #define HTT_TX_VDEV_ID_MASK 0x3f
  767. #define HTT_TX_VDEV_ID_SHIFT 16
  768. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  769. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  770. #define HTT_TX_MSDU_LEN_DWORD 1
  771. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  772. /*
  773. * HTT_VAR_PADDR macros
  774. * Allow physical / bus addresses to be either a single 32-bit value,
  775. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  776. */
  777. #define HTT_VAR_PADDR32(var_name) \
  778. A_UINT32 var_name
  779. #define HTT_VAR_PADDR64_LE(var_name) \
  780. struct { \
  781. /* little-endian: lo precedes hi */ \
  782. A_UINT32 lo; \
  783. A_UINT32 hi; \
  784. } var_name
  785. /*
  786. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  787. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  788. * addresses are stored in a XXX-bit field.
  789. * This macro is used to define both htt_tx_msdu_desc32_t and
  790. * htt_tx_msdu_desc64_t structs.
  791. */
  792. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  793. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  794. { \
  795. /* DWORD 0: flags and meta-data */ \
  796. A_UINT32 \
  797. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  798. \
  799. /* pkt_subtype - \
  800. * Detailed specification of the tx frame contents, extending the \
  801. * general specification provided by pkt_type. \
  802. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  803. * pkt_type | pkt_subtype \
  804. * ============================================================== \
  805. * 802.3 | bit 0:3 - Reserved \
  806. * | bit 4: 0x0 - Copy-Engine Classification Results \
  807. * | not appended to the HTT message \
  808. * | 0x1 - Copy-Engine Classification Results \
  809. * | appended to the HTT message in the \
  810. * | format: \
  811. * | [HTT tx desc, frame header, \
  812. * | CE classification results] \
  813. * | The CE classification results begin \
  814. * | at the next 4-byte boundary after \
  815. * | the frame header. \
  816. * ------------+------------------------------------------------- \
  817. * Eth2 | bit 0:3 - Reserved \
  818. * | bit 4: 0x0 - Copy-Engine Classification Results \
  819. * | not appended to the HTT message \
  820. * | 0x1 - Copy-Engine Classification Results \
  821. * | appended to the HTT message. \
  822. * | See the above specification of the \
  823. * | CE classification results location. \
  824. * ------------+------------------------------------------------- \
  825. * native WiFi | bit 0:3 - Reserved \
  826. * | bit 4: 0x0 - Copy-Engine Classification Results \
  827. * | not appended to the HTT message \
  828. * | 0x1 - Copy-Engine Classification Results \
  829. * | appended to the HTT message. \
  830. * | See the above specification of the \
  831. * | CE classification results location. \
  832. * ------------+------------------------------------------------- \
  833. * mgmt | 0x0 - 802.11 MAC header absent \
  834. * | 0x1 - 802.11 MAC header present \
  835. * ------------+------------------------------------------------- \
  836. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  837. * | 0x1 - 802.11 MAC header present \
  838. * | bit 1: 0x0 - allow aggregation \
  839. * | 0x1 - don't allow aggregation \
  840. * | bit 2: 0x0 - perform encryption \
  841. * | 0x1 - don't perform encryption \
  842. * | bit 3: 0x0 - perform tx classification / queuing \
  843. * | 0x1 - don't perform tx classification; \
  844. * | insert the frame into the "misc" \
  845. * | tx queue \
  846. * | bit 4: 0x0 - Copy-Engine Classification Results \
  847. * | not appended to the HTT message \
  848. * | 0x1 - Copy-Engine Classification Results \
  849. * | appended to the HTT message. \
  850. * | See the above specification of the \
  851. * | CE classification results location. \
  852. */ \
  853. pkt_subtype: 5, \
  854. \
  855. /* pkt_type - \
  856. * General specification of the tx frame contents. \
  857. * The htt_pkt_type enum should be used to specify and check the \
  858. * value of this field. \
  859. */ \
  860. pkt_type: 3, \
  861. \
  862. /* vdev_id - \
  863. * ID for the vdev that is sending this tx frame. \
  864. * For certain non-standard packet types, e.g. pkt_type == raw \
  865. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  866. * This field is used primarily for determining where to queue \
  867. * broadcast and multicast frames. \
  868. */ \
  869. vdev_id: 6, \
  870. /* ext_tid - \
  871. * The extended traffic ID. \
  872. * If the TID is unknown, the extended TID is set to \
  873. * HTT_TX_EXT_TID_INVALID. \
  874. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  875. * value of the QoS TID. \
  876. * If the tx frame is non-QoS data, then the extended TID is set to \
  877. * HTT_TX_EXT_TID_NON_QOS. \
  878. * If the tx frame is multicast or broadcast, then the extended TID \
  879. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  880. */ \
  881. ext_tid: 5, \
  882. \
  883. /* postponed - \
  884. * This flag indicates whether the tx frame has been downloaded to \
  885. * the target before but discarded by the target, and now is being \
  886. * downloaded again; or if this is a new frame that is being \
  887. * downloaded for the first time. \
  888. * This flag allows the target to determine the correct order for \
  889. * transmitting new vs. old frames. \
  890. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  891. * This flag only applies to HL systems, since in LL systems, \
  892. * the tx flow control is handled entirely within the target. \
  893. */ \
  894. postponed: 1, \
  895. \
  896. /* extension - \
  897. * This flag indicates whether a HTT tx MSDU extension descriptor \
  898. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  899. * \
  900. * 0x0 - no extension MSDU descriptor is present \
  901. * 0x1 - an extension MSDU descriptor immediately follows the \
  902. * regular MSDU descriptor \
  903. */ \
  904. extension: 1, \
  905. \
  906. /* cksum_offload - \
  907. * This flag indicates whether checksum offload is enabled or not \
  908. * for this frame. Target FW use this flag to turn on HW checksumming \
  909. * 0x0 - No checksum offload \
  910. * 0x1 - L3 header checksum only \
  911. * 0x2 - L4 checksum only \
  912. * 0x3 - L3 header checksum + L4 checksum \
  913. */ \
  914. cksum_offload: 2, \
  915. \
  916. /* tx_comp_req - \
  917. * This flag indicates whether Tx Completion \
  918. * from fw is required or not. \
  919. * This flag is only relevant if tx completion is not \
  920. * universally enabled. \
  921. * For all LL systems, tx completion is mandatory, \
  922. * so this flag will be irrelevant. \
  923. * For HL systems tx completion is optional, but HL systems in which \
  924. * the bus throughput exceeds the WLAN throughput will \
  925. * probably want to always use tx completion, and thus \
  926. * would not check this flag. \
  927. * This flag is required when tx completions are not used universally, \
  928. * but are still required for certain tx frames for which \
  929. * an OTA delivery acknowledgment is needed by the host. \
  930. * In practice, this would be for HL systems in which the \
  931. * bus throughput is less than the WLAN throughput. \
  932. * \
  933. * 0x0 - Tx Completion Indication from Fw not required \
  934. * 0x1 - Tx Completion Indication from Fw is required \
  935. */ \
  936. tx_compl_req: 1; \
  937. \
  938. \
  939. /* DWORD 1: MSDU length and ID */ \
  940. A_UINT32 \
  941. len: 16, /* MSDU length, in bytes */ \
  942. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  943. * and this id is used to calculate fragmentation \
  944. * descriptor pointer inside the target based on \
  945. * the base address, configured inside the target. \
  946. */ \
  947. \
  948. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  949. /* frags_desc_ptr - \
  950. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  951. * where the tx frame's fragments reside in memory. \
  952. * This field only applies to LL systems, since in HL systems the \
  953. * (degenerate single-fragment) fragmentation descriptor is created \
  954. * within the target. \
  955. */ \
  956. _paddr__frags_desc_ptr_; \
  957. \
  958. /* DWORD 3 (or 4): peerid, chanfreq */ \
  959. /* \
  960. * Peer ID : Target can use this value to know which peer-id packet \
  961. * destined to. \
  962. * It's intended to be specified by host in case of NAWDS. \
  963. */ \
  964. A_UINT16 peerid; \
  965. \
  966. /* \
  967. * Channel frequency: This identifies the desired channel \
  968. * frequency (in mhz) for tx frames. This is used by FW to help \
  969. * determine when it is safe to transmit or drop frames for \
  970. * off-channel operation. \
  971. * The default value of zero indicates to FW that the corresponding \
  972. * VDEV's home channel (if there is one) is the desired channel \
  973. * frequency. \
  974. */ \
  975. A_UINT16 chanfreq; \
  976. \
  977. /* Reason reserved is commented is increasing the htt structure size \
  978. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  979. * A_UINT32 reserved_dword3_bits0_31; \
  980. */ \
  981. } POSTPACK
  982. /* define a htt_tx_msdu_desc32_t type */
  983. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  984. /* define a htt_tx_msdu_desc64_t type */
  985. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  986. /*
  987. * Make htt_tx_msdu_desc_t be an alias for either
  988. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  989. */
  990. #if HTT_PADDR64
  991. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  992. #else
  993. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  994. #endif
  995. /* decriptor information for Management frame*/
  996. /*
  997. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  998. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  999. */
  1000. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1001. extern A_UINT32 mgmt_hdr_len;
  1002. PREPACK struct htt_mgmt_tx_desc_t {
  1003. A_UINT32 msg_type;
  1004. #if HTT_PADDR64
  1005. A_UINT64 frag_paddr; /* DMAble address of the data */
  1006. #else
  1007. A_UINT32 frag_paddr; /* DMAble address of the data */
  1008. #endif
  1009. A_UINT32 desc_id; /* returned to host during completion
  1010. * to free the meory*/
  1011. A_UINT32 len; /* Fragment length */
  1012. A_UINT32 vdev_id; /* virtual device ID*/
  1013. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1014. } POSTPACK;
  1015. PREPACK struct htt_mgmt_tx_compl_ind {
  1016. A_UINT32 desc_id;
  1017. A_UINT32 status;
  1018. } POSTPACK;
  1019. /*
  1020. * This SDU header size comes from the summation of the following:
  1021. * 1. Max of:
  1022. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1023. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1024. * b. 802.11 header, for raw frames: 36 bytes
  1025. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1026. * QoS header, HT header)
  1027. * c. 802.3 header, for ethernet frames: 14 bytes
  1028. * (destination address, source address, ethertype / length)
  1029. * 2. Max of:
  1030. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1031. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1032. * 3. 802.1Q VLAN header: 4 bytes
  1033. * 4. LLC/SNAP header: 8 bytes
  1034. */
  1035. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1036. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1037. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1038. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1039. A_COMPILE_TIME_ASSERT(
  1040. htt_encap_hdr_size_max_check_nwifi,
  1041. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1042. A_COMPILE_TIME_ASSERT(
  1043. htt_encap_hdr_size_max_check_enet,
  1044. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1045. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1046. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1047. #define HTT_TX_HDR_SIZE_802_1Q 4
  1048. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1049. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1050. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1051. HTT_TX_HDR_SIZE_802_1Q + \
  1052. HTT_TX_HDR_SIZE_LLC_SNAP)
  1053. #define HTT_HL_TX_FRM_HDR_LEN \
  1054. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1055. #define HTT_LL_TX_FRM_HDR_LEN \
  1056. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1057. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1058. /* dword 0 */
  1059. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1060. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1061. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1062. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1063. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1064. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1065. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1066. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1067. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1068. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1069. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1070. #define HTT_TX_DESC_PKT_TYPE_S 13
  1071. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1072. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1073. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1074. #define HTT_TX_DESC_VDEV_ID_S 16
  1075. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1076. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1077. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1078. #define HTT_TX_DESC_EXT_TID_S 22
  1079. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1080. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1081. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1082. #define HTT_TX_DESC_POSTPONED_S 27
  1083. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1084. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1085. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1086. #define HTT_TX_DESC_EXTENSION_S 28
  1087. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1088. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1089. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1090. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1091. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1092. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1093. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1094. #define HTT_TX_DESC_TX_COMP_S 31
  1095. /* dword 1 */
  1096. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1097. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1098. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1099. #define HTT_TX_DESC_FRM_LEN_S 0
  1100. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1101. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1102. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1103. #define HTT_TX_DESC_FRM_ID_S 16
  1104. /* dword 2 */
  1105. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1106. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1107. /* for systems using 64-bit format for bus addresses */
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1110. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1111. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1112. /* for systems using 32-bit format for bus addresses */
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1114. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1115. /* dword 3 */
  1116. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1117. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1118. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1119. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1120. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1121. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1122. #if HTT_PADDR64
  1123. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1124. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1125. #else
  1126. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1127. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1128. #endif
  1129. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1130. #define HTT_TX_DESC_PEER_ID_S 0
  1131. /*
  1132. * TEMPORARY:
  1133. * The original definitions for the PEER_ID fields contained typos
  1134. * (with _DESC_PADDR appended to this PEER_ID field name).
  1135. * Retain deprecated original names for PEER_ID fields until all code that
  1136. * refers to them has been updated.
  1137. */
  1138. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1139. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1140. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1141. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1142. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1143. HTT_TX_DESC_PEER_ID_M
  1144. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1145. HTT_TX_DESC_PEER_ID_S
  1146. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1147. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1148. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1149. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1150. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1151. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1152. #if HTT_PADDR64
  1153. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1154. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1155. #else
  1156. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1157. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1158. #endif
  1159. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1160. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1161. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1162. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1163. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1164. do { \
  1165. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1166. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1167. } while (0)
  1168. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1169. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1170. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1171. do { \
  1172. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1173. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1174. } while (0)
  1175. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1176. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1177. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1178. do { \
  1179. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1180. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1181. } while (0)
  1182. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1183. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1184. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1185. do { \
  1186. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1187. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1188. } while (0)
  1189. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1190. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1191. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1192. do { \
  1193. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1194. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1195. } while (0)
  1196. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1197. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1198. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1199. do { \
  1200. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1201. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1202. } while (0)
  1203. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1204. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1205. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1206. do { \
  1207. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1208. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1209. } while (0)
  1210. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1211. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1212. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1213. do { \
  1214. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1215. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1216. } while (0)
  1217. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1218. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1219. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1220. do { \
  1221. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1222. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1223. } while (0)
  1224. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1225. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1226. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1227. do { \
  1228. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1229. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1230. } while (0)
  1231. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1232. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1233. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1234. do { \
  1235. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1236. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1237. } while (0)
  1238. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1239. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1240. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1241. do { \
  1242. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1243. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1244. } while (0)
  1245. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1246. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1247. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1248. do { \
  1249. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1250. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1251. } while (0)
  1252. /* enums used in the HTT tx MSDU extension descriptor */
  1253. enum {
  1254. htt_tx_guard_interval_regular = 0,
  1255. htt_tx_guard_interval_short = 1,
  1256. };
  1257. enum {
  1258. htt_tx_preamble_type_ofdm = 0,
  1259. htt_tx_preamble_type_cck = 1,
  1260. htt_tx_preamble_type_ht = 2,
  1261. htt_tx_preamble_type_vht = 3,
  1262. };
  1263. enum {
  1264. htt_tx_bandwidth_5MHz = 0,
  1265. htt_tx_bandwidth_10MHz = 1,
  1266. htt_tx_bandwidth_20MHz = 2,
  1267. htt_tx_bandwidth_40MHz = 3,
  1268. htt_tx_bandwidth_80MHz = 4,
  1269. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1270. };
  1271. /**
  1272. * @brief HTT tx MSDU extension descriptor
  1273. * @details
  1274. * If the target supports HTT tx MSDU extension descriptors, the host has
  1275. * the option of appending the following struct following the regular
  1276. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1277. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1278. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1279. * tx specs for each frame.
  1280. */
  1281. PREPACK struct htt_tx_msdu_desc_ext_t {
  1282. /* DWORD 0: flags */
  1283. A_UINT32
  1284. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1285. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1286. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1287. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1288. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1289. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1290. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1291. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1292. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1293. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1294. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1295. /* DWORD 1: tx power, tx rate, tx BW */
  1296. A_UINT32
  1297. /* pwr -
  1298. * Specify what power the tx frame needs to be transmitted at.
  1299. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1300. * The value needs to be appropriately sign-extended when extracting
  1301. * the value from the message and storing it in a variable that is
  1302. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1303. * automatically handles this sign-extension.)
  1304. * If the transmission uses multiple tx chains, this power spec is
  1305. * the total transmit power, assuming incoherent combination of
  1306. * per-chain power to produce the total power.
  1307. */
  1308. pwr: 8,
  1309. /* mcs_mask -
  1310. * Specify the allowable values for MCS index (modulation and coding)
  1311. * to use for transmitting the frame.
  1312. *
  1313. * For HT / VHT preamble types, this mask directly corresponds to
  1314. * the HT or VHT MCS indices that are allowed. For each bit N set
  1315. * within the mask, MCS index N is allowed for transmitting the frame.
  1316. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1317. * rates versus OFDM rates, so the host has the option of specifying
  1318. * that the target must transmit the frame with CCK or OFDM rates
  1319. * (not HT or VHT), but leaving the decision to the target whether
  1320. * to use CCK or OFDM.
  1321. *
  1322. * For CCK and OFDM, the bits within this mask are interpreted as
  1323. * follows:
  1324. * bit 0 -> CCK 1 Mbps rate is allowed
  1325. * bit 1 -> CCK 2 Mbps rate is allowed
  1326. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1327. * bit 3 -> CCK 11 Mbps rate is allowed
  1328. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1329. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1330. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1331. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1332. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1333. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1334. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1335. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1336. *
  1337. * The MCS index specification needs to be compatible with the
  1338. * bandwidth mask specification. For example, a MCS index == 9
  1339. * specification is inconsistent with a preamble type == VHT,
  1340. * Nss == 1, and channel bandwidth == 20 MHz.
  1341. *
  1342. * Furthermore, the host has only a limited ability to specify to
  1343. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1344. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1345. */
  1346. mcs_mask: 12,
  1347. /* nss_mask -
  1348. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1349. * Each bit in this mask corresponds to a Nss value:
  1350. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1351. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1352. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1353. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1354. * The values in the Nss mask must be suitable for the recipient, e.g.
  1355. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1356. * recipient which only supports 2x2 MIMO.
  1357. */
  1358. nss_mask: 4,
  1359. /* guard_interval -
  1360. * Specify a htt_tx_guard_interval enum value to indicate whether
  1361. * the transmission should use a regular guard interval or a
  1362. * short guard interval.
  1363. */
  1364. guard_interval: 1,
  1365. /* preamble_type_mask -
  1366. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1367. * may choose from for transmitting this frame.
  1368. * The bits in this mask correspond to the values in the
  1369. * htt_tx_preamble_type enum. For example, to allow the target
  1370. * to transmit the frame as either CCK or OFDM, this field would
  1371. * be set to
  1372. * (1 << htt_tx_preamble_type_ofdm) |
  1373. * (1 << htt_tx_preamble_type_cck)
  1374. */
  1375. preamble_type_mask: 4,
  1376. reserved1_31_29: 3; /* unused, set to 0x0 */
  1377. /* DWORD 2: tx chain mask, tx retries */
  1378. A_UINT32
  1379. /* chain_mask - specify which chains to transmit from */
  1380. chain_mask: 4,
  1381. /* retry_limit -
  1382. * Specify the maximum number of transmissions, including the
  1383. * initial transmission, to attempt before giving up if no ack
  1384. * is received.
  1385. * If the tx rate is specified, then all retries shall use the
  1386. * same rate as the initial transmission.
  1387. * If no tx rate is specified, the target can choose whether to
  1388. * retain the original rate during the retransmissions, or to
  1389. * fall back to a more robust rate.
  1390. */
  1391. retry_limit: 4,
  1392. /* bandwidth_mask -
  1393. * Specify what channel widths may be used for the transmission.
  1394. * A value of zero indicates "don't care" - the target may choose
  1395. * the transmission bandwidth.
  1396. * The bits within this mask correspond to the htt_tx_bandwidth
  1397. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1398. * The bandwidth_mask must be consistent with the preamble_type_mask
  1399. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1400. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1401. */
  1402. bandwidth_mask: 6,
  1403. reserved2_31_14: 18; /* unused, set to 0x0 */
  1404. /* DWORD 3: tx expiry time (TSF) LSBs */
  1405. A_UINT32 expire_tsf_lo;
  1406. /* DWORD 4: tx expiry time (TSF) MSBs */
  1407. A_UINT32 expire_tsf_hi;
  1408. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1409. } POSTPACK;
  1410. /* DWORD 0 */
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1430. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1431. /* DWORD 1 */
  1432. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1433. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1434. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1435. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1436. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1437. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1438. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1439. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1440. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1441. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1442. /* DWORD 2 */
  1443. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1444. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1445. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1446. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1447. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1448. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1449. /* DWORD 0 */
  1450. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1451. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1452. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1453. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1454. do { \
  1455. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1456. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1457. } while (0)
  1458. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1459. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1460. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1462. do { \
  1463. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1464. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1465. } while (0)
  1466. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1467. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1468. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1469. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1470. do { \
  1471. HTT_CHECK_SET_VAL( \
  1472. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1473. ((_var) |= ((_val) \
  1474. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1475. } while (0)
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1477. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1478. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1480. do { \
  1481. HTT_CHECK_SET_VAL( \
  1482. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1483. ((_var) |= ((_val) \
  1484. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1485. } while (0)
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1487. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1488. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1490. do { \
  1491. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1492. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1493. } while (0)
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1495. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1496. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1498. do { \
  1499. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1500. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1501. } while (0)
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1503. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1504. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1506. do { \
  1507. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1508. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1509. } while (0)
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1511. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1512. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1514. do { \
  1515. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1516. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1517. } while (0)
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1519. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1520. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1522. do { \
  1523. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1524. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1525. } while (0)
  1526. /* DWORD 1 */
  1527. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1528. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1529. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1530. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1531. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1532. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1533. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1534. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1535. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1536. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1537. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1538. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1539. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1540. do { \
  1541. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1542. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1543. } while (0)
  1544. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1545. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1546. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1547. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1548. do { \
  1549. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1550. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1551. } while (0)
  1552. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1558. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1559. } while (0)
  1560. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1561. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1562. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1563. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1564. do { \
  1565. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1566. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1567. } while (0)
  1568. /* DWORD 2 */
  1569. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1587. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1588. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1592. } while (0)
  1593. typedef enum {
  1594. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1595. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1596. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1597. } htt_11ax_ltf_subtype_t;
  1598. typedef enum {
  1599. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1600. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1601. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1602. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1603. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1604. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1605. } htt_tx_ext2_preamble_type_t;
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1607. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1608. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1617. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1618. /**
  1619. * @brief HTT tx MSDU extension descriptor v2
  1620. * @details
  1621. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1622. * is received as tcl_exit_base->host_meta_info in firmware.
  1623. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1624. * are already part of tcl_exit_base.
  1625. */
  1626. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1627. /* DWORD 0: flags */
  1628. A_UINT32
  1629. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1630. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1631. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1632. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1633. valid_retries : 1, /* if set, tx retries spec is valid */
  1634. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1635. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1636. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1637. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1638. valid_key_flags : 1, /* if set, key flags is valid */
  1639. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1640. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1641. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1642. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1643. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1644. 1 = ENCRYPT,
  1645. 2 ~ 3 - Reserved */
  1646. /* retry_limit -
  1647. * Specify the maximum number of transmissions, including the
  1648. * initial transmission, to attempt before giving up if no ack
  1649. * is received.
  1650. * If the tx rate is specified, then all retries shall use the
  1651. * same rate as the initial transmission.
  1652. * If no tx rate is specified, the target can choose whether to
  1653. * retain the original rate during the retransmissions, or to
  1654. * fall back to a more robust rate.
  1655. */
  1656. retry_limit : 4,
  1657. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1658. * Valid only for 11ax preamble types HE_SU
  1659. * and HE_EXT_SU
  1660. */
  1661. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1662. * Valid only for 11ax preamble types HE_SU
  1663. * and HE_EXT_SU
  1664. */
  1665. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1666. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1667. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1668. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1669. */
  1670. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1671. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1672. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1673. * Use cases:
  1674. * Any time firmware uses TQM-BYPASS for Data
  1675. * TID, firmware expect host to set this bit.
  1676. */
  1677. /* DWORD 1: tx power, tx rate */
  1678. A_UINT32
  1679. power : 8, /* unit of the power field is 0.5 dbm
  1680. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1681. * signed value ranging from -64dbm to 63.5 dbm
  1682. */
  1683. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1684. * Setting more than one MCS isn't currently
  1685. * supported by the target (but is supported
  1686. * in the interface in case in the future
  1687. * the target supports specifications of
  1688. * a limited set of MCS values.
  1689. */
  1690. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1691. * Setting more than one Nss isn't currently
  1692. * supported by the target (but is supported
  1693. * in the interface in case in the future
  1694. * the target supports specifications of
  1695. * a limited set of Nss values.
  1696. */
  1697. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1698. update_peer_cache : 1; /* When set these custom values will be
  1699. * used for all packets, until the next
  1700. * update via this ext header.
  1701. * This is to make sure not all packets
  1702. * need to include this header.
  1703. */
  1704. /* DWORD 2: tx chain mask, tx retries */
  1705. A_UINT32
  1706. /* chain_mask - specify which chains to transmit from */
  1707. chain_mask : 8,
  1708. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1709. * TODO: Update Enum values for key_flags
  1710. */
  1711. /*
  1712. * Channel frequency: This identifies the desired channel
  1713. * frequency (in MHz) for tx frames. This is used by FW to help
  1714. * determine when it is safe to transmit or drop frames for
  1715. * off-channel operation.
  1716. * The default value of zero indicates to FW that the corresponding
  1717. * VDEV's home channel (if there is one) is the desired channel
  1718. * frequency.
  1719. */
  1720. chanfreq : 16;
  1721. /* DWORD 3: tx expiry time (TSF) LSBs */
  1722. A_UINT32 expire_tsf_lo;
  1723. /* DWORD 4: tx expiry time (TSF) MSBs */
  1724. A_UINT32 expire_tsf_hi;
  1725. /* DWORD 5: flags to control routing / processing of the MSDU */
  1726. A_UINT32
  1727. /* learning_frame
  1728. * When this flag is set, this frame will be dropped by FW
  1729. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1730. */
  1731. learning_frame : 1,
  1732. /* send_as_standalone
  1733. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1734. * i.e. with no A-MSDU or A-MPDU aggregation.
  1735. * The scope is extended to other use-cases.
  1736. */
  1737. send_as_standalone : 1,
  1738. /* is_host_opaque_valid
  1739. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1740. * with valid information.
  1741. */
  1742. is_host_opaque_valid : 1,
  1743. rsvd0 : 29;
  1744. /* DWORD 6 : Host opaque cookie for special frames */
  1745. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1746. rsvd1 : 16;
  1747. /*
  1748. * This structure can be expanded further up to 40 bytes
  1749. * by adding further DWORDs as needed.
  1750. */
  1751. } POSTPACK;
  1752. /* DWORD 0 */
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1778. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1779. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1780. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1781. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1782. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1783. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1784. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1785. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1786. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1787. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1788. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1789. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1790. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1791. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1792. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1793. /* DWORD 1 */
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1795. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1796. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1797. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1798. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1799. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1800. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1801. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1802. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1803. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1804. /* DWORD 2 */
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1806. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1807. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1808. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1809. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1810. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1811. /* DWORD 5 */
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1818. /* DWORD 6 */
  1819. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1820. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1821. /* DWORD 0 */
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1823. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1824. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1826. do { \
  1827. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1828. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1829. } while (0)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1837. } while (0)
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1840. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1844. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1845. } while (0)
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1847. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1848. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1850. do { \
  1851. HTT_CHECK_SET_VAL( \
  1852. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1853. ((_var) |= ((_val) \
  1854. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1855. } while (0)
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1857. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1858. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1860. do { \
  1861. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1862. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1863. } while (0)
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1865. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1866. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1868. do { \
  1869. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1870. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1871. } while (0)
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1873. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1874. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1876. do { \
  1877. HTT_CHECK_SET_VAL( \
  1878. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1879. ((_var) |= ((_val) \
  1880. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1881. } while (0)
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1883. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1884. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1889. } while (0)
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1891. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1892. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1897. } while (0)
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1899. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1900. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1905. } while (0)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1907. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1908. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1910. do { \
  1911. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1912. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1913. } while (0)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1915. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1916. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1918. do { \
  1919. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1920. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1921. } while (0)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1923. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1924. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1944. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1945. } while (0)
  1946. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1947. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1948. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1949. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1950. do { \
  1951. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1952. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1953. } while (0)
  1954. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1955. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1956. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1957. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1958. do { \
  1959. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1960. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1961. } while (0)
  1962. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1977. } while (0)
  1978. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1979. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1980. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1981. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1985. } while (0)
  1986. /* DWORD 1 */
  1987. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1991. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1992. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1993. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1994. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1995. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1996. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2022. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2023. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2027. } while (0)
  2028. /* DWORD 2 */
  2029. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2044. } while (0)
  2045. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2046. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2047. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2048. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2049. do { \
  2050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2051. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2052. } while (0)
  2053. /* DWORD 5 */
  2054. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2055. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2056. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2061. } while (0)
  2062. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2069. } while (0)
  2070. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2077. } while (0)
  2078. /* DWORD 6 */
  2079. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2081. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2082. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2086. } while (0)
  2087. typedef enum {
  2088. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2089. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2090. } htt_tcl_metadata_type;
  2091. /**
  2092. * @brief HTT TCL command number format
  2093. * @details
  2094. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2095. * available to firmware as tcl_exit_base->tcl_status_number.
  2096. * For regular / multicast packets host will send vdev and mac id and for
  2097. * NAWDS packets, host will send peer id.
  2098. * A_UINT32 is used to avoid endianness conversion problems.
  2099. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2100. */
  2101. typedef struct {
  2102. A_UINT32
  2103. type: 1, /* vdev_id based or peer_id based */
  2104. rsvd: 31;
  2105. } htt_tx_tcl_vdev_or_peer_t;
  2106. typedef struct {
  2107. A_UINT32
  2108. type: 1, /* vdev_id based or peer_id based */
  2109. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2110. vdev_id: 8,
  2111. pdev_id: 2,
  2112. host_inspected:1,
  2113. rsvd: 19;
  2114. } htt_tx_tcl_vdev_metadata;
  2115. typedef struct {
  2116. A_UINT32
  2117. type: 1, /* vdev_id based or peer_id based */
  2118. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2119. peer_id: 14,
  2120. rsvd: 16;
  2121. } htt_tx_tcl_peer_metadata;
  2122. PREPACK struct htt_tx_tcl_metadata {
  2123. union {
  2124. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2125. htt_tx_tcl_vdev_metadata vdev_meta;
  2126. htt_tx_tcl_peer_metadata peer_meta;
  2127. };
  2128. } POSTPACK;
  2129. /* DWORD 0 */
  2130. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2131. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2132. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2133. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2134. /* VDEV metadata */
  2135. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2136. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2137. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2138. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2139. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2140. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2141. /* PEER metadata */
  2142. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2143. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2144. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2145. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2146. HTT_TX_TCL_METADATA_TYPE_S)
  2147. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2151. } while (0)
  2152. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2153. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2154. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2155. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2159. } while (0)
  2160. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2161. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2162. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2163. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2167. } while (0)
  2168. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2169. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2170. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2171. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2175. } while (0)
  2176. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2177. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2178. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2179. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2183. } while (0)
  2184. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2185. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2186. HTT_TX_TCL_METADATA_PEER_ID_S)
  2187. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2188. do { \
  2189. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2190. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2191. } while (0)
  2192. typedef enum {
  2193. HTT_TX_FW2WBM_TX_STATUS_OK,
  2194. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2195. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2196. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2197. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2198. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2199. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2200. HTT_TX_FW2WBM_TX_STATUS_MAX
  2201. } htt_tx_fw2wbm_tx_status_t;
  2202. typedef enum {
  2203. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2204. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2205. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2206. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2207. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2208. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2209. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2210. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2211. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2212. } htt_tx_fw2wbm_reinject_reason_t;
  2213. /**
  2214. * @brief HTT TX WBM Completion from firmware to host
  2215. * @details
  2216. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2217. * DWORD 3 and 4 for software based completions (Exception frames and
  2218. * TQM bypass frames)
  2219. * For software based completions, wbm_release_ring->release_source_module will
  2220. * be set to release_source_fw
  2221. */
  2222. PREPACK struct htt_tx_wbm_completion {
  2223. A_UINT32
  2224. sch_cmd_id: 24,
  2225. exception_frame: 1, /* If set, this packet was queued via exception path */
  2226. rsvd0_31_25: 7;
  2227. A_UINT32
  2228. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2229. * reception of an ACK or BA, this field indicates
  2230. * the RSSI of the received ACK or BA frame.
  2231. * When the frame is removed as result of a direct
  2232. * remove command from the SW, this field is set
  2233. * to 0x0 (which is never a valid value when real
  2234. * RSSI is available).
  2235. * Units: dB w.r.t noise floor
  2236. */
  2237. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2238. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2239. rsvd1_31_16: 16;
  2240. } POSTPACK;
  2241. /* DWORD 0 */
  2242. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2243. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2244. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2245. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2246. /* DWORD 1 */
  2247. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2248. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2249. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2250. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2251. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2252. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2253. /* DWORD 0 */
  2254. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2255. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2256. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2257. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2261. } while (0)
  2262. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2263. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2264. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2265. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2269. } while (0)
  2270. /* DWORD 1 */
  2271. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2272. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2273. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2274. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2275. do { \
  2276. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2277. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2278. } while (0)
  2279. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2280. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2281. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2282. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2283. do { \
  2284. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2285. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2286. } while (0)
  2287. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2288. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2289. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2290. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2291. do { \
  2292. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2293. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2294. } while (0)
  2295. /**
  2296. * @brief HTT TX WBM Completion from firmware to host
  2297. * @details
  2298. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2299. * (WBM) offload HW.
  2300. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2301. * For software based completions, release_source_module will
  2302. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2303. * struct wbm_release_ring and then switch to this after looking at
  2304. * release_source_module.
  2305. */
  2306. PREPACK struct htt_tx_wbm_completion_v2 {
  2307. A_UINT32
  2308. used_by_hw0; /* Refer to struct wbm_release_ring */
  2309. A_UINT32
  2310. used_by_hw1; /* Refer to struct wbm_release_ring */
  2311. A_UINT32
  2312. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2313. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2314. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2315. exception_frame: 1,
  2316. rsvd0: 12, /* For future use */
  2317. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2318. rsvd1: 1; /* For future use */
  2319. A_UINT32
  2320. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2321. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2322. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2323. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2324. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2325. */
  2326. A_UINT32
  2327. data1: 32;
  2328. A_UINT32
  2329. data2: 32;
  2330. A_UINT32
  2331. used_by_hw3; /* Refer to struct wbm_release_ring */
  2332. } POSTPACK;
  2333. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2334. /* DWORD 3 */
  2335. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2336. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2337. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2338. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2339. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2340. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2341. /* DWORD 3 */
  2342. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2343. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2344. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2345. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2346. do { \
  2347. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2348. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2349. } while (0)
  2350. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2351. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2352. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2353. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2354. do { \
  2355. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2356. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2357. } while (0)
  2358. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2359. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2360. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2361. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2362. do { \
  2363. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2364. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2365. } while (0)
  2366. /**
  2367. * @brief HTT TX WBM transmit status from firmware to host
  2368. * @details
  2369. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2370. * (WBM) offload HW.
  2371. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2372. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2373. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2374. */
  2375. PREPACK struct htt_tx_wbm_transmit_status {
  2376. A_UINT32
  2377. sch_cmd_id: 24,
  2378. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2379. * reception of an ACK or BA, this field indicates
  2380. * the RSSI of the received ACK or BA frame.
  2381. * When the frame is removed as result of a direct
  2382. * remove command from the SW, this field is set
  2383. * to 0x0 (which is never a valid value when real
  2384. * RSSI is available).
  2385. * Units: dB w.r.t noise floor
  2386. */
  2387. A_UINT32
  2388. sw_peer_id: 16,
  2389. tid_num: 5,
  2390. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2391. * and tid_num fields contain valid data.
  2392. * If this "valid" flag is not set, the
  2393. * sw_peer_id and tid_num fields must be ignored.
  2394. */
  2395. mcast: 1,
  2396. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2397. * contains valid data.
  2398. */
  2399. reserved0: 8;
  2400. A_UINT32
  2401. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2402. * packets in the wbm completion path
  2403. */
  2404. } POSTPACK;
  2405. /* DWORD 4 */
  2406. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2407. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2408. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2409. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2410. /* DWORD 5 */
  2411. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2412. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2413. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2414. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2415. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2416. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2417. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2418. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2419. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2420. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2421. /* DWORD 4 */
  2422. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2423. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2424. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2425. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2429. } while (0)
  2430. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2431. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2432. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2433. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2437. } while (0)
  2438. /* DWORD 5 */
  2439. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2440. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2441. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2442. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2446. } while (0)
  2447. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2448. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2449. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2450. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2451. do { \
  2452. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2453. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2454. } while (0)
  2455. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2456. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2457. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2458. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2459. do { \
  2460. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2461. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2462. } while (0)
  2463. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2464. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2465. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2466. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2467. do { \
  2468. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2469. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2470. } while (0)
  2471. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2472. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2473. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2474. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2475. do { \
  2476. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2477. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2478. } while (0)
  2479. /**
  2480. * @brief HTT TX WBM reinject status from firmware to host
  2481. * @details
  2482. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2483. * (WBM) offload HW.
  2484. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2485. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2486. */
  2487. PREPACK struct htt_tx_wbm_reinject_status {
  2488. A_UINT32
  2489. reserved0: 32;
  2490. A_UINT32
  2491. reserved1: 32;
  2492. A_UINT32
  2493. reserved2: 32;
  2494. } POSTPACK;
  2495. /**
  2496. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2497. * @details
  2498. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2499. * (WBM) offload HW.
  2500. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2501. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2502. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2503. * STA side.
  2504. */
  2505. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2506. A_UINT32
  2507. mec_sa_addr_31_0;
  2508. A_UINT32
  2509. mec_sa_addr_47_32: 16,
  2510. sa_ast_index: 16;
  2511. A_UINT32
  2512. vdev_id: 8,
  2513. reserved0: 24;
  2514. } POSTPACK;
  2515. /* DWORD 4 - mec_sa_addr_31_0 */
  2516. /* DWORD 5 */
  2517. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2518. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2519. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2520. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2521. /* DWORD 6 */
  2522. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2523. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2524. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2525. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2526. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2527. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2528. do { \
  2529. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2530. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2531. } while (0)
  2532. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2533. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2534. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2535. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2536. do { \
  2537. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2538. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2539. } while (0)
  2540. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2541. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2542. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2543. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2544. do { \
  2545. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2546. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2547. } while (0)
  2548. typedef enum {
  2549. TX_FLOW_PRIORITY_BE,
  2550. TX_FLOW_PRIORITY_HIGH,
  2551. TX_FLOW_PRIORITY_LOW,
  2552. } htt_tx_flow_priority_t;
  2553. typedef enum {
  2554. TX_FLOW_LATENCY_SENSITIVE,
  2555. TX_FLOW_LATENCY_INSENSITIVE,
  2556. } htt_tx_flow_latency_t;
  2557. typedef enum {
  2558. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2559. TX_FLOW_INTERACTIVE_TRAFFIC,
  2560. TX_FLOW_PERIODIC_TRAFFIC,
  2561. TX_FLOW_BURSTY_TRAFFIC,
  2562. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2563. } htt_tx_flow_traffic_pattern_t;
  2564. /**
  2565. * @brief HTT TX Flow search metadata format
  2566. * @details
  2567. * Host will set this metadata in flow table's flow search entry along with
  2568. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2569. * firmware and TQM ring if the flow search entry wins.
  2570. * This metadata is available to firmware in that first MSDU's
  2571. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2572. * to one of the available flows for specific tid and returns the tqm flow
  2573. * pointer as part of htt_tx_map_flow_info message.
  2574. */
  2575. PREPACK struct htt_tx_flow_metadata {
  2576. A_UINT32
  2577. rsvd0_1_0: 2,
  2578. tid: 4,
  2579. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2580. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2581. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2582. * Else choose final tid based on latency, priority.
  2583. */
  2584. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2585. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2586. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2587. } POSTPACK;
  2588. /* DWORD 0 */
  2589. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2590. #define HTT_TX_FLOW_METADATA_TID_S 2
  2591. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2592. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2593. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2594. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2595. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2596. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2597. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2598. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2599. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2600. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2601. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2602. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2603. /* DWORD 0 */
  2604. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2605. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2606. HTT_TX_FLOW_METADATA_TID_S)
  2607. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2608. do { \
  2609. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2610. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2611. } while (0)
  2612. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2613. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2614. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2615. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2616. do { \
  2617. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2618. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2619. } while (0)
  2620. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2621. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2622. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2623. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2624. do { \
  2625. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2626. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2627. } while (0)
  2628. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2629. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2630. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2631. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2632. do { \
  2633. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2634. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2635. } while (0)
  2636. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2637. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2638. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2639. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2640. do { \
  2641. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2642. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2643. } while (0)
  2644. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2645. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2646. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2647. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2650. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2651. } while (0)
  2652. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2653. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2654. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2655. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2658. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2659. } while (0)
  2660. /**
  2661. * @brief host -> target ADD WDS Entry
  2662. *
  2663. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2664. *
  2665. * @brief host -> target DELETE WDS Entry
  2666. *
  2667. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2668. *
  2669. * @details
  2670. * HTT wds entry from source port learning
  2671. * Host will learn wds entries from rx and send this message to firmware
  2672. * to enable firmware to configure/delete AST entries for wds clients.
  2673. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2674. * and when SA's entry is deleted, firmware removes this AST entry
  2675. *
  2676. * The message would appear as follows:
  2677. *
  2678. * |31 30|29 |17 16|15 8|7 0|
  2679. * |----------------+----------------+----------------+----------------|
  2680. * | rsvd0 |PDVID| vdev_id | msg_type |
  2681. * |-------------------------------------------------------------------|
  2682. * | sa_addr_31_0 |
  2683. * |-------------------------------------------------------------------|
  2684. * | | ta_peer_id | sa_addr_47_32 |
  2685. * |-------------------------------------------------------------------|
  2686. * Where PDVID = pdev_id
  2687. *
  2688. * The message is interpreted as follows:
  2689. *
  2690. * dword0 - b'0:7 - msg_type: This will be set to
  2691. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2692. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2693. *
  2694. * dword0 - b'8:15 - vdev_id
  2695. *
  2696. * dword0 - b'16:17 - pdev_id
  2697. *
  2698. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2699. *
  2700. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2701. *
  2702. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2703. *
  2704. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2705. */
  2706. PREPACK struct htt_wds_entry {
  2707. A_UINT32
  2708. msg_type: 8,
  2709. vdev_id: 8,
  2710. pdev_id: 2,
  2711. rsvd0: 14;
  2712. A_UINT32 sa_addr_31_0;
  2713. A_UINT32
  2714. sa_addr_47_32: 16,
  2715. ta_peer_id: 14,
  2716. rsvd2: 2;
  2717. } POSTPACK;
  2718. /* DWORD 0 */
  2719. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2720. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2721. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2722. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2723. /* DWORD 2 */
  2724. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2725. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2726. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2727. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2728. /* DWORD 0 */
  2729. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2730. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2731. HTT_WDS_ENTRY_VDEV_ID_S)
  2732. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2733. do { \
  2734. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2735. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2736. } while (0)
  2737. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2738. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2739. HTT_WDS_ENTRY_PDEV_ID_S)
  2740. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2741. do { \
  2742. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2743. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2744. } while (0)
  2745. /* DWORD 2 */
  2746. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2747. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2748. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2749. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2752. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2753. } while (0)
  2754. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2755. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2756. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2757. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2760. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2761. } while (0)
  2762. /**
  2763. * @brief MAC DMA rx ring setup specification
  2764. *
  2765. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2766. *
  2767. * @details
  2768. * To allow for dynamic rx ring reconfiguration and to avoid race
  2769. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2770. * it uses. Instead, it sends this message to the target, indicating how
  2771. * the rx ring used by the host should be set up and maintained.
  2772. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2773. * specifications.
  2774. *
  2775. * |31 16|15 8|7 0|
  2776. * |---------------------------------------------------------------|
  2777. * header: | reserved | num rings | msg type |
  2778. * |---------------------------------------------------------------|
  2779. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2780. #if HTT_PADDR64
  2781. * | FW_IDX shadow register physical address (bits 63:32) |
  2782. #endif
  2783. * |---------------------------------------------------------------|
  2784. * | rx ring base physical address (bits 31:0) |
  2785. #if HTT_PADDR64
  2786. * | rx ring base physical address (bits 63:32) |
  2787. #endif
  2788. * |---------------------------------------------------------------|
  2789. * | rx ring buffer size | rx ring length |
  2790. * |---------------------------------------------------------------|
  2791. * | FW_IDX initial value | enabled flags |
  2792. * |---------------------------------------------------------------|
  2793. * | MSDU payload offset | 802.11 header offset |
  2794. * |---------------------------------------------------------------|
  2795. * | PPDU end offset | PPDU start offset |
  2796. * |---------------------------------------------------------------|
  2797. * | MPDU end offset | MPDU start offset |
  2798. * |---------------------------------------------------------------|
  2799. * | MSDU end offset | MSDU start offset |
  2800. * |---------------------------------------------------------------|
  2801. * | frag info offset | rx attention offset |
  2802. * |---------------------------------------------------------------|
  2803. * payload 2, if present, has the same format as payload 1
  2804. * Header fields:
  2805. * - MSG_TYPE
  2806. * Bits 7:0
  2807. * Purpose: identifies this as an rx ring configuration message
  2808. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2809. * - NUM_RINGS
  2810. * Bits 15:8
  2811. * Purpose: indicates whether the host is setting up one rx ring or two
  2812. * Value: 1 or 2
  2813. * Payload:
  2814. * for systems using 64-bit format for bus addresses:
  2815. * - IDX_SHADOW_REG_PADDR_LO
  2816. * Bits 31:0
  2817. * Value: lower 4 bytes of physical address of the host's
  2818. * FW_IDX shadow register
  2819. * - IDX_SHADOW_REG_PADDR_HI
  2820. * Bits 31:0
  2821. * Value: upper 4 bytes of physical address of the host's
  2822. * FW_IDX shadow register
  2823. * - RING_BASE_PADDR_LO
  2824. * Bits 31:0
  2825. * Value: lower 4 bytes of physical address of the host's rx ring
  2826. * - RING_BASE_PADDR_HI
  2827. * Bits 31:0
  2828. * Value: uppper 4 bytes of physical address of the host's rx ring
  2829. * for systems using 32-bit format for bus addresses:
  2830. * - IDX_SHADOW_REG_PADDR
  2831. * Bits 31:0
  2832. * Value: physical address of the host's FW_IDX shadow register
  2833. * - RING_BASE_PADDR
  2834. * Bits 31:0
  2835. * Value: physical address of the host's rx ring
  2836. * - RING_LEN
  2837. * Bits 15:0
  2838. * Value: number of elements in the rx ring
  2839. * - RING_BUF_SZ
  2840. * Bits 31:16
  2841. * Value: size of the buffers referenced by the rx ring, in byte units
  2842. * - ENABLED_FLAGS
  2843. * Bits 15:0
  2844. * Value: 1-bit flags to show whether different rx fields are enabled
  2845. * bit 0: 802.11 header enabled (1) or disabled (0)
  2846. * bit 1: MSDU payload enabled (1) or disabled (0)
  2847. * bit 2: PPDU start enabled (1) or disabled (0)
  2848. * bit 3: PPDU end enabled (1) or disabled (0)
  2849. * bit 4: MPDU start enabled (1) or disabled (0)
  2850. * bit 5: MPDU end enabled (1) or disabled (0)
  2851. * bit 6: MSDU start enabled (1) or disabled (0)
  2852. * bit 7: MSDU end enabled (1) or disabled (0)
  2853. * bit 8: rx attention enabled (1) or disabled (0)
  2854. * bit 9: frag info enabled (1) or disabled (0)
  2855. * bit 10: unicast rx enabled (1) or disabled (0)
  2856. * bit 11: multicast rx enabled (1) or disabled (0)
  2857. * bit 12: ctrl rx enabled (1) or disabled (0)
  2858. * bit 13: mgmt rx enabled (1) or disabled (0)
  2859. * bit 14: null rx enabled (1) or disabled (0)
  2860. * bit 15: phy data rx enabled (1) or disabled (0)
  2861. * - IDX_INIT_VAL
  2862. * Bits 31:16
  2863. * Purpose: Specify the initial value for the FW_IDX.
  2864. * Value: the number of buffers initially present in the host's rx ring
  2865. * - OFFSET_802_11_HDR
  2866. * Bits 15:0
  2867. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2868. * - OFFSET_MSDU_PAYLOAD
  2869. * Bits 31:16
  2870. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2871. * - OFFSET_PPDU_START
  2872. * Bits 15:0
  2873. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2874. * - OFFSET_PPDU_END
  2875. * Bits 31:16
  2876. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2877. * - OFFSET_MPDU_START
  2878. * Bits 15:0
  2879. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2880. * - OFFSET_MPDU_END
  2881. * Bits 31:16
  2882. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2883. * - OFFSET_MSDU_START
  2884. * Bits 15:0
  2885. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2886. * - OFFSET_MSDU_END
  2887. * Bits 31:16
  2888. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2889. * - OFFSET_RX_ATTN
  2890. * Bits 15:0
  2891. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2892. * - OFFSET_FRAG_INFO
  2893. * Bits 31:16
  2894. * Value: offset in QUAD-bytes of frag info table
  2895. */
  2896. /* header fields */
  2897. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2898. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2899. /* payload fields */
  2900. /* for systems using a 64-bit format for bus addresses */
  2901. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2902. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2903. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2904. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2905. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2906. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2907. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2908. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2909. /* for systems using a 32-bit format for bus addresses */
  2910. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2911. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2912. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2913. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2914. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2915. #define HTT_RX_RING_CFG_LEN_S 0
  2916. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2917. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2918. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2919. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2920. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2921. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2922. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2923. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2924. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2925. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2926. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2927. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2928. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2929. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2930. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2931. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2932. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2933. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2934. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2935. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2936. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2937. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2938. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2939. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2940. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2941. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2942. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2943. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2944. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2945. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2946. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2947. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2948. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2949. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2950. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2951. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2952. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2953. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2954. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2955. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2956. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2957. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2958. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2959. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2960. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2961. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2962. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2963. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2965. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2966. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2967. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2968. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2969. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2970. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2971. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2972. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2973. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2974. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2975. #if HTT_PADDR64
  2976. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2977. #else
  2978. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2979. #endif
  2980. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2981. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2982. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2983. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2984. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2985. do { \
  2986. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2987. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2988. } while (0)
  2989. /* degenerate case for 32-bit fields */
  2990. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2991. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2992. ((_var) = (_val))
  2993. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2994. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2995. ((_var) = (_val))
  2996. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2997. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2998. ((_var) = (_val))
  2999. /* degenerate case for 32-bit fields */
  3000. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3001. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3002. ((_var) = (_val))
  3003. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3004. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3005. ((_var) = (_val))
  3006. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3007. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3008. ((_var) = (_val))
  3009. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3010. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3011. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3012. do { \
  3013. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3014. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3015. } while (0)
  3016. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3017. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3018. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3019. do { \
  3020. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3021. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3022. } while (0)
  3023. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3024. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3025. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3026. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3027. do { \
  3028. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3029. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3030. } while (0)
  3031. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3032. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3033. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3034. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3035. do { \
  3036. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3037. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3038. } while (0)
  3039. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3040. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3041. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3042. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3043. do { \
  3044. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3045. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3046. } while (0)
  3047. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3048. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3049. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3050. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3051. do { \
  3052. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3053. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3054. } while (0)
  3055. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3056. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3057. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3058. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3059. do { \
  3060. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3061. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3062. } while (0)
  3063. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3064. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3065. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3066. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3067. do { \
  3068. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3069. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3070. } while (0)
  3071. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3072. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3073. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3074. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3075. do { \
  3076. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3077. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3078. } while (0)
  3079. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3080. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3081. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3082. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3083. do { \
  3084. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3085. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3086. } while (0)
  3087. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3088. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3089. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3090. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3091. do { \
  3092. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3093. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3094. } while (0)
  3095. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3096. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3097. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3098. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3099. do { \
  3100. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3101. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3102. } while (0)
  3103. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3104. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3105. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3106. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3107. do { \
  3108. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3109. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3110. } while (0)
  3111. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3112. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3113. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3114. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3115. do { \
  3116. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3117. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3118. } while (0)
  3119. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3120. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3121. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3122. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3123. do { \
  3124. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3125. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3126. } while (0)
  3127. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3128. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3129. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3130. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3131. do { \
  3132. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3133. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3134. } while (0)
  3135. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3136. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3137. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3138. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3139. do { \
  3140. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3141. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3142. } while (0)
  3143. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3144. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3145. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3146. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3147. do { \
  3148. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3149. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3150. } while (0)
  3151. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3152. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3153. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3154. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3155. do { \
  3156. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3157. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3158. } while (0)
  3159. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3160. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3161. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3162. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3163. do { \
  3164. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3165. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3166. } while (0)
  3167. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3168. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3169. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3170. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3171. do { \
  3172. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3173. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3174. } while (0)
  3175. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3176. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3177. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3178. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3179. do { \
  3180. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3181. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3182. } while (0)
  3183. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3184. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3185. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3186. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3187. do { \
  3188. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3189. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3190. } while (0)
  3191. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3192. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3193. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3194. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3195. do { \
  3196. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3197. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3198. } while (0)
  3199. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3200. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3201. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3202. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3203. do { \
  3204. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3205. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3206. } while (0)
  3207. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3208. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3209. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3210. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3211. do { \
  3212. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3213. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3214. } while (0)
  3215. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3216. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3217. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3218. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3219. do { \
  3220. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3221. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3222. } while (0)
  3223. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3224. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3225. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3226. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3227. do { \
  3228. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3229. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3230. } while (0)
  3231. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3232. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3233. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3234. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3235. do { \
  3236. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3237. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3238. } while (0)
  3239. /**
  3240. * @brief host -> target FW statistics retrieve
  3241. *
  3242. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3243. *
  3244. * @details
  3245. * The following field definitions describe the format of the HTT host
  3246. * to target FW stats retrieve message. The message specifies the type of
  3247. * stats host wants to retrieve.
  3248. *
  3249. * |31 24|23 16|15 8|7 0|
  3250. * |-----------------------------------------------------------|
  3251. * | stats types request bitmask | msg type |
  3252. * |-----------------------------------------------------------|
  3253. * | stats types reset bitmask | reserved |
  3254. * |-----------------------------------------------------------|
  3255. * | stats type | config value |
  3256. * |-----------------------------------------------------------|
  3257. * | cookie LSBs |
  3258. * |-----------------------------------------------------------|
  3259. * | cookie MSBs |
  3260. * |-----------------------------------------------------------|
  3261. * Header fields:
  3262. * - MSG_TYPE
  3263. * Bits 7:0
  3264. * Purpose: identifies this is a stats upload request message
  3265. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3266. * - UPLOAD_TYPES
  3267. * Bits 31:8
  3268. * Purpose: identifies which types of FW statistics to upload
  3269. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3270. * - RESET_TYPES
  3271. * Bits 31:8
  3272. * Purpose: identifies which types of FW statistics to reset
  3273. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3274. * - CFG_VAL
  3275. * Bits 23:0
  3276. * Purpose: give an opaque configuration value to the specified stats type
  3277. * Value: stats-type specific configuration value
  3278. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3279. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3280. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3281. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3282. * - CFG_STAT_TYPE
  3283. * Bits 31:24
  3284. * Purpose: specify which stats type (if any) the config value applies to
  3285. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3286. * a valid configuration specification
  3287. * - COOKIE_LSBS
  3288. * Bits 31:0
  3289. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3290. * message with its preceding host->target stats request message.
  3291. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3292. * - COOKIE_MSBS
  3293. * Bits 31:0
  3294. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3295. * message with its preceding host->target stats request message.
  3296. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3297. */
  3298. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3299. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3300. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3301. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3302. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3303. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3304. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3305. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3306. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3307. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3308. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3309. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3310. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3311. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3312. do { \
  3313. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3314. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3315. } while (0)
  3316. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3317. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3318. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3319. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3320. do { \
  3321. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3322. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3323. } while (0)
  3324. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3325. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3326. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3327. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3328. do { \
  3329. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3330. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3331. } while (0)
  3332. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3333. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3334. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3335. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3336. do { \
  3337. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3338. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3339. } while (0)
  3340. /**
  3341. * @brief host -> target HTT out-of-band sync request
  3342. *
  3343. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3344. *
  3345. * @details
  3346. * The HTT SYNC tells the target to suspend processing of subsequent
  3347. * HTT host-to-target messages until some other target agent locally
  3348. * informs the target HTT FW that the current sync counter is equal to
  3349. * or greater than (in a modulo sense) the sync counter specified in
  3350. * the SYNC message.
  3351. * This allows other host-target components to synchronize their operation
  3352. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3353. * security key has been downloaded to and activated by the target.
  3354. * In the absence of any explicit synchronization counter value
  3355. * specification, the target HTT FW will use zero as the default current
  3356. * sync value.
  3357. *
  3358. * |31 24|23 16|15 8|7 0|
  3359. * |-----------------------------------------------------------|
  3360. * | reserved | sync count | msg type |
  3361. * |-----------------------------------------------------------|
  3362. * Header fields:
  3363. * - MSG_TYPE
  3364. * Bits 7:0
  3365. * Purpose: identifies this as a sync message
  3366. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3367. * - SYNC_COUNT
  3368. * Bits 15:8
  3369. * Purpose: specifies what sync value the HTT FW will wait for from
  3370. * an out-of-band specification to resume its operation
  3371. * Value: in-band sync counter value to compare against the out-of-band
  3372. * counter spec.
  3373. * The HTT target FW will suspend its host->target message processing
  3374. * as long as
  3375. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3376. */
  3377. #define HTT_H2T_SYNC_MSG_SZ 4
  3378. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3379. #define HTT_H2T_SYNC_COUNT_S 8
  3380. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3381. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3382. HTT_H2T_SYNC_COUNT_S)
  3383. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3384. do { \
  3385. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3386. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3387. } while (0)
  3388. /**
  3389. * @brief host -> target HTT aggregation configuration
  3390. *
  3391. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3392. */
  3393. #define HTT_AGGR_CFG_MSG_SZ 4
  3394. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3395. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3396. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3397. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3398. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3399. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3400. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3401. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3402. do { \
  3403. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3404. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3405. } while (0)
  3406. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3407. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3408. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3409. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3412. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3413. } while (0)
  3414. /**
  3415. * @brief host -> target HTT configure max amsdu info per vdev
  3416. *
  3417. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3418. *
  3419. * @details
  3420. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3421. *
  3422. * |31 21|20 16|15 8|7 0|
  3423. * |-----------------------------------------------------------|
  3424. * | reserved | vdev id | max amsdu | msg type |
  3425. * |-----------------------------------------------------------|
  3426. * Header fields:
  3427. * - MSG_TYPE
  3428. * Bits 7:0
  3429. * Purpose: identifies this as a aggr cfg ex message
  3430. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3431. * - MAX_NUM_AMSDU_SUBFRM
  3432. * Bits 15:8
  3433. * Purpose: max MSDUs per A-MSDU
  3434. * - VDEV_ID
  3435. * Bits 20:16
  3436. * Purpose: ID of the vdev to which this limit is applied
  3437. */
  3438. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3439. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3440. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3441. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3442. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3443. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3444. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3445. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3446. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3449. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3450. } while (0)
  3451. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3452. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3453. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3454. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3457. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3458. } while (0)
  3459. /**
  3460. * @brief HTT WDI_IPA Config Message
  3461. *
  3462. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3463. *
  3464. * @details
  3465. * The HTT WDI_IPA config message is created/sent by host at driver
  3466. * init time. It contains information about data structures used on
  3467. * WDI_IPA TX and RX path.
  3468. * TX CE ring is used for pushing packet metadata from IPA uC
  3469. * to WLAN FW
  3470. * TX Completion ring is used for generating TX completions from
  3471. * WLAN FW to IPA uC
  3472. * RX Indication ring is used for indicating RX packets from FW
  3473. * to IPA uC
  3474. * RX Ring2 is used as either completion ring or as second
  3475. * indication ring. when Ring2 is used as completion ring, IPA uC
  3476. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3477. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3478. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3479. * indicated in RX Indication ring. Please see WDI_IPA specification
  3480. * for more details.
  3481. * |31 24|23 16|15 8|7 0|
  3482. * |----------------+----------------+----------------+----------------|
  3483. * | tx pkt pool size | Rsvd | msg_type |
  3484. * |-------------------------------------------------------------------|
  3485. * | tx comp ring base (bits 31:0) |
  3486. #if HTT_PADDR64
  3487. * | tx comp ring base (bits 63:32) |
  3488. #endif
  3489. * |-------------------------------------------------------------------|
  3490. * | tx comp ring size |
  3491. * |-------------------------------------------------------------------|
  3492. * | tx comp WR_IDX physical address (bits 31:0) |
  3493. #if HTT_PADDR64
  3494. * | tx comp WR_IDX physical address (bits 63:32) |
  3495. #endif
  3496. * |-------------------------------------------------------------------|
  3497. * | tx CE WR_IDX physical address (bits 31:0) |
  3498. #if HTT_PADDR64
  3499. * | tx CE WR_IDX physical address (bits 63:32) |
  3500. #endif
  3501. * |-------------------------------------------------------------------|
  3502. * | rx indication ring base (bits 31:0) |
  3503. #if HTT_PADDR64
  3504. * | rx indication ring base (bits 63:32) |
  3505. #endif
  3506. * |-------------------------------------------------------------------|
  3507. * | rx indication ring size |
  3508. * |-------------------------------------------------------------------|
  3509. * | rx ind RD_IDX physical address (bits 31:0) |
  3510. #if HTT_PADDR64
  3511. * | rx ind RD_IDX physical address (bits 63:32) |
  3512. #endif
  3513. * |-------------------------------------------------------------------|
  3514. * | rx ind WR_IDX physical address (bits 31:0) |
  3515. #if HTT_PADDR64
  3516. * | rx ind WR_IDX physical address (bits 63:32) |
  3517. #endif
  3518. * |-------------------------------------------------------------------|
  3519. * |-------------------------------------------------------------------|
  3520. * | rx ring2 base (bits 31:0) |
  3521. #if HTT_PADDR64
  3522. * | rx ring2 base (bits 63:32) |
  3523. #endif
  3524. * |-------------------------------------------------------------------|
  3525. * | rx ring2 size |
  3526. * |-------------------------------------------------------------------|
  3527. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3528. #if HTT_PADDR64
  3529. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3530. #endif
  3531. * |-------------------------------------------------------------------|
  3532. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3533. #if HTT_PADDR64
  3534. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3535. #endif
  3536. * |-------------------------------------------------------------------|
  3537. *
  3538. * Header fields:
  3539. * Header fields:
  3540. * - MSG_TYPE
  3541. * Bits 7:0
  3542. * Purpose: Identifies this as WDI_IPA config message
  3543. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3544. * - TX_PKT_POOL_SIZE
  3545. * Bits 15:0
  3546. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3547. * WDI_IPA TX path
  3548. * For systems using 32-bit format for bus addresses:
  3549. * - TX_COMP_RING_BASE_ADDR
  3550. * Bits 31:0
  3551. * Purpose: TX Completion Ring base address in DDR
  3552. * - TX_COMP_RING_SIZE
  3553. * Bits 31:0
  3554. * Purpose: TX Completion Ring size (must be power of 2)
  3555. * - TX_COMP_WR_IDX_ADDR
  3556. * Bits 31:0
  3557. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3558. * updates the Write Index for WDI_IPA TX completion ring
  3559. * - TX_CE_WR_IDX_ADDR
  3560. * Bits 31:0
  3561. * Purpose: DDR address where IPA uC
  3562. * updates the WR Index for TX CE ring
  3563. * (needed for fusion platforms)
  3564. * - RX_IND_RING_BASE_ADDR
  3565. * Bits 31:0
  3566. * Purpose: RX Indication Ring base address in DDR
  3567. * - RX_IND_RING_SIZE
  3568. * Bits 31:0
  3569. * Purpose: RX Indication Ring size
  3570. * - RX_IND_RD_IDX_ADDR
  3571. * Bits 31:0
  3572. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3573. * RX indication ring
  3574. * - RX_IND_WR_IDX_ADDR
  3575. * Bits 31:0
  3576. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3577. * updates the Write Index for WDI_IPA RX indication ring
  3578. * - RX_RING2_BASE_ADDR
  3579. * Bits 31:0
  3580. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3581. * - RX_RING2_SIZE
  3582. * Bits 31:0
  3583. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3584. * - RX_RING2_RD_IDX_ADDR
  3585. * Bits 31:0
  3586. * Purpose: If Second RX ring is Indication ring, DDR address where
  3587. * IPA uC updates the Read Index for Ring2.
  3588. * If Second RX ring is completion ring, this is NOT used
  3589. * - RX_RING2_WR_IDX_ADDR
  3590. * Bits 31:0
  3591. * Purpose: If Second RX ring is Indication ring, DDR address where
  3592. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3593. * If second RX ring is completion ring, DDR address where
  3594. * IPA uC updates the Write Index for Ring 2.
  3595. * For systems using 64-bit format for bus addresses:
  3596. * - TX_COMP_RING_BASE_ADDR_LO
  3597. * Bits 31:0
  3598. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3599. * - TX_COMP_RING_BASE_ADDR_HI
  3600. * Bits 31:0
  3601. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3602. * - TX_COMP_RING_SIZE
  3603. * Bits 31:0
  3604. * Purpose: TX Completion Ring size (must be power of 2)
  3605. * - TX_COMP_WR_IDX_ADDR_LO
  3606. * Bits 31:0
  3607. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3608. * Lower 4 bytes of DDR address where WIFI FW
  3609. * updates the Write Index for WDI_IPA TX completion ring
  3610. * - TX_COMP_WR_IDX_ADDR_HI
  3611. * Bits 31:0
  3612. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3613. * Higher 4 bytes of DDR address where WIFI FW
  3614. * updates the Write Index for WDI_IPA TX completion ring
  3615. * - TX_CE_WR_IDX_ADDR_LO
  3616. * Bits 31:0
  3617. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3618. * updates the WR Index for TX CE ring
  3619. * (needed for fusion platforms)
  3620. * - TX_CE_WR_IDX_ADDR_HI
  3621. * Bits 31:0
  3622. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3623. * updates the WR Index for TX CE ring
  3624. * (needed for fusion platforms)
  3625. * - RX_IND_RING_BASE_ADDR_LO
  3626. * Bits 31:0
  3627. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3628. * - RX_IND_RING_BASE_ADDR_HI
  3629. * Bits 31:0
  3630. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3631. * - RX_IND_RING_SIZE
  3632. * Bits 31:0
  3633. * Purpose: RX Indication Ring size
  3634. * - RX_IND_RD_IDX_ADDR_LO
  3635. * Bits 31:0
  3636. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3637. * for WDI_IPA RX indication ring
  3638. * - RX_IND_RD_IDX_ADDR_HI
  3639. * Bits 31:0
  3640. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3641. * for WDI_IPA RX indication ring
  3642. * - RX_IND_WR_IDX_ADDR_LO
  3643. * Bits 31:0
  3644. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3645. * Lower 4 bytes of DDR address where WIFI FW
  3646. * updates the Write Index for WDI_IPA RX indication ring
  3647. * - RX_IND_WR_IDX_ADDR_HI
  3648. * Bits 31:0
  3649. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3650. * Higher 4 bytes of DDR address where WIFI FW
  3651. * updates the Write Index for WDI_IPA RX indication ring
  3652. * - RX_RING2_BASE_ADDR_LO
  3653. * Bits 31:0
  3654. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3655. * - RX_RING2_BASE_ADDR_HI
  3656. * Bits 31:0
  3657. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3658. * - RX_RING2_SIZE
  3659. * Bits 31:0
  3660. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3661. * - RX_RING2_RD_IDX_ADDR_LO
  3662. * Bits 31:0
  3663. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3664. * DDR address where IPA uC updates the Read Index for Ring2.
  3665. * If Second RX ring is completion ring, this is NOT used
  3666. * - RX_RING2_RD_IDX_ADDR_HI
  3667. * Bits 31:0
  3668. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3669. * DDR address where IPA uC updates the Read Index for Ring2.
  3670. * If Second RX ring is completion ring, this is NOT used
  3671. * - RX_RING2_WR_IDX_ADDR_LO
  3672. * Bits 31:0
  3673. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3674. * DDR address where WIFI FW updates the Write Index
  3675. * for WDI_IPA RX ring2
  3676. * If second RX ring is completion ring, lower 4 bytes of
  3677. * DDR address where IPA uC updates the Write Index for Ring 2.
  3678. * - RX_RING2_WR_IDX_ADDR_HI
  3679. * Bits 31:0
  3680. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3681. * DDR address where WIFI FW updates the Write Index
  3682. * for WDI_IPA RX ring2
  3683. * If second RX ring is completion ring, higher 4 bytes of
  3684. * DDR address where IPA uC updates the Write Index for Ring 2.
  3685. */
  3686. #if HTT_PADDR64
  3687. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3688. #else
  3689. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3690. #endif
  3691. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3692. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3695. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3698. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3699. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3700. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3701. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3702. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3705. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3706. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3707. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3708. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3709. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3710. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3711. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3712. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3715. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3718. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3719. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3720. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3721. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3722. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3725. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3726. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3727. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3728. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3729. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3730. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3731. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3732. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3752. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3753. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3754. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3755. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3756. do { \
  3757. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3758. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3759. } while (0)
  3760. /* for systems using 32-bit format for bus addr */
  3761. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3762. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3763. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3764. do { \
  3765. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3766. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3767. } while (0)
  3768. /* for systems using 64-bit format for bus addr */
  3769. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3770. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3771. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3772. do { \
  3773. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3774. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3775. } while (0)
  3776. /* for systems using 64-bit format for bus addr */
  3777. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3778. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3779. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3780. do { \
  3781. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3782. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3783. } while (0)
  3784. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3785. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3786. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3787. do { \
  3788. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3789. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3790. } while (0)
  3791. /* for systems using 32-bit format for bus addr */
  3792. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3793. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3794. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3795. do { \
  3796. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3797. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3798. } while (0)
  3799. /* for systems using 64-bit format for bus addr */
  3800. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3801. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3802. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3803. do { \
  3804. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3805. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3806. } while (0)
  3807. /* for systems using 64-bit format for bus addr */
  3808. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3809. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3810. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3811. do { \
  3812. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3813. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3814. } while (0)
  3815. /* for systems using 32-bit format for bus addr */
  3816. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3817. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3818. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3819. do { \
  3820. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3821. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3822. } while (0)
  3823. /* for systems using 64-bit format for bus addr */
  3824. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3825. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3826. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3827. do { \
  3828. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3829. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3830. } while (0)
  3831. /* for systems using 64-bit format for bus addr */
  3832. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3833. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3834. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3835. do { \
  3836. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3837. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3838. } while (0)
  3839. /* for systems using 32-bit format for bus addr */
  3840. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3841. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3842. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3843. do { \
  3844. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3845. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3846. } while (0)
  3847. /* for systems using 64-bit format for bus addr */
  3848. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3849. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3850. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3851. do { \
  3852. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3853. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3854. } while (0)
  3855. /* for systems using 64-bit format for bus addr */
  3856. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3857. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3858. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3859. do { \
  3860. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3861. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3862. } while (0)
  3863. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3864. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3865. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3866. do { \
  3867. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3868. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3869. } while (0)
  3870. /* for systems using 32-bit format for bus addr */
  3871. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3872. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3873. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3874. do { \
  3875. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3876. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3877. } while (0)
  3878. /* for systems using 64-bit format for bus addr */
  3879. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3880. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3881. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3882. do { \
  3883. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3884. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3885. } while (0)
  3886. /* for systems using 64-bit format for bus addr */
  3887. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3888. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3889. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3890. do { \
  3891. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3892. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3893. } while (0)
  3894. /* for systems using 32-bit format for bus addr */
  3895. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3896. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3897. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3898. do { \
  3899. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3900. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3901. } while (0)
  3902. /* for systems using 64-bit format for bus addr */
  3903. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3904. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3905. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3906. do { \
  3907. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3908. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3909. } while (0)
  3910. /* for systems using 64-bit format for bus addr */
  3911. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3912. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3913. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3914. do { \
  3915. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3916. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3917. } while (0)
  3918. /* for systems using 32-bit format for bus addr */
  3919. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3920. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3921. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3922. do { \
  3923. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3924. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3925. } while (0)
  3926. /* for systems using 64-bit format for bus addr */
  3927. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3928. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3929. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3930. do { \
  3931. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3932. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3933. } while (0)
  3934. /* for systems using 64-bit format for bus addr */
  3935. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3936. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3937. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3938. do { \
  3939. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3940. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3941. } while (0)
  3942. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3943. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3944. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3945. do { \
  3946. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3947. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3948. } while (0)
  3949. /* for systems using 32-bit format for bus addr */
  3950. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3951. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3952. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3953. do { \
  3954. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3955. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3956. } while (0)
  3957. /* for systems using 64-bit format for bus addr */
  3958. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3959. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3961. do { \
  3962. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3963. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3964. } while (0)
  3965. /* for systems using 64-bit format for bus addr */
  3966. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3967. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3969. do { \
  3970. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3971. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3972. } while (0)
  3973. /* for systems using 32-bit format for bus addr */
  3974. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3975. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3976. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3977. do { \
  3978. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3979. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3980. } while (0)
  3981. /* for systems using 64-bit format for bus addr */
  3982. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3983. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3984. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3985. do { \
  3986. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3987. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3988. } while (0)
  3989. /* for systems using 64-bit format for bus addr */
  3990. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3991. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3992. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3993. do { \
  3994. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3995. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3996. } while (0)
  3997. /*
  3998. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3999. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4000. * addresses are stored in a XXX-bit field.
  4001. * This macro is used to define both htt_wdi_ipa_config32_t and
  4002. * htt_wdi_ipa_config64_t structs.
  4003. */
  4004. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4005. _paddr__tx_comp_ring_base_addr_, \
  4006. _paddr__tx_comp_wr_idx_addr_, \
  4007. _paddr__tx_ce_wr_idx_addr_, \
  4008. _paddr__rx_ind_ring_base_addr_, \
  4009. _paddr__rx_ind_rd_idx_addr_, \
  4010. _paddr__rx_ind_wr_idx_addr_, \
  4011. _paddr__rx_ring2_base_addr_,\
  4012. _paddr__rx_ring2_rd_idx_addr_,\
  4013. _paddr__rx_ring2_wr_idx_addr_) \
  4014. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4015. { \
  4016. /* DWORD 0: flags and meta-data */ \
  4017. A_UINT32 \
  4018. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4019. reserved: 8, \
  4020. tx_pkt_pool_size: 16;\
  4021. /* DWORD 1 */\
  4022. _paddr__tx_comp_ring_base_addr_;\
  4023. /* DWORD 2 (or 3)*/\
  4024. A_UINT32 tx_comp_ring_size;\
  4025. /* DWORD 3 (or 4)*/\
  4026. _paddr__tx_comp_wr_idx_addr_;\
  4027. /* DWORD 4 (or 6)*/\
  4028. _paddr__tx_ce_wr_idx_addr_;\
  4029. /* DWORD 5 (or 8)*/\
  4030. _paddr__rx_ind_ring_base_addr_;\
  4031. /* DWORD 6 (or 10)*/\
  4032. A_UINT32 rx_ind_ring_size;\
  4033. /* DWORD 7 (or 11)*/\
  4034. _paddr__rx_ind_rd_idx_addr_;\
  4035. /* DWORD 8 (or 13)*/\
  4036. _paddr__rx_ind_wr_idx_addr_;\
  4037. /* DWORD 9 (or 15)*/\
  4038. _paddr__rx_ring2_base_addr_;\
  4039. /* DWORD 10 (or 17) */\
  4040. A_UINT32 rx_ring2_size;\
  4041. /* DWORD 11 (or 18) */\
  4042. _paddr__rx_ring2_rd_idx_addr_;\
  4043. /* DWORD 12 (or 20) */\
  4044. _paddr__rx_ring2_wr_idx_addr_;\
  4045. } POSTPACK
  4046. /* define a htt_wdi_ipa_config32_t type */
  4047. 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));
  4048. /* define a htt_wdi_ipa_config64_t type */
  4049. 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));
  4050. #if HTT_PADDR64
  4051. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4052. #else
  4053. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4054. #endif
  4055. enum htt_wdi_ipa_op_code {
  4056. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4057. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4058. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4059. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4060. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4061. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4062. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4063. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4064. /* keep this last */
  4065. HTT_WDI_IPA_OPCODE_MAX
  4066. };
  4067. /**
  4068. * @brief HTT WDI_IPA Operation Request Message
  4069. *
  4070. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4071. *
  4072. * @details
  4073. * HTT WDI_IPA Operation Request message is sent by host
  4074. * to either suspend or resume WDI_IPA TX or RX path.
  4075. * |31 24|23 16|15 8|7 0|
  4076. * |----------------+----------------+----------------+----------------|
  4077. * | op_code | Rsvd | msg_type |
  4078. * |-------------------------------------------------------------------|
  4079. *
  4080. * Header fields:
  4081. * - MSG_TYPE
  4082. * Bits 7:0
  4083. * Purpose: Identifies this as WDI_IPA Operation Request message
  4084. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4085. * - OP_CODE
  4086. * Bits 31:16
  4087. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4088. * value: = enum htt_wdi_ipa_op_code
  4089. */
  4090. PREPACK struct htt_wdi_ipa_op_request_t
  4091. {
  4092. /* DWORD 0: flags and meta-data */
  4093. A_UINT32
  4094. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4095. reserved: 8,
  4096. op_code: 16;
  4097. } POSTPACK;
  4098. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4099. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4100. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4101. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4102. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4103. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4106. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4107. } while (0)
  4108. /*
  4109. * @brief host -> target HTT_SRING_SETUP message
  4110. *
  4111. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4112. *
  4113. * @details
  4114. * After target is booted up, Host can send SRING setup message for
  4115. * each host facing LMAC SRING. Target setups up HW registers based
  4116. * on setup message and confirms back to Host if response_required is set.
  4117. * Host should wait for confirmation message before sending new SRING
  4118. * setup message
  4119. *
  4120. * The message would appear as follows:
  4121. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4122. * |--------------- +-----------------+-----------------+-----------------|
  4123. * | ring_type | ring_id | pdev_id | msg_type |
  4124. * |----------------------------------------------------------------------|
  4125. * | ring_base_addr_lo |
  4126. * |----------------------------------------------------------------------|
  4127. * | ring_base_addr_hi |
  4128. * |----------------------------------------------------------------------|
  4129. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4130. * |----------------------------------------------------------------------|
  4131. * | ring_head_offset32_remote_addr_lo |
  4132. * |----------------------------------------------------------------------|
  4133. * | ring_head_offset32_remote_addr_hi |
  4134. * |----------------------------------------------------------------------|
  4135. * | ring_tail_offset32_remote_addr_lo |
  4136. * |----------------------------------------------------------------------|
  4137. * | ring_tail_offset32_remote_addr_hi |
  4138. * |----------------------------------------------------------------------|
  4139. * | ring_msi_addr_lo |
  4140. * |----------------------------------------------------------------------|
  4141. * | ring_msi_addr_hi |
  4142. * |----------------------------------------------------------------------|
  4143. * | ring_msi_data |
  4144. * |----------------------------------------------------------------------|
  4145. * | intr_timer_th |IM| intr_batch_counter_th |
  4146. * |----------------------------------------------------------------------|
  4147. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4148. * |----------------------------------------------------------------------|
  4149. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4150. * |----------------------------------------------------------------------|
  4151. * Where
  4152. * IM = sw_intr_mode
  4153. * RR = response_required
  4154. * PTCF = prefetch_timer_cfg
  4155. * IP = IPA drop flag
  4156. *
  4157. * The message is interpreted as follows:
  4158. * dword0 - b'0:7 - msg_type: This will be set to
  4159. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4160. * b'8:15 - pdev_id:
  4161. * 0 (for rings at SOC/UMAC level),
  4162. * 1/2/3 mac id (for rings at LMAC level)
  4163. * b'16:23 - ring_id: identify which ring is to setup,
  4164. * more details can be got from enum htt_srng_ring_id
  4165. * b'24:31 - ring_type: identify type of host rings,
  4166. * more details can be got from enum htt_srng_ring_type
  4167. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4168. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4169. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4170. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4171. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4172. * SW_TO_HW_RING.
  4173. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4174. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4175. * Lower 32 bits of memory address of the remote variable
  4176. * storing the 4-byte word offset that identifies the head
  4177. * element within the ring.
  4178. * (The head offset variable has type A_UINT32.)
  4179. * Valid for HW_TO_SW and SW_TO_SW rings.
  4180. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4181. * Upper 32 bits of memory address of the remote variable
  4182. * storing the 4-byte word offset that identifies the head
  4183. * element within the ring.
  4184. * (The head offset variable has type A_UINT32.)
  4185. * Valid for HW_TO_SW and SW_TO_SW rings.
  4186. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4187. * Lower 32 bits of memory address of the remote variable
  4188. * storing the 4-byte word offset that identifies the tail
  4189. * element within the ring.
  4190. * (The tail offset variable has type A_UINT32.)
  4191. * Valid for HW_TO_SW and SW_TO_SW rings.
  4192. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4193. * Upper 32 bits of memory address of the remote variable
  4194. * storing the 4-byte word offset that identifies the tail
  4195. * element within the ring.
  4196. * (The tail offset variable has type A_UINT32.)
  4197. * Valid for HW_TO_SW and SW_TO_SW rings.
  4198. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4199. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4200. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4201. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4202. * dword10 - b'0:31 - ring_msi_data: MSI data
  4203. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4204. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4205. * dword11 - b'0:14 - intr_batch_counter_th:
  4206. * batch counter threshold is in units of 4-byte words.
  4207. * HW internally maintains and increments batch count.
  4208. * (see SRING spec for detail description).
  4209. * When batch count reaches threshold value, an interrupt
  4210. * is generated by HW.
  4211. * b'15 - sw_intr_mode:
  4212. * This configuration shall be static.
  4213. * Only programmed at power up.
  4214. * 0: generate pulse style sw interrupts
  4215. * 1: generate level style sw interrupts
  4216. * b'16:31 - intr_timer_th:
  4217. * The timer init value when timer is idle or is
  4218. * initialized to start downcounting.
  4219. * In 8us units (to cover a range of 0 to 524 ms)
  4220. * dword12 - b'0:15 - intr_low_threshold:
  4221. * Used only by Consumer ring to generate ring_sw_int_p.
  4222. * Ring entries low threshold water mark, that is used
  4223. * in combination with the interrupt timer as well as
  4224. * the the clearing of the level interrupt.
  4225. * b'16:18 - prefetch_timer_cfg:
  4226. * Used only by Consumer ring to set timer mode to
  4227. * support Application prefetch handling.
  4228. * The external tail offset/pointer will be updated
  4229. * at following intervals:
  4230. * 3'b000: (Prefetch feature disabled; used only for debug)
  4231. * 3'b001: 1 usec
  4232. * 3'b010: 4 usec
  4233. * 3'b011: 8 usec (default)
  4234. * 3'b100: 16 usec
  4235. * Others: Reserverd
  4236. * b'19 - response_required:
  4237. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4238. * b'20 - ipa_drop_flag:
  4239. Indicates that host will config ipa drop threshold percentage
  4240. * b'21:31 - reserved: reserved for future use
  4241. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4242. * b'8:15 - ipa drop high threshold percentage:
  4243. * b'16:31 - Reserved
  4244. */
  4245. PREPACK struct htt_sring_setup_t {
  4246. A_UINT32 msg_type: 8,
  4247. pdev_id: 8,
  4248. ring_id: 8,
  4249. ring_type: 8;
  4250. A_UINT32 ring_base_addr_lo;
  4251. A_UINT32 ring_base_addr_hi;
  4252. A_UINT32 ring_size: 16,
  4253. ring_entry_size: 8,
  4254. ring_misc_cfg_flag: 8;
  4255. A_UINT32 ring_head_offset32_remote_addr_lo;
  4256. A_UINT32 ring_head_offset32_remote_addr_hi;
  4257. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4258. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4259. A_UINT32 ring_msi_addr_lo;
  4260. A_UINT32 ring_msi_addr_hi;
  4261. A_UINT32 ring_msi_data;
  4262. A_UINT32 intr_batch_counter_th: 15,
  4263. sw_intr_mode: 1,
  4264. intr_timer_th: 16;
  4265. A_UINT32 intr_low_threshold: 16,
  4266. prefetch_timer_cfg: 3,
  4267. response_required: 1,
  4268. ipa_drop_flag: 1,
  4269. reserved1: 11;
  4270. A_UINT32 ipa_drop_low_threshold: 8,
  4271. ipa_drop_high_threshold: 8,
  4272. reserved: 16;
  4273. } POSTPACK;
  4274. enum htt_srng_ring_type {
  4275. HTT_HW_TO_SW_RING = 0,
  4276. HTT_SW_TO_HW_RING,
  4277. HTT_SW_TO_SW_RING,
  4278. /* Insert new ring types above this line */
  4279. };
  4280. enum htt_srng_ring_id {
  4281. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4282. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4283. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4284. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4285. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4286. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4287. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4288. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4289. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4290. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4291. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4292. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4293. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4294. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4295. HTT_RX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4296. /* Add Other SRING which can't be directly configured by host software above this line */
  4297. };
  4298. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4299. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4300. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4301. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4302. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4303. HTT_SRING_SETUP_PDEV_ID_S)
  4304. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4305. do { \
  4306. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4307. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4308. } while (0)
  4309. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4310. #define HTT_SRING_SETUP_RING_ID_S 16
  4311. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4312. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4313. HTT_SRING_SETUP_RING_ID_S)
  4314. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4315. do { \
  4316. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4317. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4318. } while (0)
  4319. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4320. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4321. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4322. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4323. HTT_SRING_SETUP_RING_TYPE_S)
  4324. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4325. do { \
  4326. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4327. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4328. } while (0)
  4329. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4330. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4331. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4332. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4333. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4334. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4335. do { \
  4336. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4337. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4338. } while (0)
  4339. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4340. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4341. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4342. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4343. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4344. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4345. do { \
  4346. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4347. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4348. } while (0)
  4349. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4350. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4351. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4352. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4353. HTT_SRING_SETUP_RING_SIZE_S)
  4354. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4355. do { \
  4356. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4357. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4358. } while (0)
  4359. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4360. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4361. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4362. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4363. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4364. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4365. do { \
  4366. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4367. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4368. } while (0)
  4369. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4370. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4371. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4372. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4373. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4374. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4375. do { \
  4376. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4377. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4378. } while (0)
  4379. /* This control bit is applicable to only Producer, which updates Ring ID field
  4380. * of each descriptor before pushing into the ring.
  4381. * 0: updates ring_id(default)
  4382. * 1: ring_id updating disabled */
  4383. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4384. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4385. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4386. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4387. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4388. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4389. do { \
  4390. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4391. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4392. } while (0)
  4393. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4394. * of each descriptor before pushing into the ring.
  4395. * 0: updates Loopcnt(default)
  4396. * 1: Loopcnt updating disabled */
  4397. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4398. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4399. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4400. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4401. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4402. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4403. do { \
  4404. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4405. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4406. } while (0)
  4407. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4408. * into security_id port of GXI/AXI. */
  4409. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4410. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4411. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4412. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4413. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4414. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4415. do { \
  4416. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4417. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4418. } while (0)
  4419. /* During MSI write operation, SRNG drives value of this register bit into
  4420. * swap bit of GXI/AXI. */
  4421. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4422. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4423. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4424. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4425. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4426. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4427. do { \
  4428. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4429. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4430. } while (0)
  4431. /* During Pointer write operation, SRNG drives value of this register bit into
  4432. * swap bit of GXI/AXI. */
  4433. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4434. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4435. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4436. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4437. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4438. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4439. do { \
  4440. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4441. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4442. } while (0)
  4443. /* During any data or TLV write operation, SRNG drives value of this register
  4444. * bit into swap bit of GXI/AXI. */
  4445. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4446. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4447. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4448. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4449. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4450. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4451. do { \
  4452. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4453. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4454. } while (0)
  4455. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4456. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4457. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4458. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4459. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4460. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4461. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4462. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4463. do { \
  4464. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4465. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4466. } while (0)
  4467. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4468. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4469. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4470. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4471. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4472. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4473. do { \
  4474. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4475. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4476. } while (0)
  4477. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4478. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4479. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4480. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4481. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4482. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4483. do { \
  4484. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4485. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4486. } while (0)
  4487. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4488. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4489. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4490. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4491. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4492. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4493. do { \
  4494. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4495. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4496. } while (0)
  4497. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4498. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4499. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4500. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4501. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4502. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4503. do { \
  4504. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4505. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4506. } while (0)
  4507. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4508. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4509. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4510. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4511. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4512. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4513. do { \
  4514. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4515. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4516. } while (0)
  4517. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4518. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4519. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4520. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4521. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4522. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4523. do { \
  4524. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4525. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4526. } while (0)
  4527. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4528. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4529. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4530. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4531. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4532. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4533. do { \
  4534. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4535. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4536. } while (0)
  4537. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4538. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4539. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4540. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4541. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4542. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4543. do { \
  4544. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4545. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4546. } while (0)
  4547. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4548. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4549. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4550. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4551. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4552. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4553. do { \
  4554. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4555. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4556. } while (0)
  4557. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4558. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4559. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4560. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4561. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4562. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4563. do { \
  4564. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4565. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4566. } while (0)
  4567. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4568. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4569. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4570. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4571. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4572. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4573. do { \
  4574. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4575. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4576. } while (0)
  4577. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4578. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4579. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4580. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4581. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4582. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4583. do { \
  4584. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4585. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4586. } while (0)
  4587. /**
  4588. * @brief host -> target RX ring selection config message
  4589. *
  4590. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4591. *
  4592. * @details
  4593. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4594. * configure RXDMA rings.
  4595. * The configuration is per ring based and includes both packet subtypes
  4596. * and PPDU/MPDU TLVs.
  4597. *
  4598. * The message would appear as follows:
  4599. *
  4600. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4601. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4602. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4603. * |-------------------------------------------------------------------|
  4604. * | rsvd2 | ring_buffer_size |
  4605. * |-------------------------------------------------------------------|
  4606. * | packet_type_enable_flags_0 |
  4607. * |-------------------------------------------------------------------|
  4608. * | packet_type_enable_flags_1 |
  4609. * |-------------------------------------------------------------------|
  4610. * | packet_type_enable_flags_2 |
  4611. * |-------------------------------------------------------------------|
  4612. * | packet_type_enable_flags_3 |
  4613. * |-------------------------------------------------------------------|
  4614. * | tlv_filter_in_flags |
  4615. * |-------------------------------------------------------------------|
  4616. * | rx_header_offset | rx_packet_offset |
  4617. * |-------------------------------------------------------------------|
  4618. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4619. * |-------------------------------------------------------------------|
  4620. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4621. * |-------------------------------------------------------------------|
  4622. * | rsvd3 | rx_attention_offset |
  4623. * |-------------------------------------------------------------------|
  4624. * | rsvd4 | mo| fp| rx_drop_threshold |
  4625. * | |ndp|ndp| |
  4626. * |-------------------------------------------------------------------|
  4627. * Where:
  4628. * PS = pkt_swap
  4629. * SS = status_swap
  4630. * OV = rx_offsets_valid
  4631. * DT = drop_thresh_valid
  4632. * The message is interpreted as follows:
  4633. * dword0 - b'0:7 - msg_type: This will be set to
  4634. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4635. * b'8:15 - pdev_id:
  4636. * 0 (for rings at SOC/UMAC level),
  4637. * 1/2/3 mac id (for rings at LMAC level)
  4638. * b'16:23 - ring_id : Identify the ring to configure.
  4639. * More details can be got from enum htt_srng_ring_id
  4640. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4641. * BUF_RING_CFG_0 defs within HW .h files,
  4642. * e.g. wmac_top_reg_seq_hwioreg.h
  4643. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4644. * BUF_RING_CFG_0 defs within HW .h files,
  4645. * e.g. wmac_top_reg_seq_hwioreg.h
  4646. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4647. * configuration fields are valid
  4648. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4649. * rx_drop_threshold field is valid
  4650. * b'28:31 - rsvd1: reserved for future use
  4651. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4652. * in byte units.
  4653. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4654. * - b'16:31 - rsvd2: Reserved for future use
  4655. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4656. * Enable MGMT packet from 0b0000 to 0b1001
  4657. * bits from low to high: FP, MD, MO - 3 bits
  4658. * FP: Filter_Pass
  4659. * MD: Monitor_Direct
  4660. * MO: Monitor_Other
  4661. * 10 mgmt subtypes * 3 bits -> 30 bits
  4662. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4663. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4664. * Enable MGMT packet from 0b1010 to 0b1111
  4665. * bits from low to high: FP, MD, MO - 3 bits
  4666. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4667. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4668. * Enable CTRL packet from 0b0000 to 0b1001
  4669. * bits from low to high: FP, MD, MO - 3 bits
  4670. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4671. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4672. * Enable CTRL packet from 0b1010 to 0b1111,
  4673. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4674. * bits from low to high: FP, MD, MO - 3 bits
  4675. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4676. * dword6 - b'0:31 - tlv_filter_in_flags:
  4677. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4678. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4679. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4680. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4681. * A value of 0 will be considered as ignore this config.
  4682. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4683. * e.g. wmac_top_reg_seq_hwioreg.h
  4684. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4685. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4686. * A value of 0 will be considered as ignore this config.
  4687. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4688. * e.g. wmac_top_reg_seq_hwioreg.h
  4689. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4690. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4691. * A value of 0 will be considered as ignore this config.
  4692. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4693. * e.g. wmac_top_reg_seq_hwioreg.h
  4694. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4695. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4696. * A value of 0 will be considered as ignore this config.
  4697. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4698. * e.g. wmac_top_reg_seq_hwioreg.h
  4699. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4700. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4701. * A value of 0 will be considered as ignore this config.
  4702. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4703. * e.g. wmac_top_reg_seq_hwioreg.h
  4704. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4705. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4706. * A value of 0 will be considered as ignore this config.
  4707. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4708. * e.g. wmac_top_reg_seq_hwioreg.h
  4709. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4710. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4711. * A value of 0 will be considered as ignore this config.
  4712. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4713. * e.g. wmac_top_reg_seq_hwioreg.h
  4714. * - b'16:31 - rsvd3 for future use
  4715. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4716. * to source rings. Consumer drops packets if the available
  4717. * words in the ring falls below the configured threshold
  4718. * value.
  4719. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4720. * by host. 1 -> subscribed
  4721. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4722. * by host. 1 -> subscribed
  4723. */
  4724. PREPACK struct htt_rx_ring_selection_cfg_t {
  4725. A_UINT32 msg_type: 8,
  4726. pdev_id: 8,
  4727. ring_id: 8,
  4728. status_swap: 1,
  4729. pkt_swap: 1,
  4730. rx_offsets_valid: 1,
  4731. drop_thresh_valid: 1,
  4732. rsvd1: 4;
  4733. A_UINT32 ring_buffer_size: 16,
  4734. rsvd2: 16;
  4735. A_UINT32 packet_type_enable_flags_0;
  4736. A_UINT32 packet_type_enable_flags_1;
  4737. A_UINT32 packet_type_enable_flags_2;
  4738. A_UINT32 packet_type_enable_flags_3;
  4739. A_UINT32 tlv_filter_in_flags;
  4740. A_UINT32 rx_packet_offset: 16,
  4741. rx_header_offset: 16;
  4742. A_UINT32 rx_mpdu_end_offset: 16,
  4743. rx_mpdu_start_offset: 16;
  4744. A_UINT32 rx_msdu_end_offset: 16,
  4745. rx_msdu_start_offset: 16;
  4746. A_UINT32 rx_attn_offset: 16,
  4747. rsvd3: 16;
  4748. A_UINT32 rx_drop_threshold: 10,
  4749. fp_ndp: 1,
  4750. mo_ndp: 1,
  4751. rsvd4: 20;
  4752. } POSTPACK;
  4753. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4754. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4755. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4756. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4757. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4758. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4759. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4760. do { \
  4761. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4762. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4763. } while (0)
  4764. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4765. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4766. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4767. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4768. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4769. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4770. do { \
  4771. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4772. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4773. } while (0)
  4774. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4775. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4776. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4777. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4778. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4779. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4780. do { \
  4781. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4782. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4783. } while (0)
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4786. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4787. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4788. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4789. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4790. do { \
  4791. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4792. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4793. } while (0)
  4794. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4795. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4796. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4797. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4798. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4799. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4800. do { \
  4801. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4802. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4803. } while (0)
  4804. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4805. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4806. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4807. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4808. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4809. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4810. do { \
  4811. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4812. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4813. } while (0)
  4814. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4815. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4816. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4817. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4818. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4819. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4820. do { \
  4821. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4822. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4823. } while (0)
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4827. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4828. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4830. do { \
  4831. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4832. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4833. } while (0)
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4837. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4838. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4840. do { \
  4841. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4842. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4843. } while (0)
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4847. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4848. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4850. do { \
  4851. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4852. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4853. } while (0)
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4857. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4858. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4860. do { \
  4861. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4862. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4863. } while (0)
  4864. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4865. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4866. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4867. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4868. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4869. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4870. do { \
  4871. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4872. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4873. } while (0)
  4874. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4875. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4876. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4877. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4878. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4879. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4880. do { \
  4881. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4882. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4883. } while (0)
  4884. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4885. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4886. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4887. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4888. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4889. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4890. do { \
  4891. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4892. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4893. } while (0)
  4894. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4895. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4896. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4897. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4898. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4899. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4900. do { \
  4901. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4902. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4903. } while (0)
  4904. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4905. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4906. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4907. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4908. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4909. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4910. do { \
  4911. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4912. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4913. } while (0)
  4914. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4915. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4916. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4917. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4918. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4919. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4920. do { \
  4921. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4922. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4923. } while (0)
  4924. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4925. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4926. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4927. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4928. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4929. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4930. do { \
  4931. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4932. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4933. } while (0)
  4934. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4935. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4936. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4937. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4938. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4939. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4940. do { \
  4941. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4942. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4943. } while (0)
  4944. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4945. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4946. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4947. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4948. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4949. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4950. do { \
  4951. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4952. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4953. } while (0)
  4954. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4955. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4956. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4957. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4958. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4959. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4960. do { \
  4961. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4962. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4963. } while (0)
  4964. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4965. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4966. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4967. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4968. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4969. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4970. do { \
  4971. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4972. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4973. } while (0)
  4974. /*
  4975. * Subtype based MGMT frames enable bits.
  4976. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4977. */
  4978. /* association request */
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4985. /* association response */
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4992. /* Reassociation request */
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4999. /* Reassociation response */
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5006. /* Probe request */
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5013. /* Probe response */
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5020. /* Timing Advertisement */
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5027. /* Reserved */
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5034. /* Beacon */
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5041. /* ATIM */
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5048. /* Disassociation */
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5055. /* Authentication */
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5062. /* Deauthentication */
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5069. /* Action */
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5076. /* Action No Ack */
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5083. /* Reserved */
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5090. /*
  5091. * Subtype based CTRL frames enable bits.
  5092. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5093. */
  5094. /* Reserved */
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5101. /* Reserved */
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5108. /* Reserved */
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5115. /* Reserved */
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5122. /* Reserved */
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5129. /* Reserved */
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5136. /* Reserved */
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5143. /* Control Wrapper */
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5150. /* Block Ack Request */
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5157. /* Block Ack*/
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5164. /* PS-POLL */
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5171. /* RTS */
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5178. /* CTS */
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5185. /* ACK */
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5192. /* CF-END */
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5199. /* CF-END + CF-ACK */
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5206. /* Multicast data */
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5213. /* Unicast data */
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5220. /* NULL data */
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5227. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5228. do { \
  5229. HTT_CHECK_SET_VAL(httsym, value); \
  5230. (word) |= (value) << httsym##_S; \
  5231. } while (0)
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5233. (((word) & httsym##_M) >> httsym##_S)
  5234. #define htt_rx_ring_pkt_enable_subtype_set( \
  5235. word, flag, mode, type, subtype, val) \
  5236. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5237. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5238. #define htt_rx_ring_pkt_enable_subtype_get( \
  5239. word, flag, mode, type, subtype) \
  5240. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5241. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5242. /* Definition to filter in TLVs */
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5263. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5264. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5266. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5267. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5268. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5269. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5270. do { \
  5271. HTT_CHECK_SET_VAL(httsym, enable); \
  5272. (word) |= (enable) << httsym##_S; \
  5273. } while (0)
  5274. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5275. (((word) & httsym##_M) >> httsym##_S)
  5276. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5277. HTT_RX_RING_TLV_ENABLE_SET( \
  5278. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5279. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5280. HTT_RX_RING_TLV_ENABLE_GET( \
  5281. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5282. /**
  5283. * @brief host -> target TX monitor config message
  5284. *
  5285. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5286. *
  5287. * @details
  5288. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5289. * configure RXDMA rings.
  5290. * The configuration is per ring based and includes both packet types
  5291. * and PPDU/MPDU TLVs.
  5292. *
  5293. * The message would appear as follows:
  5294. *
  5295. * |31 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5296. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5297. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5298. * |-----+--------+--------+-----+------+--------------------------------|
  5299. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5300. * |---------------------------------------------------------------+-----|
  5301. * | rsvd3 | E |
  5302. * |---------------------------------------------------------------------|
  5303. * | tlv_filter_mask_in0 |
  5304. * |---------------------------------------------------------------------|
  5305. * | tlv_filter_mask_in1 |
  5306. * |---------------------------------------------------------------------|
  5307. * | tlv_filter_mask_in2 |
  5308. * |---------------------------------------------------------------------|
  5309. * | tlv_filter_mask_in3 |
  5310. * |------------------------------------+--------------------------------|
  5311. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5312. * |------------------------------------+--------------------------------|
  5313. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5314. * |------------------------------------+--------------------------------|
  5315. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5316. * |-----------------------+-----+------+--------------------------------|
  5317. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5318. * |---------------------------------------------------------------------|
  5319. *
  5320. * Where:
  5321. * PS = pkt_swap
  5322. * SS = status_swap
  5323. * The message is interpreted as follows:
  5324. * dword0 - b'0:7 - msg_type: This will be set to
  5325. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5326. * b'8:15 - pdev_id:
  5327. * 0 (for rings at SOC/UMAC level),
  5328. * 1/2/3 mac id (for rings at LMAC level)
  5329. * b'16:23 - ring_id : Identify the ring to configure.
  5330. * More details can be got from enum htt_srng_ring_id
  5331. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5332. * BUF_RING_CFG_0 defs within HW .h files,
  5333. * e.g. wmac_top_reg_seq_hwioreg.h
  5334. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5335. * BUF_RING_CFG_0 defs within HW .h files,
  5336. * e.g. wmac_top_reg_seq_hwioreg.h
  5337. * b'26:31 - rsvd1: reserved for future use
  5338. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5339. * in byte units.
  5340. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5341. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5342. * Each bit out of 3 bits represents if configurable length
  5343. * is valid and needs to programmed.
  5344. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5345. * 64, 128, 256.
  5346. * If all 3 bits are set config length is > 256
  5347. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5348. * 64, 128, 256.
  5349. * If all 3 bits are set config length is > 256
  5350. * b'25:27 - config_length_data(DATA) for DATA: Each bit set represent
  5351. * 64, 128, 256.
  5352. * If all 3 bits are set config length is > 256
  5353. * - b'28:31 - rsvd2: Reserved for future use
  5354. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5355. * b'3:31 - rsvd3: Reserved for future use
  5356. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5357. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5358. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5359. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5360. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5361. * - b'16:31 - tx_peer_entry_word_mask:
  5362. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5363. * - b'16:31 - tx_msdu_start_word_mask:
  5364. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5365. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5366. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5367. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5368. * Each bit out of 3 bits represents if MSDU/MPDU
  5369. * logging is enabled
  5370. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5371. * 0 -> MSDU level logging is enabled
  5372. * (valid only if bit is set in
  5373. * pkt_type_msdu_or_mpdu_logging)
  5374. * 1 -> MPDU level logging is enabled
  5375. * (valid only if bit is set in
  5376. * pkt_type_msdu_or_mpdu_logging)
  5377. * - b'22:31 - rsvd4 for future use
  5378. */
  5379. PREPACK struct htt_tx_monitor_cfg_t {
  5380. A_UINT32 msg_type: 8,
  5381. pdev_id: 8,
  5382. ring_id: 8,
  5383. status_swap: 1,
  5384. pkt_swap: 1,
  5385. rsvd1: 6;
  5386. A_UINT32 ring_buffer_size: 16,
  5387. pkt_type_config_length: 3,
  5388. config_length_mgmt: 3,
  5389. config_length_ctrl: 3,
  5390. config_length_data: 3,
  5391. rsvd2: 4;
  5392. A_UINT32 pkt_type_enable_flags: 3,
  5393. rsvd3: 29;
  5394. A_UINT32 tlv_filter_mask_in0;
  5395. A_UINT32 tlv_filter_mask_in1;
  5396. A_UINT32 tlv_filter_mask_in2;
  5397. A_UINT32 tlv_filter_mask_in3;
  5398. A_UINT32 tx_fes_setup_word_mask: 16,
  5399. tx_peer_entry_word_mask: 16;
  5400. A_UINT32 tx_queue_ext_word_mask: 16,
  5401. tx_msdu_start_word_mask: 16;
  5402. A_UINT32 tx_mpdu_start_word_mask: 16,
  5403. pcu_ppdu_setup_word_mask: 16;
  5404. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5405. pkt_type_msdu_or_mpdu_logging: 3,
  5406. enable_msdu_or_mpdu_logging: 3,
  5407. rsvd4: 10;
  5408. } POSTPACK;
  5409. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5410. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5411. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5412. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5413. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5414. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5415. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5416. do { \
  5417. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5418. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5419. } while (0)
  5420. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5421. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5422. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5423. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5424. HTT_TX_MONITOR_CFG_RING_ID_S)
  5425. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5426. do { \
  5427. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5428. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5429. } while (0)
  5430. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5431. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5432. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5433. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5434. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5435. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5436. do { \
  5437. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5438. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5439. } while (0)
  5440. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5441. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5442. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5443. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5444. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5445. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5446. do { \
  5447. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5448. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5449. } while (0)
  5450. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5451. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5452. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5453. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5454. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5455. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5456. do { \
  5457. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5458. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5459. } while (0)
  5460. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5461. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5462. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5463. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5464. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5465. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5466. do { \
  5467. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5468. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5469. } while (0)
  5470. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5471. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5472. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5473. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5474. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5475. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5476. do { \
  5477. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5478. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5479. } while (0)
  5480. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5481. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5482. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5483. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5484. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5485. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5486. do { \
  5487. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5488. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5489. } while (0)
  5490. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5491. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5492. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5493. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5494. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5495. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5496. do { \
  5497. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5498. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5499. } while (0)
  5500. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5501. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5502. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5503. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5504. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5505. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5506. do { \
  5507. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5508. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5509. } while (0)
  5510. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5511. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5512. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5513. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5514. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5515. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5516. do { \
  5517. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5518. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5519. } while (0)
  5520. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5521. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5522. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5523. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5524. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5525. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5526. do { \
  5527. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5528. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5529. } while (0)
  5530. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5531. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5532. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5533. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5534. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5535. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5536. do { \
  5537. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5538. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5539. } while (0)
  5540. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5541. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5542. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5543. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5544. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5545. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5546. do { \
  5547. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5548. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5549. } while (0)
  5550. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5551. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5552. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5553. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5554. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5555. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5556. do { \
  5557. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5558. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5559. } while (0)
  5560. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5561. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5562. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5563. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5564. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5565. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5566. do { \
  5567. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5568. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5569. } while (0)
  5570. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5571. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5572. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5573. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5574. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5575. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5576. do { \
  5577. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5578. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5579. } while (0)
  5580. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5581. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5582. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5583. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5584. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5585. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5586. do { \
  5587. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5588. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5589. } while (0)
  5590. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5591. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5592. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5593. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5594. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5595. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5596. do { \
  5597. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5598. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5599. } while (0)
  5600. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5601. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5602. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5603. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5604. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5605. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5606. do { \
  5607. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5608. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5609. } while (0)
  5610. /*
  5611. * pkt_type_config_length
  5612. */
  5613. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5614. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5615. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5617. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5618. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5619. /*
  5620. * pkt_type_enable_flags
  5621. */
  5622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5628. /*
  5629. * pkt_type_msdu_or_mpdu_logging
  5630. * */
  5631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5638. do { \
  5639. HTT_CHECK_SET_VAL(httsym, value); \
  5640. (word) |= (value) << httsym##_S; \
  5641. } while (0)
  5642. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5643. (((word) & httsym##_M) >> httsym##_S)
  5644. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5645. * type -> MGMT, CTRL, DATA*/
  5646. #define htt_tx_ring_pkt_type_set( \
  5647. word, mode, type, val) \
  5648. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5649. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5650. #define htt_tx_ring_pkt_type_get( \
  5651. word, mode, type) \
  5652. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5653. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5654. /* Definition to filter in TLVs */
  5655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5719. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5720. do { \
  5721. HTT_CHECK_SET_VAL(httsym, enable); \
  5722. (word) |= (enable) << httsym##_S; \
  5723. } while (0)
  5724. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5725. (((word) & httsym##_M) >> httsym##_S)
  5726. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5727. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5728. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5729. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5730. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5731. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5796. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5797. do { \
  5798. HTT_CHECK_SET_VAL(httsym, enable); \
  5799. (word) |= (enable) << httsym##_S; \
  5800. } while (0)
  5801. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5802. (((word) & httsym##_M) >> httsym##_S)
  5803. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5804. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5805. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5806. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5807. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5808. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5873. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5874. do { \
  5875. HTT_CHECK_SET_VAL(httsym, enable); \
  5876. (word) |= (enable) << httsym##_S; \
  5877. } while (0)
  5878. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5879. (((word) & httsym##_M) >> httsym##_S)
  5880. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5881. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5882. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5883. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5884. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5885. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5930. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5931. do { \
  5932. HTT_CHECK_SET_VAL(httsym, enable); \
  5933. (word) |= (enable) << httsym##_S; \
  5934. } while (0)
  5935. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5936. (((word) & httsym##_M) >> httsym##_S)
  5937. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5938. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5939. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5940. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5941. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5942. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5943. /**
  5944. * @brief host --> target Receive Flow Steering configuration message definition
  5945. *
  5946. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5947. *
  5948. * host --> target Receive Flow Steering configuration message definition.
  5949. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5950. * The reason for this is we want RFS to be configured and ready before MAC
  5951. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5952. *
  5953. * |31 24|23 16|15 9|8|7 0|
  5954. * |----------------+----------------+----------------+----------------|
  5955. * | reserved |E| msg type |
  5956. * |-------------------------------------------------------------------|
  5957. * Where E = RFS enable flag
  5958. *
  5959. * The RFS_CONFIG message consists of a single 4-byte word.
  5960. *
  5961. * Header fields:
  5962. * - MSG_TYPE
  5963. * Bits 7:0
  5964. * Purpose: identifies this as a RFS config msg
  5965. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5966. * - RFS_CONFIG
  5967. * Bit 8
  5968. * Purpose: Tells target whether to enable (1) or disable (0)
  5969. * flow steering feature when sending rx indication messages to host
  5970. */
  5971. #define HTT_H2T_RFS_CONFIG_M 0x100
  5972. #define HTT_H2T_RFS_CONFIG_S 8
  5973. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5974. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5975. HTT_H2T_RFS_CONFIG_S)
  5976. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5977. do { \
  5978. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5979. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5980. } while (0)
  5981. #define HTT_RFS_CFG_REQ_BYTES 4
  5982. /**
  5983. * @brief host -> target FW extended statistics retrieve
  5984. *
  5985. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5986. *
  5987. * @details
  5988. * The following field definitions describe the format of the HTT host
  5989. * to target FW extended stats retrieve message.
  5990. * The message specifies the type of stats the host wants to retrieve.
  5991. *
  5992. * |31 24|23 16|15 8|7 0|
  5993. * |-----------------------------------------------------------|
  5994. * | reserved | stats type | pdev_mask | msg type |
  5995. * |-----------------------------------------------------------|
  5996. * | config param [0] |
  5997. * |-----------------------------------------------------------|
  5998. * | config param [1] |
  5999. * |-----------------------------------------------------------|
  6000. * | config param [2] |
  6001. * |-----------------------------------------------------------|
  6002. * | config param [3] |
  6003. * |-----------------------------------------------------------|
  6004. * | reserved |
  6005. * |-----------------------------------------------------------|
  6006. * | cookie LSBs |
  6007. * |-----------------------------------------------------------|
  6008. * | cookie MSBs |
  6009. * |-----------------------------------------------------------|
  6010. * Header fields:
  6011. * - MSG_TYPE
  6012. * Bits 7:0
  6013. * Purpose: identifies this is a extended stats upload request message
  6014. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6015. * - PDEV_MASK
  6016. * Bits 8:15
  6017. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6018. * Value: This is a overloaded field, refer to usage and interpretation of
  6019. * PDEV in interface document.
  6020. * Bit 8 : Reserved for SOC stats
  6021. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6022. * Indicates MACID_MASK in DBS
  6023. * - STATS_TYPE
  6024. * Bits 23:16
  6025. * Purpose: identifies which FW statistics to upload
  6026. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6027. * - Reserved
  6028. * Bits 31:24
  6029. * - CONFIG_PARAM [0]
  6030. * Bits 31:0
  6031. * Purpose: give an opaque configuration value to the specified stats type
  6032. * Value: stats-type specific configuration value
  6033. * Refer to htt_stats.h for interpretation for each stats sub_type
  6034. * - CONFIG_PARAM [1]
  6035. * Bits 31:0
  6036. * Purpose: give an opaque configuration value to the specified stats type
  6037. * Value: stats-type specific configuration value
  6038. * Refer to htt_stats.h for interpretation for each stats sub_type
  6039. * - CONFIG_PARAM [2]
  6040. * Bits 31:0
  6041. * Purpose: give an opaque configuration value to the specified stats type
  6042. * Value: stats-type specific configuration value
  6043. * Refer to htt_stats.h for interpretation for each stats sub_type
  6044. * - CONFIG_PARAM [3]
  6045. * Bits 31:0
  6046. * Purpose: give an opaque configuration value to the specified stats type
  6047. * Value: stats-type specific configuration value
  6048. * Refer to htt_stats.h for interpretation for each stats sub_type
  6049. * - Reserved [31:0] for future use.
  6050. * - COOKIE_LSBS
  6051. * Bits 31:0
  6052. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6053. * message with its preceding host->target stats request message.
  6054. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6055. * - COOKIE_MSBS
  6056. * Bits 31:0
  6057. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6058. * message with its preceding host->target stats request message.
  6059. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6060. */
  6061. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6062. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6063. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6064. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6065. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6066. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6067. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6068. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6069. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6070. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6071. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6072. do { \
  6073. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6074. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6075. } while (0)
  6076. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6077. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6078. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6079. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6080. do { \
  6081. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6082. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6083. } while (0)
  6084. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6085. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6086. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6087. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6088. do { \
  6089. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6090. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6091. } while (0)
  6092. /**
  6093. * @brief host -> target FW PPDU_STATS request message
  6094. *
  6095. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6096. *
  6097. * @details
  6098. * The following field definitions describe the format of the HTT host
  6099. * to target FW for PPDU_STATS_CFG msg.
  6100. * The message allows the host to configure the PPDU_STATS_IND messages
  6101. * produced by the target.
  6102. *
  6103. * |31 24|23 16|15 8|7 0|
  6104. * |-----------------------------------------------------------|
  6105. * | REQ bit mask | pdev_mask | msg type |
  6106. * |-----------------------------------------------------------|
  6107. * Header fields:
  6108. * - MSG_TYPE
  6109. * Bits 7:0
  6110. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6111. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6112. * - PDEV_MASK
  6113. * Bits 8:15
  6114. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6115. * Value: This is a overloaded field, refer to usage and interpretation of
  6116. * PDEV in interface document.
  6117. * Bit 8 : Reserved for SOC stats
  6118. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6119. * Indicates MACID_MASK in DBS
  6120. * - REQ_TLV_BIT_MASK
  6121. * Bits 16:31
  6122. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6123. * needs to be included in the target's PPDU_STATS_IND messages.
  6124. * Value: refer htt_ppdu_stats_tlv_tag_t
  6125. *
  6126. */
  6127. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6128. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6129. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6130. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6131. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6132. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6133. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6134. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6135. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6136. do { \
  6137. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6138. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6139. } while (0)
  6140. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6141. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6142. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6143. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6144. do { \
  6145. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6146. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6147. } while (0)
  6148. /**
  6149. * @brief Host-->target HTT RX FSE setup message
  6150. *
  6151. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6152. *
  6153. * @details
  6154. * Through this message, the host will provide details of the flow tables
  6155. * in host DDR along with hash keys.
  6156. * This message can be sent per SOC or per PDEV, which is differentiated
  6157. * by pdev id values.
  6158. * The host will allocate flow search table and sends table size,
  6159. * physical DMA address of flow table, and hash keys to firmware to
  6160. * program into the RXOLE FSE HW block.
  6161. *
  6162. * The following field definitions describe the format of the RX FSE setup
  6163. * message sent from the host to target
  6164. *
  6165. * Header fields:
  6166. * dword0 - b'7:0 - msg_type: This will be set to
  6167. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6168. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6169. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6170. * pdev's LMAC ring.
  6171. * b'31:16 - reserved : Reserved for future use
  6172. * dword1 - b'19:0 - number of records: This field indicates the number of
  6173. * entries in the flow table. For example: 8k number of
  6174. * records is equivalent to
  6175. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6176. * b'27:20 - max search: This field specifies the skid length to FSE
  6177. * parser HW module whenever match is not found at the
  6178. * exact index pointed by hash.
  6179. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6180. * Refer htt_ip_da_sa_prefix below for more details.
  6181. * b'31:30 - reserved: Reserved for future use
  6182. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6183. * table allocated by host in DDR
  6184. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6185. * table allocated by host in DDR
  6186. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6187. * entry hashing
  6188. *
  6189. *
  6190. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6191. * |---------------------------------------------------------------|
  6192. * | reserved | pdev_id | MSG_TYPE |
  6193. * |---------------------------------------------------------------|
  6194. * |resvd|IPDSA| max_search | Number of records |
  6195. * |---------------------------------------------------------------|
  6196. * | base address lo |
  6197. * |---------------------------------------------------------------|
  6198. * | base address high |
  6199. * |---------------------------------------------------------------|
  6200. * | toeplitz key 31_0 |
  6201. * |---------------------------------------------------------------|
  6202. * | toeplitz key 63_32 |
  6203. * |---------------------------------------------------------------|
  6204. * | toeplitz key 95_64 |
  6205. * |---------------------------------------------------------------|
  6206. * | toeplitz key 127_96 |
  6207. * |---------------------------------------------------------------|
  6208. * | toeplitz key 159_128 |
  6209. * |---------------------------------------------------------------|
  6210. * | toeplitz key 191_160 |
  6211. * |---------------------------------------------------------------|
  6212. * | toeplitz key 223_192 |
  6213. * |---------------------------------------------------------------|
  6214. * | toeplitz key 255_224 |
  6215. * |---------------------------------------------------------------|
  6216. * | toeplitz key 287_256 |
  6217. * |---------------------------------------------------------------|
  6218. * | reserved | toeplitz key 314_288(26:0 bits) |
  6219. * |---------------------------------------------------------------|
  6220. * where:
  6221. * IPDSA = ip_da_sa
  6222. */
  6223. /**
  6224. * @brief: htt_ip_da_sa_prefix
  6225. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6226. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6227. * documentation per RFC3849
  6228. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6229. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6230. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6231. */
  6232. enum htt_ip_da_sa_prefix {
  6233. HTT_RX_IPV6_20010db8,
  6234. HTT_RX_IPV4_MAPPED_IPV6,
  6235. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6236. HTT_RX_IPV6_64FF9B,
  6237. };
  6238. /**
  6239. * @brief Host-->target HTT RX FISA configure and enable
  6240. *
  6241. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6242. *
  6243. * @details
  6244. * The host will send this command down to configure and enable the FISA
  6245. * operational params.
  6246. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6247. * register.
  6248. * Should configure both the MACs.
  6249. *
  6250. * dword0 - b'7:0 - msg_type:
  6251. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6252. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6253. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6254. * pdev's LMAC ring.
  6255. * b'31:16 - reserved : Reserved for future use
  6256. *
  6257. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6258. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6259. * packets. 1 flow search will be skipped
  6260. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6261. * tcp,udp packets
  6262. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6263. * calculation
  6264. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6265. * calculation
  6266. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6267. * calculation
  6268. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6269. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6270. * length
  6271. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6272. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6273. * length
  6274. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6275. * num jump
  6276. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6277. * num jump
  6278. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6279. * data type switch has happend for MPDU Sequence num jump
  6280. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6281. * for MPDU Sequence num jump
  6282. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6283. * for decrypt errors
  6284. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6285. * while aggregating a msdu
  6286. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6287. * The aggregation is done until (number of MSDUs aggregated
  6288. * < LIMIT + 1)
  6289. * b'31:18 - Reserved
  6290. *
  6291. * fisa_control_value - 32bit value FW can write to register
  6292. *
  6293. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6294. * Threshold value for FISA timeout (units are microseconds).
  6295. * When the global timestamp exceeds this threshold, FISA
  6296. * aggregation will be restarted.
  6297. * A value of 0 means timeout is disabled.
  6298. * Compare the threshold register with timestamp field in
  6299. * flow entry to generate timeout for the flow.
  6300. *
  6301. * |31 18 |17 16|15 8|7 0|
  6302. * |-------------------------------------------------------------|
  6303. * | reserved | pdev_mask | msg type |
  6304. * |-------------------------------------------------------------|
  6305. * | reserved | FISA_CTRL |
  6306. * |-------------------------------------------------------------|
  6307. * | FISA_TIMEOUT_THRESH |
  6308. * |-------------------------------------------------------------|
  6309. */
  6310. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6311. A_UINT32 msg_type:8,
  6312. pdev_id:8,
  6313. reserved0:16;
  6314. /**
  6315. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6316. * [17:0]
  6317. */
  6318. union {
  6319. /*
  6320. * fisa_control_bits structure is deprecated.
  6321. * Please use fisa_control_bits_v2 going forward.
  6322. */
  6323. struct {
  6324. A_UINT32 fisa_enable: 1,
  6325. ipsec_skip_search: 1,
  6326. nontcp_skip_search: 1,
  6327. add_ipv4_fixed_hdr_len: 1,
  6328. add_ipv6_fixed_hdr_len: 1,
  6329. add_tcp_fixed_hdr_len: 1,
  6330. add_udp_hdr_len: 1,
  6331. chksum_cum_ip_len_en: 1,
  6332. disable_tid_check: 1,
  6333. disable_ta_check: 1,
  6334. disable_qos_check: 1,
  6335. disable_raw_check: 1,
  6336. disable_decrypt_err_check: 1,
  6337. disable_msdu_drop_check: 1,
  6338. fisa_aggr_limit: 4,
  6339. reserved: 14;
  6340. } fisa_control_bits;
  6341. struct {
  6342. A_UINT32 fisa_enable: 1,
  6343. fisa_aggr_limit: 4,
  6344. reserved: 27;
  6345. } fisa_control_bits_v2;
  6346. A_UINT32 fisa_control_value;
  6347. } u_fisa_control;
  6348. /**
  6349. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6350. * timeout threshold for aggregation. Unit in usec.
  6351. * [31:0]
  6352. */
  6353. A_UINT32 fisa_timeout_threshold;
  6354. } POSTPACK;
  6355. /* DWord 0: pdev-ID */
  6356. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6357. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6358. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6359. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6360. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6361. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6364. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6365. } while (0)
  6366. /* Dword 1: fisa_control_value fisa config */
  6367. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6368. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6369. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6370. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6371. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6372. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6373. do { \
  6374. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6375. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6376. } while (0)
  6377. /* Dword 1: fisa_control_value ipsec_skip_search */
  6378. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6379. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6380. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6381. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6382. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6383. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6384. do { \
  6385. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6386. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6387. } while (0)
  6388. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6389. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6390. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6391. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6392. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6393. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6394. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6395. do { \
  6396. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6397. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6398. } while (0)
  6399. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6400. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6401. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6402. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6403. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6404. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6405. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6406. do { \
  6407. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6408. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6409. } while (0)
  6410. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6411. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6412. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6413. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6414. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6415. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6416. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6417. do { \
  6418. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6419. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6420. } while (0)
  6421. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6422. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6423. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6424. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6425. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6426. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6427. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6428. do { \
  6429. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6430. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6431. } while (0)
  6432. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6433. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6434. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6435. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6436. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6437. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6438. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6441. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6442. } while (0)
  6443. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6444. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6445. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6446. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6447. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6448. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6449. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6450. do { \
  6451. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6452. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6453. } while (0)
  6454. /* Dword 1: fisa_control_value disable_tid_check */
  6455. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6456. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6457. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6458. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6459. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6460. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6461. do { \
  6462. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6463. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6464. } while (0)
  6465. /* Dword 1: fisa_control_value disable_ta_check */
  6466. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6467. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6468. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6469. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6470. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6471. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6472. do { \
  6473. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6474. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6475. } while (0)
  6476. /* Dword 1: fisa_control_value disable_qos_check */
  6477. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6478. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6479. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6480. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6481. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6482. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6483. do { \
  6484. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6485. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6486. } while (0)
  6487. /* Dword 1: fisa_control_value disable_raw_check */
  6488. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6489. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6490. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6491. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6492. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6493. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6496. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6497. } while (0)
  6498. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6499. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6500. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6501. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6502. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6503. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6504. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6505. do { \
  6506. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6507. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6508. } while (0)
  6509. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6510. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6511. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6512. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6513. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6514. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6515. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6518. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6519. } while (0)
  6520. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6521. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6522. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6523. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6524. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6525. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6526. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6527. do { \
  6528. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6529. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6530. } while (0)
  6531. /* Dword 1: fisa_control_value fisa config */
  6532. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6533. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6534. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6535. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6536. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6537. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6538. do { \
  6539. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6540. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6541. } while (0)
  6542. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6543. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6544. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6545. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6546. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6547. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6548. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6551. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6552. } while (0)
  6553. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6554. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6555. pdev_id:8,
  6556. reserved0:16;
  6557. A_UINT32 num_records:20,
  6558. max_search:8,
  6559. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6560. reserved1:2;
  6561. A_UINT32 base_addr_lo;
  6562. A_UINT32 base_addr_hi;
  6563. A_UINT32 toeplitz31_0;
  6564. A_UINT32 toeplitz63_32;
  6565. A_UINT32 toeplitz95_64;
  6566. A_UINT32 toeplitz127_96;
  6567. A_UINT32 toeplitz159_128;
  6568. A_UINT32 toeplitz191_160;
  6569. A_UINT32 toeplitz223_192;
  6570. A_UINT32 toeplitz255_224;
  6571. A_UINT32 toeplitz287_256;
  6572. A_UINT32 toeplitz314_288:27,
  6573. reserved2:5;
  6574. } POSTPACK;
  6575. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6576. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6577. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6578. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6579. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6580. /* DWORD 0: Pdev ID */
  6581. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6582. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6583. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6584. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6585. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6586. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6587. do { \
  6588. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6589. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6590. } while (0)
  6591. /* DWORD 1:num of records */
  6592. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6593. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6594. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6595. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6596. HTT_RX_FSE_SETUP_NUM_REC_S)
  6597. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6598. do { \
  6599. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6600. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6601. } while (0)
  6602. /* DWORD 1:max_search */
  6603. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6604. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6605. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6606. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6607. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6608. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6609. do { \
  6610. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6611. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6612. } while (0)
  6613. /* DWORD 1:ip_da_sa prefix */
  6614. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6615. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6616. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6617. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6618. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6619. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6620. do { \
  6621. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6622. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6623. } while (0)
  6624. /* DWORD 2: Base Address LO */
  6625. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6626. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6627. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6628. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6629. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6630. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6631. do { \
  6632. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6633. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6634. } while (0)
  6635. /* DWORD 3: Base Address High */
  6636. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6637. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6638. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6639. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6640. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6641. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6642. do { \
  6643. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6644. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6645. } while (0)
  6646. /* DWORD 4-12: Hash Value */
  6647. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6648. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6649. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6650. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6651. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6652. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6653. do { \
  6654. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6655. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6656. } while (0)
  6657. /* DWORD 13: Hash Value 314:288 bits */
  6658. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6659. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6660. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6661. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6662. do { \
  6663. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6664. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6665. } while (0)
  6666. /**
  6667. * @brief Host-->target HTT RX FSE operation message
  6668. *
  6669. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6670. *
  6671. * @details
  6672. * The host will send this Flow Search Engine (FSE) operation message for
  6673. * every flow add/delete operation.
  6674. * The FSE operation includes FSE full cache invalidation or individual entry
  6675. * invalidation.
  6676. * This message can be sent per SOC or per PDEV which is differentiated
  6677. * by pdev id values.
  6678. *
  6679. * |31 16|15 8|7 1|0|
  6680. * |-------------------------------------------------------------|
  6681. * | reserved | pdev_id | MSG_TYPE |
  6682. * |-------------------------------------------------------------|
  6683. * | reserved | operation |I|
  6684. * |-------------------------------------------------------------|
  6685. * | ip_src_addr_31_0 |
  6686. * |-------------------------------------------------------------|
  6687. * | ip_src_addr_63_32 |
  6688. * |-------------------------------------------------------------|
  6689. * | ip_src_addr_95_64 |
  6690. * |-------------------------------------------------------------|
  6691. * | ip_src_addr_127_96 |
  6692. * |-------------------------------------------------------------|
  6693. * | ip_dst_addr_31_0 |
  6694. * |-------------------------------------------------------------|
  6695. * | ip_dst_addr_63_32 |
  6696. * |-------------------------------------------------------------|
  6697. * | ip_dst_addr_95_64 |
  6698. * |-------------------------------------------------------------|
  6699. * | ip_dst_addr_127_96 |
  6700. * |-------------------------------------------------------------|
  6701. * | l4_dst_port | l4_src_port |
  6702. * | (32-bit SPI incase of IPsec) |
  6703. * |-------------------------------------------------------------|
  6704. * | reserved | l4_proto |
  6705. * |-------------------------------------------------------------|
  6706. *
  6707. * where I is 1-bit ipsec_valid.
  6708. *
  6709. * The following field definitions describe the format of the RX FSE operation
  6710. * message sent from the host to target for every add/delete flow entry to flow
  6711. * table.
  6712. *
  6713. * Header fields:
  6714. * dword0 - b'7:0 - msg_type: This will be set to
  6715. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6716. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6717. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6718. * specified pdev's LMAC ring.
  6719. * b'31:16 - reserved : Reserved for future use
  6720. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6721. * (Internet Protocol Security).
  6722. * IPsec describes the framework for providing security at
  6723. * IP layer. IPsec is defined for both versions of IP:
  6724. * IPV4 and IPV6.
  6725. * Please refer to htt_rx_flow_proto enumeration below for
  6726. * more info.
  6727. * ipsec_valid = 1 for IPSEC packets
  6728. * ipsec_valid = 0 for IP Packets
  6729. * b'7:1 - operation: This indicates types of FSE operation.
  6730. * Refer to htt_rx_fse_operation enumeration:
  6731. * 0 - No Cache Invalidation required
  6732. * 1 - Cache invalidate only one entry given by IP
  6733. * src/dest address at DWORD[2:9]
  6734. * 2 - Complete FSE Cache Invalidation
  6735. * 3 - FSE Disable
  6736. * 4 - FSE Enable
  6737. * b'31:8 - reserved: Reserved for future use
  6738. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6739. * for per flow addition/deletion
  6740. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6741. * and the subsequent 3 A_UINT32 will be padding bytes.
  6742. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6743. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6744. * from 0 to 65535 but only 0 to 1023 are designated as
  6745. * well-known ports. Refer to [RFC1700] for more details.
  6746. * This field is valid only if
  6747. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6748. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6749. * range from 0 to 65535 but only 0 to 1023 are designated
  6750. * as well-known ports. Refer to [RFC1700] for more details.
  6751. * This field is valid only if
  6752. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6753. * - SPI (31:0): Security Parameters Index is an
  6754. * identification tag added to the header while using IPsec
  6755. * for tunneling the IP traffici.
  6756. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6757. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6758. * Assigned Internet Protocol Numbers.
  6759. * l4_proto numbers for standard protocol like UDP/TCP
  6760. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6761. * l4_proto = 17 for UDP etc.
  6762. * b'31:8 - reserved: Reserved for future use.
  6763. *
  6764. */
  6765. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6766. A_UINT32 msg_type:8,
  6767. pdev_id:8,
  6768. reserved0:16;
  6769. A_UINT32 ipsec_valid:1,
  6770. operation:7,
  6771. reserved1:24;
  6772. A_UINT32 ip_src_addr_31_0;
  6773. A_UINT32 ip_src_addr_63_32;
  6774. A_UINT32 ip_src_addr_95_64;
  6775. A_UINT32 ip_src_addr_127_96;
  6776. A_UINT32 ip_dest_addr_31_0;
  6777. A_UINT32 ip_dest_addr_63_32;
  6778. A_UINT32 ip_dest_addr_95_64;
  6779. A_UINT32 ip_dest_addr_127_96;
  6780. union {
  6781. A_UINT32 spi;
  6782. struct {
  6783. A_UINT32 l4_src_port:16,
  6784. l4_dest_port:16;
  6785. } ip;
  6786. } u;
  6787. A_UINT32 l4_proto:8,
  6788. reserved:24;
  6789. } POSTPACK;
  6790. /**
  6791. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6792. *
  6793. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6794. *
  6795. * @details
  6796. * The host will send this Full monitor mode register configuration message.
  6797. * This message can be sent per SOC or per PDEV which is differentiated
  6798. * by pdev id values.
  6799. *
  6800. * |31 16|15 11|10 8|7 3|2|1|0|
  6801. * |-------------------------------------------------------------|
  6802. * | reserved | pdev_id | MSG_TYPE |
  6803. * |-------------------------------------------------------------|
  6804. * | reserved |Release Ring |N|Z|E|
  6805. * |-------------------------------------------------------------|
  6806. *
  6807. * where E is 1-bit full monitor mode enable/disable.
  6808. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6809. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6810. *
  6811. * The following field definitions describe the format of the full monitor
  6812. * mode configuration message sent from the host to target for each pdev.
  6813. *
  6814. * Header fields:
  6815. * dword0 - b'7:0 - msg_type: This will be set to
  6816. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6817. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6818. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6819. * specified pdev's LMAC ring.
  6820. * b'31:16 - reserved : Reserved for future use.
  6821. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6822. * monitor mode rxdma register is to be enabled or disabled.
  6823. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6824. * additional descriptors at ppdu end for zero mpdus
  6825. * enabled or disabled.
  6826. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6827. * additional descriptors at ppdu end for non zero mpdus
  6828. * enabled or disabled.
  6829. * b'10:3 - release_ring: This indicates the destination ring
  6830. * selection for the descriptor at the end of PPDU
  6831. * 0 - REO ring select
  6832. * 1 - FW ring select
  6833. * 2 - SW ring select
  6834. * 3 - Release ring select
  6835. * Refer to htt_rx_full_mon_release_ring.
  6836. * b'31:11 - reserved for future use
  6837. */
  6838. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6839. A_UINT32 msg_type:8,
  6840. pdev_id:8,
  6841. reserved0:16;
  6842. A_UINT32 full_monitor_mode_enable:1,
  6843. addnl_descs_zero_mpdus_end:1,
  6844. addnl_descs_non_zero_mpdus_end:1,
  6845. release_ring:8,
  6846. reserved1:21;
  6847. } POSTPACK;
  6848. /**
  6849. * Enumeration for full monitor mode destination ring select
  6850. * 0 - REO destination ring select
  6851. * 1 - FW destination ring select
  6852. * 2 - SW destination ring select
  6853. * 3 - Release destination ring select
  6854. */
  6855. enum htt_rx_full_mon_release_ring {
  6856. HTT_RX_MON_RING_REO,
  6857. HTT_RX_MON_RING_FW,
  6858. HTT_RX_MON_RING_SW,
  6859. HTT_RX_MON_RING_RELEASE,
  6860. };
  6861. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6862. /* DWORD 0: Pdev ID */
  6863. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6864. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6865. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6866. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6867. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6868. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6869. do { \
  6870. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6871. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6872. } while (0)
  6873. /* DWORD 1:ENABLE */
  6874. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6875. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6876. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6877. do { \
  6878. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6879. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6880. } while (0)
  6881. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6882. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6883. /* DWORD 1:ZERO_MPDU */
  6884. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6885. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6886. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6887. do { \
  6888. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6889. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6890. } while (0)
  6891. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6892. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6893. /* DWORD 1:NON_ZERO_MPDU */
  6894. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6895. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6896. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6897. do { \
  6898. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6899. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6900. } while (0)
  6901. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6902. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6903. /* DWORD 1:RELEASE_RINGS */
  6904. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6905. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6906. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6907. do { \
  6908. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6909. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6910. } while (0)
  6911. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6912. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6913. /**
  6914. * Enumeration for IP Protocol or IPSEC Protocol
  6915. * IPsec describes the framework for providing security at IP layer.
  6916. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6917. */
  6918. enum htt_rx_flow_proto {
  6919. HTT_RX_FLOW_IP_PROTO,
  6920. HTT_RX_FLOW_IPSEC_PROTO,
  6921. };
  6922. /**
  6923. * Enumeration for FSE Cache Invalidation
  6924. * 0 - No Cache Invalidation required
  6925. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6926. * 2 - Complete FSE Cache Invalidation
  6927. * 3 - FSE Disable
  6928. * 4 - FSE Enable
  6929. */
  6930. enum htt_rx_fse_operation {
  6931. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6932. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6933. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6934. HTT_RX_FSE_DISABLE,
  6935. HTT_RX_FSE_ENABLE,
  6936. };
  6937. /* DWORD 0: Pdev ID */
  6938. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6939. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6940. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6941. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6942. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6943. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6944. do { \
  6945. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6946. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6947. } while (0)
  6948. /* DWORD 1:IP PROTO or IPSEC */
  6949. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6950. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6951. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6952. do { \
  6953. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6954. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6955. } while (0)
  6956. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6957. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6958. /* DWORD 1:FSE Operation */
  6959. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6960. #define HTT_RX_FSE_OPERATION_S 1
  6961. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6962. do { \
  6963. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6964. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6965. } while (0)
  6966. #define HTT_RX_FSE_OPERATION_GET(word) \
  6967. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6968. /* DWORD 2-9:IP Address */
  6969. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6970. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6971. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6972. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6973. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6974. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6975. do { \
  6976. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6977. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6978. } while (0)
  6979. /* DWORD 10:Source Port Number */
  6980. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6981. #define HTT_RX_FSE_SOURCEPORT_S 0
  6982. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6983. do { \
  6984. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6985. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6986. } while (0)
  6987. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6988. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6989. /* DWORD 11:Destination Port Number */
  6990. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6991. #define HTT_RX_FSE_DESTPORT_S 16
  6992. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6993. do { \
  6994. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6995. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6996. } while (0)
  6997. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6998. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6999. /* DWORD 10-11:SPI (In case of IPSEC) */
  7000. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7001. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7002. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7003. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7004. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7005. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7006. do { \
  7007. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7008. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7009. } while (0)
  7010. /* DWORD 12:L4 PROTO */
  7011. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7012. #define HTT_RX_FSE_L4_PROTO_S 0
  7013. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7014. do { \
  7015. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7016. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7017. } while (0)
  7018. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7019. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7020. /**
  7021. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7022. *
  7023. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7024. *
  7025. * |31 24|23 |15 8|7 2|1|0|
  7026. * |----------------+----------------+----------------+----------------|
  7027. * | reserved | pdev_id | msg_type |
  7028. * |---------------------------------+----------------+----------------|
  7029. * | reserved |E|F|
  7030. * |---------------------------------+----------------+----------------|
  7031. * Where E = Configure the target to provide the 3-tuple hash value in
  7032. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7033. * F = Configure the target to provide the 3-tuple hash value in
  7034. * flow_id_toeplitz field of rx_msdu_start tlv
  7035. *
  7036. * The following field definitions describe the format of the 3 tuple hash value
  7037. * message sent from the host to target as part of initialization sequence.
  7038. *
  7039. * Header fields:
  7040. * dword0 - b'7:0 - msg_type: This will be set to
  7041. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7042. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7043. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7044. * specified pdev's LMAC ring.
  7045. * b'31:16 - reserved : Reserved for future use
  7046. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7047. * b'1 - toeplitz_hash_2_or_4_field_enable
  7048. * b'31:2 - reserved : Reserved for future use
  7049. * ---------+------+----------------------------------------------------------
  7050. * bit1 | bit0 | Functionality
  7051. * ---------+------+----------------------------------------------------------
  7052. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7053. * | | in flow_id_toeplitz field
  7054. * ---------+------+----------------------------------------------------------
  7055. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7056. * | | in toeplitz_hash_2_or_4 field
  7057. * ---------+------+----------------------------------------------------------
  7058. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7059. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7060. * ---------+------+----------------------------------------------------------
  7061. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7062. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7063. * | | toeplitz_hash_2_or_4 field
  7064. *----------------------------------------------------------------------------
  7065. */
  7066. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7067. A_UINT32 msg_type :8,
  7068. pdev_id :8,
  7069. reserved0 :16;
  7070. A_UINT32 flow_id_toeplitz_field_enable :1,
  7071. toeplitz_hash_2_or_4_field_enable :1,
  7072. reserved1 :30;
  7073. } POSTPACK;
  7074. /* DWORD0 : pdev_id configuration Macros */
  7075. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7076. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7077. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7078. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7079. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7080. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7081. do { \
  7082. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7083. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7084. } while (0)
  7085. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7086. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7087. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7088. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7089. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7090. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7091. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7092. do { \
  7093. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7094. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7095. } while (0)
  7096. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7097. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7098. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7099. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7100. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7101. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7102. do { \
  7103. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7104. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7105. } while (0)
  7106. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7107. /**
  7108. * @brief host --> target Host PA Address Size
  7109. *
  7110. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7111. *
  7112. * @details
  7113. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7114. * provide the physical start address and size of each of the memory
  7115. * areas within host DDR that the target FW may need to access.
  7116. *
  7117. * For example, the host can use this message to allow the target FW
  7118. * to set up access to the host's pools of TQM link descriptors.
  7119. * The message would appear as follows:
  7120. *
  7121. * |31 24|23 16|15 8|7 0|
  7122. * |----------------+----------------+----------------+----------------|
  7123. * | reserved | num_entries | msg_type |
  7124. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7125. * | mem area 0 size |
  7126. * |----------------+----------------+----------------+----------------|
  7127. * | mem area 0 physical_address_lo |
  7128. * |----------------+----------------+----------------+----------------|
  7129. * | mem area 0 physical_address_hi |
  7130. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7131. * | mem area 1 size |
  7132. * |----------------+----------------+----------------+----------------|
  7133. * | mem area 1 physical_address_lo |
  7134. * |----------------+----------------+----------------+----------------|
  7135. * | mem area 1 physical_address_hi |
  7136. * |----------------+----------------+----------------+----------------|
  7137. * ...
  7138. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7139. * | mem area N size |
  7140. * |----------------+----------------+----------------+----------------|
  7141. * | mem area N physical_address_lo |
  7142. * |----------------+----------------+----------------+----------------|
  7143. * | mem area N physical_address_hi |
  7144. * |----------------+----------------+----------------+----------------|
  7145. *
  7146. * The message is interpreted as follows:
  7147. * dword0 - b'0:7 - msg_type: This will be set to
  7148. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7149. * b'8:15 - number_entries: Indicated the number of host memory
  7150. * areas specified within the remainder of the message
  7151. * b'16:31 - reserved.
  7152. * dword1 - b'0:31 - memory area 0 size in bytes
  7153. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7154. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7155. * and similar for memory area 1 through memory area N.
  7156. */
  7157. PREPACK struct htt_h2t_host_paddr_size {
  7158. A_UINT32 msg_type: 8,
  7159. num_entries: 8,
  7160. reserved: 16;
  7161. } POSTPACK;
  7162. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7163. A_UINT32 size;
  7164. A_UINT32 physical_address_lo;
  7165. A_UINT32 physical_address_hi;
  7166. } POSTPACK;
  7167. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7168. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7169. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7170. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7171. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7172. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7173. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7174. do { \
  7175. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7176. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7177. } while (0)
  7178. /**
  7179. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7180. *
  7181. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7182. *
  7183. * @details
  7184. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7185. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7186. *
  7187. * The message would appear as follows:
  7188. *
  7189. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7190. * |---------------------------------+---+---+----------+-+-----------|
  7191. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7192. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7193. *
  7194. *
  7195. * The message is interpreted as follows:
  7196. * dword0 - b'0:7 - msg_type: This will be set to
  7197. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7198. * b'8 - override bit to drive MSDUs to PPE ring
  7199. * b'9:13 - REO destination ring indication
  7200. * b'14 - Multi buffer msdu override enable bit
  7201. * b'15 - Intra BSS override
  7202. * b'16 - Decap raw override
  7203. * b'17 - Decap Native wifi override
  7204. * b'18 - IP frag override
  7205. * b'19:31 - reserved
  7206. */
  7207. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7208. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7209. override: 1,
  7210. reo_destination_indication: 5,
  7211. multi_buffer_msdu_override_en: 1,
  7212. intra_bss_override: 1,
  7213. decap_raw_override: 1,
  7214. decap_nwifi_override: 1,
  7215. ip_frag_override: 1,
  7216. reserved: 13;
  7217. } POSTPACK;
  7218. /* DWORD 0: Override */
  7219. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7220. #define HTT_PPE_CFG_OVERRIDE_S 8
  7221. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7222. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7223. HTT_PPE_CFG_OVERRIDE_S)
  7224. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7225. do { \
  7226. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7227. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7228. } while (0)
  7229. /* DWORD 0: REO Destination Indication*/
  7230. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7231. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7232. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7233. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7234. HTT_PPE_CFG_REO_DEST_IND_S)
  7235. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7236. do { \
  7237. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7238. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7239. } while (0)
  7240. /* DWORD 0: Multi buffer MSDU override */
  7241. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7242. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7243. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7244. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7245. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7246. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7247. do { \
  7248. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7249. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7250. } while (0)
  7251. /* DWORD 0: Intra BSS override */
  7252. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7253. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7254. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7255. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7256. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7257. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7258. do { \
  7259. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7260. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7261. } while (0)
  7262. /* DWORD 0: Decap RAW override */
  7263. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7264. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7265. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7266. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7267. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7268. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7269. do { \
  7270. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7271. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7272. } while (0)
  7273. /* DWORD 0: Decap NWIFI override */
  7274. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7275. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7276. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7277. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7278. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7279. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7280. do { \
  7281. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7282. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7283. } while (0)
  7284. /* DWORD 0: IP frag override */
  7285. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7286. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7287. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7288. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7289. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7290. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7291. do { \
  7292. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7293. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7294. } while (0)
  7295. /*
  7296. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7297. *
  7298. * @details
  7299. * The following field definitions describe the format of the HTT host
  7300. * to target FW VDEV TX RX stats retrieve message.
  7301. * The message specifies the type of stats the host wants to retrieve.
  7302. *
  7303. * |31 27|26 25|24 17|16|15 8|7 0|
  7304. * |-----------------------------------------------------------|
  7305. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7306. * |-----------------------------------------------------------|
  7307. * | vdev_id lower bitmask |
  7308. * |-----------------------------------------------------------|
  7309. * | vdev_id upper bitmask |
  7310. * |-----------------------------------------------------------|
  7311. * Header fields:
  7312. * Where:
  7313. * dword0 - b'7:0 - msg_type: This will be set to
  7314. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7315. * b'15:8 - pdev id
  7316. * b'16(E) - Enable/Disable the vdev HW stats
  7317. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7318. * b'25:26(R) - Reset stats bits
  7319. * 0: don't reset stats
  7320. * 1: reset stats once
  7321. * 2: reset stats at the start of each periodic interval
  7322. * b'27:31 - reserved for future use
  7323. * dword1 - b'0:31 - vdev_id lower bitmask
  7324. * dword2 - b'0:31 - vdev_id upper bitmask
  7325. */
  7326. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7327. A_UINT32 msg_type :8,
  7328. pdev_id :8,
  7329. enable :1,
  7330. periodic_interval :8,
  7331. reset_stats_bits :2,
  7332. reserved0 :5;
  7333. A_UINT32 vdev_id_lower_bitmask;
  7334. A_UINT32 vdev_id_upper_bitmask;
  7335. } POSTPACK;
  7336. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7337. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7338. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7339. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7340. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7341. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7342. do { \
  7343. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7344. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7345. } while (0)
  7346. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7347. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7348. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7349. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7350. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7351. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7352. do { \
  7353. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7354. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7355. } while (0)
  7356. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7357. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7358. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7359. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7360. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7361. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7362. do { \
  7363. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7364. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7365. } while (0)
  7366. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7367. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7368. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7369. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7370. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7371. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7372. do { \
  7373. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7374. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7375. } while (0)
  7376. /*=== target -> host messages ===============================================*/
  7377. enum htt_t2h_msg_type {
  7378. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7379. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7380. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7381. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7382. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7383. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7384. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7385. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7386. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7387. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7388. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7389. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7390. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7391. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7392. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7393. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7394. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7395. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7396. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7397. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7398. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7399. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7400. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7401. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7402. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7403. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7404. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7405. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7406. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7407. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7408. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7409. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7410. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7411. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7412. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7413. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7414. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7415. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7416. /* TX_OFFLOAD_DELIVER_IND:
  7417. * Forward the target's locally-generated packets to the host,
  7418. * to provide to the monitor mode interface.
  7419. */
  7420. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7421. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7422. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7423. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7424. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7425. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7426. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7427. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7428. HTT_T2H_MSG_TYPE_TEST,
  7429. /* keep this last */
  7430. HTT_T2H_NUM_MSGS
  7431. };
  7432. /*
  7433. * HTT target to host message type -
  7434. * stored in bits 7:0 of the first word of the message
  7435. */
  7436. #define HTT_T2H_MSG_TYPE_M 0xff
  7437. #define HTT_T2H_MSG_TYPE_S 0
  7438. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7439. do { \
  7440. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7441. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7442. } while (0)
  7443. #define HTT_T2H_MSG_TYPE_GET(word) \
  7444. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7445. /**
  7446. * @brief target -> host version number confirmation message definition
  7447. *
  7448. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7449. *
  7450. * |31 24|23 16|15 8|7 0|
  7451. * |----------------+----------------+----------------+----------------|
  7452. * | reserved | major number | minor number | msg type |
  7453. * |-------------------------------------------------------------------|
  7454. * : option request TLV (optional) |
  7455. * :...................................................................:
  7456. *
  7457. * The VER_CONF message may consist of a single 4-byte word, or may be
  7458. * extended with TLVs that specify HTT options selected by the target.
  7459. * The following option TLVs may be appended to the VER_CONF message:
  7460. * - LL_BUS_ADDR_SIZE
  7461. * - HL_SUPPRESS_TX_COMPL_IND
  7462. * - MAX_TX_QUEUE_GROUPS
  7463. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7464. * may be appended to the VER_CONF message (but only one TLV of each type).
  7465. *
  7466. * Header fields:
  7467. * - MSG_TYPE
  7468. * Bits 7:0
  7469. * Purpose: identifies this as a version number confirmation message
  7470. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7471. * - VER_MINOR
  7472. * Bits 15:8
  7473. * Purpose: Specify the minor number of the HTT message library version
  7474. * in use by the target firmware.
  7475. * The minor number specifies the specific revision within a range
  7476. * of fundamentally compatible HTT message definition revisions.
  7477. * Compatible revisions involve adding new messages or perhaps
  7478. * adding new fields to existing messages, in a backwards-compatible
  7479. * manner.
  7480. * Incompatible revisions involve changing the message type values,
  7481. * or redefining existing messages.
  7482. * Value: minor number
  7483. * - VER_MAJOR
  7484. * Bits 15:8
  7485. * Purpose: Specify the major number of the HTT message library version
  7486. * in use by the target firmware.
  7487. * The major number specifies the family of minor revisions that are
  7488. * fundamentally compatible with each other, but not with prior or
  7489. * later families.
  7490. * Value: major number
  7491. */
  7492. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7493. #define HTT_VER_CONF_MINOR_S 8
  7494. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7495. #define HTT_VER_CONF_MAJOR_S 16
  7496. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7497. do { \
  7498. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7499. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7500. } while (0)
  7501. #define HTT_VER_CONF_MINOR_GET(word) \
  7502. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7503. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7504. do { \
  7505. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7506. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7507. } while (0)
  7508. #define HTT_VER_CONF_MAJOR_GET(word) \
  7509. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7510. #define HTT_VER_CONF_BYTES 4
  7511. /**
  7512. * @brief - target -> host HTT Rx In order indication message
  7513. *
  7514. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7515. *
  7516. * @details
  7517. *
  7518. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7519. * |----------------+-------------------+---------------------+---------------|
  7520. * | peer ID | P| F| O| ext TID | msg type |
  7521. * |--------------------------------------------------------------------------|
  7522. * | MSDU count | Reserved | vdev id |
  7523. * |--------------------------------------------------------------------------|
  7524. * | MSDU 0 bus address (bits 31:0) |
  7525. #if HTT_PADDR64
  7526. * | MSDU 0 bus address (bits 63:32) |
  7527. #endif
  7528. * |--------------------------------------------------------------------------|
  7529. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7530. * |--------------------------------------------------------------------------|
  7531. * | MSDU 1 bus address (bits 31:0) |
  7532. #if HTT_PADDR64
  7533. * | MSDU 1 bus address (bits 63:32) |
  7534. #endif
  7535. * |--------------------------------------------------------------------------|
  7536. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7537. * |--------------------------------------------------------------------------|
  7538. */
  7539. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7540. *
  7541. * @details
  7542. * bits
  7543. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7544. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7545. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7546. * | | frag | | | | fail |chksum fail|
  7547. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7548. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7549. */
  7550. struct htt_rx_in_ord_paddr_ind_hdr_t
  7551. {
  7552. A_UINT32 /* word 0 */
  7553. msg_type: 8,
  7554. ext_tid: 5,
  7555. offload: 1,
  7556. frag: 1,
  7557. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7558. peer_id: 16;
  7559. A_UINT32 /* word 1 */
  7560. vap_id: 8,
  7561. /* NOTE:
  7562. * This reserved_1 field is not truly reserved - certain targets use
  7563. * this field internally to store debug information, and do not zero
  7564. * out the contents of the field before uploading the message to the
  7565. * host. Thus, any host-target communication supported by this field
  7566. * is limited to using values that are never used by the debug
  7567. * information stored by certain targets in the reserved_1 field.
  7568. * In particular, the targets in question don't use the value 0x3
  7569. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7570. * so this previously-unused value within these bits is available to
  7571. * use as the host / target PKT_CAPTURE_MODE flag.
  7572. */
  7573. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7574. /* if pkt_capture_mode == 0x3, host should
  7575. * send rx frames to monitor mode interface
  7576. */
  7577. msdu_cnt: 16;
  7578. };
  7579. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7580. {
  7581. A_UINT32 dma_addr;
  7582. A_UINT32
  7583. length: 16,
  7584. fw_desc: 8,
  7585. msdu_info:8;
  7586. };
  7587. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7588. {
  7589. A_UINT32 dma_addr_lo;
  7590. A_UINT32 dma_addr_hi;
  7591. A_UINT32
  7592. length: 16,
  7593. fw_desc: 8,
  7594. msdu_info:8;
  7595. };
  7596. #if HTT_PADDR64
  7597. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7598. #else
  7599. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7600. #endif
  7601. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7602. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7603. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7604. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7605. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7606. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7607. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7608. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7609. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7610. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7611. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7612. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7613. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7614. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7615. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7616. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7617. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7618. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7619. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7620. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7621. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7622. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7623. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7624. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7625. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7626. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7627. /* for systems using 64-bit format for bus addresses */
  7628. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7629. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7630. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7631. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7632. /* for systems using 32-bit format for bus addresses */
  7633. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7634. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7635. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7636. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7637. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7638. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7639. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7640. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7641. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7644. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7645. } while (0)
  7646. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7647. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7648. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7649. do { \
  7650. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7651. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7652. } while (0)
  7653. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7654. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7655. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7656. do { \
  7657. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7658. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7659. } while (0)
  7660. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7661. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7662. /*
  7663. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7664. * deliver the rx frames to the monitor mode interface.
  7665. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7666. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7667. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7668. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7669. */
  7670. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7671. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7672. do { \
  7673. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7674. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7675. } while (0)
  7676. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7677. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7678. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7679. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7682. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7683. } while (0)
  7684. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7685. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7686. /* for systems using 64-bit format for bus addresses */
  7687. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7690. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7691. } while (0)
  7692. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7693. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7694. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7695. do { \
  7696. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7697. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7698. } while (0)
  7699. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7700. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7701. /* for systems using 32-bit format for bus addresses */
  7702. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7703. do { \
  7704. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7705. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7706. } while (0)
  7707. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7708. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7709. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7712. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7713. } while (0)
  7714. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7715. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7716. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7717. do { \
  7718. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7719. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7720. } while (0)
  7721. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7722. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7723. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7726. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7727. } while (0)
  7728. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7729. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7730. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7731. do { \
  7732. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7733. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7734. } while (0)
  7735. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7736. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7737. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7738. do { \
  7739. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7740. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7741. } while (0)
  7742. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7743. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7744. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7745. do { \
  7746. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7747. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7748. } while (0)
  7749. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7750. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7751. /* definitions used within target -> host rx indication message */
  7752. PREPACK struct htt_rx_ind_hdr_prefix_t
  7753. {
  7754. A_UINT32 /* word 0 */
  7755. msg_type: 8,
  7756. ext_tid: 5,
  7757. release_valid: 1,
  7758. flush_valid: 1,
  7759. reserved0: 1,
  7760. peer_id: 16;
  7761. A_UINT32 /* word 1 */
  7762. flush_start_seq_num: 6,
  7763. flush_end_seq_num: 6,
  7764. release_start_seq_num: 6,
  7765. release_end_seq_num: 6,
  7766. num_mpdu_ranges: 8;
  7767. } POSTPACK;
  7768. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7769. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7770. #define HTT_TGT_RSSI_INVALID 0x80
  7771. PREPACK struct htt_rx_ppdu_desc_t
  7772. {
  7773. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7774. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7775. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7776. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7777. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7778. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7779. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7780. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7781. A_UINT32 /* word 0 */
  7782. rssi_cmb: 8,
  7783. timestamp_submicrosec: 8,
  7784. phy_err_code: 8,
  7785. phy_err: 1,
  7786. legacy_rate: 4,
  7787. legacy_rate_sel: 1,
  7788. end_valid: 1,
  7789. start_valid: 1;
  7790. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7791. union {
  7792. A_UINT32 /* word 1 */
  7793. rssi0_pri20: 8,
  7794. rssi0_ext20: 8,
  7795. rssi0_ext40: 8,
  7796. rssi0_ext80: 8;
  7797. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7798. } u0;
  7799. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7800. union {
  7801. A_UINT32 /* word 2 */
  7802. rssi1_pri20: 8,
  7803. rssi1_ext20: 8,
  7804. rssi1_ext40: 8,
  7805. rssi1_ext80: 8;
  7806. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7807. } u1;
  7808. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7809. union {
  7810. A_UINT32 /* word 3 */
  7811. rssi2_pri20: 8,
  7812. rssi2_ext20: 8,
  7813. rssi2_ext40: 8,
  7814. rssi2_ext80: 8;
  7815. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7816. } u2;
  7817. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7818. union {
  7819. A_UINT32 /* word 4 */
  7820. rssi3_pri20: 8,
  7821. rssi3_ext20: 8,
  7822. rssi3_ext40: 8,
  7823. rssi3_ext80: 8;
  7824. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7825. } u3;
  7826. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7827. A_UINT32 tsf32; /* word 5 */
  7828. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7829. A_UINT32 timestamp_microsec; /* word 6 */
  7830. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7831. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7832. A_UINT32 /* word 7 */
  7833. vht_sig_a1: 24,
  7834. preamble_type: 8;
  7835. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7836. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7837. A_UINT32 /* word 8 */
  7838. vht_sig_a2: 24,
  7839. /* sa_ant_matrix
  7840. * For cases where a single rx chain has options to be connected to
  7841. * different rx antennas, show which rx antennas were in use during
  7842. * receipt of a given PPDU.
  7843. * This sa_ant_matrix provides a bitmask of the antennas used while
  7844. * receiving this frame.
  7845. */
  7846. sa_ant_matrix: 8;
  7847. } POSTPACK;
  7848. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7849. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7850. PREPACK struct htt_rx_ind_hdr_suffix_t
  7851. {
  7852. A_UINT32 /* word 0 */
  7853. fw_rx_desc_bytes: 16,
  7854. reserved0: 16;
  7855. } POSTPACK;
  7856. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7857. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7858. PREPACK struct htt_rx_ind_hdr_t
  7859. {
  7860. struct htt_rx_ind_hdr_prefix_t prefix;
  7861. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7862. struct htt_rx_ind_hdr_suffix_t suffix;
  7863. } POSTPACK;
  7864. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7865. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7866. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7867. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7868. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7869. /*
  7870. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7871. * the offset into the HTT rx indication message at which the
  7872. * FW rx PPDU descriptor resides
  7873. */
  7874. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7875. /*
  7876. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7877. * the offset into the HTT rx indication message at which the
  7878. * header suffix (FW rx MSDU byte count) resides
  7879. */
  7880. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7881. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7882. /*
  7883. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7884. * the offset into the HTT rx indication message at which the per-MSDU
  7885. * information starts
  7886. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7887. * per-MSDU information portion of the message. The per-MSDU info itself
  7888. * starts at byte 12.
  7889. */
  7890. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7891. /**
  7892. * @brief target -> host rx indication message definition
  7893. *
  7894. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7895. *
  7896. * @details
  7897. * The following field definitions describe the format of the rx indication
  7898. * message sent from the target to the host.
  7899. * The message consists of three major sections:
  7900. * 1. a fixed-length header
  7901. * 2. a variable-length list of firmware rx MSDU descriptors
  7902. * 3. one or more 4-octet MPDU range information elements
  7903. * The fixed length header itself has two sub-sections
  7904. * 1. the message meta-information, including identification of the
  7905. * sender and type of the received data, and a 4-octet flush/release IE
  7906. * 2. the firmware rx PPDU descriptor
  7907. *
  7908. * The format of the message is depicted below.
  7909. * in this depiction, the following abbreviations are used for information
  7910. * elements within the message:
  7911. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7912. * elements associated with the PPDU start are valid.
  7913. * Specifically, the following fields are valid only if SV is set:
  7914. * RSSI (all variants), L, legacy rate, preamble type, service,
  7915. * VHT-SIG-A
  7916. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7917. * elements associated with the PPDU end are valid.
  7918. * Specifically, the following fields are valid only if EV is set:
  7919. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7920. * - L - Legacy rate selector - if legacy rates are used, this flag
  7921. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7922. * (L == 0) PHY.
  7923. * - P - PHY error flag - boolean indication of whether the rx frame had
  7924. * a PHY error
  7925. *
  7926. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7927. * |----------------+-------------------+---------------------+---------------|
  7928. * | peer ID | |RV|FV| ext TID | msg type |
  7929. * |--------------------------------------------------------------------------|
  7930. * | num | release | release | flush | flush |
  7931. * | MPDU | end | start | end | start |
  7932. * | ranges | seq num | seq num | seq num | seq num |
  7933. * |==========================================================================|
  7934. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7935. * |V|V| | rate | | | timestamp | RSSI |
  7936. * |--------------------------------------------------------------------------|
  7937. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7938. * |--------------------------------------------------------------------------|
  7939. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7940. * |--------------------------------------------------------------------------|
  7941. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7942. * |--------------------------------------------------------------------------|
  7943. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7944. * |--------------------------------------------------------------------------|
  7945. * | TSF LSBs |
  7946. * |--------------------------------------------------------------------------|
  7947. * | microsec timestamp |
  7948. * |--------------------------------------------------------------------------|
  7949. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7950. * |--------------------------------------------------------------------------|
  7951. * | service | HT-SIG / VHT-SIG-A2 |
  7952. * |==========================================================================|
  7953. * | reserved | FW rx desc bytes |
  7954. * |--------------------------------------------------------------------------|
  7955. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7956. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7957. * |--------------------------------------------------------------------------|
  7958. * : : :
  7959. * |--------------------------------------------------------------------------|
  7960. * | alignment | MSDU Rx |
  7961. * | padding | desc Bn |
  7962. * |--------------------------------------------------------------------------|
  7963. * | reserved | MPDU range status | MPDU count |
  7964. * |--------------------------------------------------------------------------|
  7965. * : reserved : MPDU range status : MPDU count :
  7966. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7967. *
  7968. * Header fields:
  7969. * - MSG_TYPE
  7970. * Bits 7:0
  7971. * Purpose: identifies this as an rx indication message
  7972. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7973. * - EXT_TID
  7974. * Bits 12:8
  7975. * Purpose: identify the traffic ID of the rx data, including
  7976. * special "extended" TID values for multicast, broadcast, and
  7977. * non-QoS data frames
  7978. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7979. * - FLUSH_VALID (FV)
  7980. * Bit 13
  7981. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7982. * is valid
  7983. * Value:
  7984. * 1 -> flush IE is valid and needs to be processed
  7985. * 0 -> flush IE is not valid and should be ignored
  7986. * - REL_VALID (RV)
  7987. * Bit 13
  7988. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7989. * is valid
  7990. * Value:
  7991. * 1 -> release IE is valid and needs to be processed
  7992. * 0 -> release IE is not valid and should be ignored
  7993. * - PEER_ID
  7994. * Bits 31:16
  7995. * Purpose: Identify, by ID, which peer sent the rx data
  7996. * Value: ID of the peer who sent the rx data
  7997. * - FLUSH_SEQ_NUM_START
  7998. * Bits 5:0
  7999. * Purpose: Indicate the start of a series of MPDUs to flush
  8000. * Not all MPDUs within this series are necessarily valid - the host
  8001. * must check each sequence number within this range to see if the
  8002. * corresponding MPDU is actually present.
  8003. * This field is only valid if the FV bit is set.
  8004. * Value:
  8005. * The sequence number for the first MPDUs to check to flush.
  8006. * The sequence number is masked by 0x3f.
  8007. * - FLUSH_SEQ_NUM_END
  8008. * Bits 11:6
  8009. * Purpose: Indicate the end of a series of MPDUs to flush
  8010. * Value:
  8011. * The sequence number one larger than the sequence number of the
  8012. * last MPDU to check to flush.
  8013. * The sequence number is masked by 0x3f.
  8014. * Not all MPDUs within this series are necessarily valid - the host
  8015. * must check each sequence number within this range to see if the
  8016. * corresponding MPDU is actually present.
  8017. * This field is only valid if the FV bit is set.
  8018. * - REL_SEQ_NUM_START
  8019. * Bits 17:12
  8020. * Purpose: Indicate the start of a series of MPDUs to release.
  8021. * All MPDUs within this series are present and valid - the host
  8022. * need not check each sequence number within this range to see if
  8023. * the corresponding MPDU is actually present.
  8024. * This field is only valid if the RV bit is set.
  8025. * Value:
  8026. * The sequence number for the first MPDUs to check to release.
  8027. * The sequence number is masked by 0x3f.
  8028. * - REL_SEQ_NUM_END
  8029. * Bits 23:18
  8030. * Purpose: Indicate the end of a series of MPDUs to release.
  8031. * Value:
  8032. * The sequence number one larger than the sequence number of the
  8033. * last MPDU to check to release.
  8034. * The sequence number is masked by 0x3f.
  8035. * All MPDUs within this series are present and valid - the host
  8036. * need not check each sequence number within this range to see if
  8037. * the corresponding MPDU is actually present.
  8038. * This field is only valid if the RV bit is set.
  8039. * - NUM_MPDU_RANGES
  8040. * Bits 31:24
  8041. * Purpose: Indicate how many ranges of MPDUs are present.
  8042. * Each MPDU range consists of a series of contiguous MPDUs within the
  8043. * rx frame sequence which all have the same MPDU status.
  8044. * Value: 1-63 (typically a small number, like 1-3)
  8045. *
  8046. * Rx PPDU descriptor fields:
  8047. * - RSSI_CMB
  8048. * Bits 7:0
  8049. * Purpose: Combined RSSI from all active rx chains, across the active
  8050. * bandwidth.
  8051. * Value: RSSI dB units w.r.t. noise floor
  8052. * - TIMESTAMP_SUBMICROSEC
  8053. * Bits 15:8
  8054. * Purpose: high-resolution timestamp
  8055. * Value:
  8056. * Sub-microsecond time of PPDU reception.
  8057. * This timestamp ranges from [0,MAC clock MHz).
  8058. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8059. * to form a high-resolution, large range rx timestamp.
  8060. * - PHY_ERR_CODE
  8061. * Bits 23:16
  8062. * Purpose:
  8063. * If the rx frame processing resulted in a PHY error, indicate what
  8064. * type of rx PHY error occurred.
  8065. * Value:
  8066. * This field is valid if the "P" (PHY_ERR) flag is set.
  8067. * TBD: document/specify the values for this field
  8068. * - PHY_ERR
  8069. * Bit 24
  8070. * Purpose: indicate whether the rx PPDU had a PHY error
  8071. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8072. * - LEGACY_RATE
  8073. * Bits 28:25
  8074. * Purpose:
  8075. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8076. * specify which rate was used.
  8077. * Value:
  8078. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8079. * flag.
  8080. * If LEGACY_RATE_SEL is 0:
  8081. * 0x8: OFDM 48 Mbps
  8082. * 0x9: OFDM 24 Mbps
  8083. * 0xA: OFDM 12 Mbps
  8084. * 0xB: OFDM 6 Mbps
  8085. * 0xC: OFDM 54 Mbps
  8086. * 0xD: OFDM 36 Mbps
  8087. * 0xE: OFDM 18 Mbps
  8088. * 0xF: OFDM 9 Mbps
  8089. * If LEGACY_RATE_SEL is 1:
  8090. * 0x8: CCK 11 Mbps long preamble
  8091. * 0x9: CCK 5.5 Mbps long preamble
  8092. * 0xA: CCK 2 Mbps long preamble
  8093. * 0xB: CCK 1 Mbps long preamble
  8094. * 0xC: CCK 11 Mbps short preamble
  8095. * 0xD: CCK 5.5 Mbps short preamble
  8096. * 0xE: CCK 2 Mbps short preamble
  8097. * - LEGACY_RATE_SEL
  8098. * Bit 29
  8099. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8100. * Value:
  8101. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8102. * used a legacy rate.
  8103. * 0 -> OFDM, 1 -> CCK
  8104. * - END_VALID
  8105. * Bit 30
  8106. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8107. * the start of the PPDU are valid. Specifically, the following
  8108. * fields are only valid if END_VALID is set:
  8109. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8110. * TIMESTAMP_SUBMICROSEC
  8111. * Value:
  8112. * 0 -> rx PPDU desc end fields are not valid
  8113. * 1 -> rx PPDU desc end fields are valid
  8114. * - START_VALID
  8115. * Bit 31
  8116. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8117. * the end of the PPDU are valid. Specifically, the following
  8118. * fields are only valid if START_VALID is set:
  8119. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8120. * VHT-SIG-A
  8121. * Value:
  8122. * 0 -> rx PPDU desc start fields are not valid
  8123. * 1 -> rx PPDU desc start fields are valid
  8124. * - RSSI0_PRI20
  8125. * Bits 7:0
  8126. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8127. * Value: RSSI dB units w.r.t. noise floor
  8128. *
  8129. * - RSSI0_EXT20
  8130. * Bits 7:0
  8131. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8132. * (if the rx bandwidth was >= 40 MHz)
  8133. * Value: RSSI dB units w.r.t. noise floor
  8134. * - RSSI0_EXT40
  8135. * Bits 7:0
  8136. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8137. * (if the rx bandwidth was >= 80 MHz)
  8138. * Value: RSSI dB units w.r.t. noise floor
  8139. * - RSSI0_EXT80
  8140. * Bits 7:0
  8141. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8142. * (if the rx bandwidth was >= 160 MHz)
  8143. * Value: RSSI dB units w.r.t. noise floor
  8144. *
  8145. * - RSSI1_PRI20
  8146. * Bits 7:0
  8147. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8148. * Value: RSSI dB units w.r.t. noise floor
  8149. * - RSSI1_EXT20
  8150. * Bits 7:0
  8151. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8152. * (if the rx bandwidth was >= 40 MHz)
  8153. * Value: RSSI dB units w.r.t. noise floor
  8154. * - RSSI1_EXT40
  8155. * Bits 7:0
  8156. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8157. * (if the rx bandwidth was >= 80 MHz)
  8158. * Value: RSSI dB units w.r.t. noise floor
  8159. * - RSSI1_EXT80
  8160. * Bits 7:0
  8161. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8162. * (if the rx bandwidth was >= 160 MHz)
  8163. * Value: RSSI dB units w.r.t. noise floor
  8164. *
  8165. * - RSSI2_PRI20
  8166. * Bits 7:0
  8167. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8168. * Value: RSSI dB units w.r.t. noise floor
  8169. * - RSSI2_EXT20
  8170. * Bits 7:0
  8171. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8172. * (if the rx bandwidth was >= 40 MHz)
  8173. * Value: RSSI dB units w.r.t. noise floor
  8174. * - RSSI2_EXT40
  8175. * Bits 7:0
  8176. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8177. * (if the rx bandwidth was >= 80 MHz)
  8178. * Value: RSSI dB units w.r.t. noise floor
  8179. * - RSSI2_EXT80
  8180. * Bits 7:0
  8181. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8182. * (if the rx bandwidth was >= 160 MHz)
  8183. * Value: RSSI dB units w.r.t. noise floor
  8184. *
  8185. * - RSSI3_PRI20
  8186. * Bits 7:0
  8187. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8188. * Value: RSSI dB units w.r.t. noise floor
  8189. * - RSSI3_EXT20
  8190. * Bits 7:0
  8191. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8192. * (if the rx bandwidth was >= 40 MHz)
  8193. * Value: RSSI dB units w.r.t. noise floor
  8194. * - RSSI3_EXT40
  8195. * Bits 7:0
  8196. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8197. * (if the rx bandwidth was >= 80 MHz)
  8198. * Value: RSSI dB units w.r.t. noise floor
  8199. * - RSSI3_EXT80
  8200. * Bits 7:0
  8201. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8202. * (if the rx bandwidth was >= 160 MHz)
  8203. * Value: RSSI dB units w.r.t. noise floor
  8204. *
  8205. * - TSF32
  8206. * Bits 31:0
  8207. * Purpose: specify the time the rx PPDU was received, in TSF units
  8208. * Value: 32 LSBs of the TSF
  8209. * - TIMESTAMP_MICROSEC
  8210. * Bits 31:0
  8211. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8212. * Value: PPDU rx time, in microseconds
  8213. * - VHT_SIG_A1
  8214. * Bits 23:0
  8215. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8216. * from the rx PPDU
  8217. * Value:
  8218. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8219. * VHT-SIG-A1 data.
  8220. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8221. * first 24 bits of the HT-SIG data.
  8222. * Otherwise, this field is invalid.
  8223. * Refer to the the 802.11 protocol for the definition of the
  8224. * HT-SIG and VHT-SIG-A1 fields
  8225. * - VHT_SIG_A2
  8226. * Bits 23:0
  8227. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8228. * from the rx PPDU
  8229. * Value:
  8230. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8231. * VHT-SIG-A2 data.
  8232. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8233. * last 24 bits of the HT-SIG data.
  8234. * Otherwise, this field is invalid.
  8235. * Refer to the the 802.11 protocol for the definition of the
  8236. * HT-SIG and VHT-SIG-A2 fields
  8237. * - PREAMBLE_TYPE
  8238. * Bits 31:24
  8239. * Purpose: indicate the PHY format of the received burst
  8240. * Value:
  8241. * 0x4: Legacy (OFDM/CCK)
  8242. * 0x8: HT
  8243. * 0x9: HT with TxBF
  8244. * 0xC: VHT
  8245. * 0xD: VHT with TxBF
  8246. * - SERVICE
  8247. * Bits 31:24
  8248. * Purpose: TBD
  8249. * Value: TBD
  8250. *
  8251. * Rx MSDU descriptor fields:
  8252. * - FW_RX_DESC_BYTES
  8253. * Bits 15:0
  8254. * Purpose: Indicate how many bytes in the Rx indication are used for
  8255. * FW Rx descriptors
  8256. *
  8257. * Payload fields:
  8258. * - MPDU_COUNT
  8259. * Bits 7:0
  8260. * Purpose: Indicate how many sequential MPDUs share the same status.
  8261. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8262. * - MPDU_STATUS
  8263. * Bits 15:8
  8264. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8265. * received successfully.
  8266. * Value:
  8267. * 0x1: success
  8268. * 0x2: FCS error
  8269. * 0x3: duplicate error
  8270. * 0x4: replay error
  8271. * 0x5: invalid peer
  8272. */
  8273. /* header fields */
  8274. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8275. #define HTT_RX_IND_EXT_TID_S 8
  8276. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8277. #define HTT_RX_IND_FLUSH_VALID_S 13
  8278. #define HTT_RX_IND_REL_VALID_M 0x4000
  8279. #define HTT_RX_IND_REL_VALID_S 14
  8280. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8281. #define HTT_RX_IND_PEER_ID_S 16
  8282. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8283. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8284. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8285. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8286. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8287. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8288. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8289. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8290. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8291. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8292. /* rx PPDU descriptor fields */
  8293. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8294. #define HTT_RX_IND_RSSI_CMB_S 0
  8295. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8296. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8297. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8298. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8299. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8300. #define HTT_RX_IND_PHY_ERR_S 24
  8301. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8302. #define HTT_RX_IND_LEGACY_RATE_S 25
  8303. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8304. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8305. #define HTT_RX_IND_END_VALID_M 0x40000000
  8306. #define HTT_RX_IND_END_VALID_S 30
  8307. #define HTT_RX_IND_START_VALID_M 0x80000000
  8308. #define HTT_RX_IND_START_VALID_S 31
  8309. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8310. #define HTT_RX_IND_RSSI_PRI20_S 0
  8311. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8312. #define HTT_RX_IND_RSSI_EXT20_S 8
  8313. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8314. #define HTT_RX_IND_RSSI_EXT40_S 16
  8315. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8316. #define HTT_RX_IND_RSSI_EXT80_S 24
  8317. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8318. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8319. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8320. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8321. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8322. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8323. #define HTT_RX_IND_SERVICE_M 0xff000000
  8324. #define HTT_RX_IND_SERVICE_S 24
  8325. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8326. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8327. /* rx MSDU descriptor fields */
  8328. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8329. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8330. /* payload fields */
  8331. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8332. #define HTT_RX_IND_MPDU_COUNT_S 0
  8333. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8334. #define HTT_RX_IND_MPDU_STATUS_S 8
  8335. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8336. do { \
  8337. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8338. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8339. } while (0)
  8340. #define HTT_RX_IND_EXT_TID_GET(word) \
  8341. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8342. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8343. do { \
  8344. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8345. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8346. } while (0)
  8347. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8348. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8349. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8352. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8353. } while (0)
  8354. #define HTT_RX_IND_REL_VALID_GET(word) \
  8355. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8356. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8357. do { \
  8358. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8359. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8360. } while (0)
  8361. #define HTT_RX_IND_PEER_ID_GET(word) \
  8362. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8363. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8364. do { \
  8365. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8366. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8367. } while (0)
  8368. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8369. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8370. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8371. do { \
  8372. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8373. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8374. } while (0)
  8375. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8376. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8377. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8378. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8379. do { \
  8380. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8381. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8382. } while (0)
  8383. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8384. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8385. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8386. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8387. do { \
  8388. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8389. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8390. } while (0)
  8391. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8392. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8393. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8394. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8395. do { \
  8396. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8397. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8398. } while (0)
  8399. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8400. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8401. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8402. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8403. do { \
  8404. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8405. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8406. } while (0)
  8407. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8408. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8409. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8410. /* FW rx PPDU descriptor fields */
  8411. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8412. do { \
  8413. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8414. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8415. } while (0)
  8416. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8417. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8418. HTT_RX_IND_RSSI_CMB_S)
  8419. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8420. do { \
  8421. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8422. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8423. } while (0)
  8424. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8425. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8426. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8427. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8428. do { \
  8429. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8430. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8431. } while (0)
  8432. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8433. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8434. HTT_RX_IND_PHY_ERR_CODE_S)
  8435. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8436. do { \
  8437. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8438. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8439. } while (0)
  8440. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8441. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8442. HTT_RX_IND_PHY_ERR_S)
  8443. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8444. do { \
  8445. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8446. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8447. } while (0)
  8448. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8449. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8450. HTT_RX_IND_LEGACY_RATE_S)
  8451. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8454. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8455. } while (0)
  8456. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8457. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8458. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8459. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8460. do { \
  8461. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8462. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8463. } while (0)
  8464. #define HTT_RX_IND_END_VALID_GET(word) \
  8465. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8466. HTT_RX_IND_END_VALID_S)
  8467. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8468. do { \
  8469. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8470. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8471. } while (0)
  8472. #define HTT_RX_IND_START_VALID_GET(word) \
  8473. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8474. HTT_RX_IND_START_VALID_S)
  8475. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8476. do { \
  8477. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8478. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8479. } while (0)
  8480. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8481. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8482. HTT_RX_IND_RSSI_PRI20_S)
  8483. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8484. do { \
  8485. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8486. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8487. } while (0)
  8488. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8489. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8490. HTT_RX_IND_RSSI_EXT20_S)
  8491. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8492. do { \
  8493. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8494. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8495. } while (0)
  8496. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8497. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8498. HTT_RX_IND_RSSI_EXT40_S)
  8499. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8500. do { \
  8501. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8502. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8503. } while (0)
  8504. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8505. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8506. HTT_RX_IND_RSSI_EXT80_S)
  8507. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8508. do { \
  8509. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8510. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8511. } while (0)
  8512. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8513. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8514. HTT_RX_IND_VHT_SIG_A1_S)
  8515. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8516. do { \
  8517. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8518. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8519. } while (0)
  8520. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8521. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8522. HTT_RX_IND_VHT_SIG_A2_S)
  8523. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8524. do { \
  8525. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8526. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8527. } while (0)
  8528. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8529. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8530. HTT_RX_IND_PREAMBLE_TYPE_S)
  8531. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8532. do { \
  8533. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8534. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8535. } while (0)
  8536. #define HTT_RX_IND_SERVICE_GET(word) \
  8537. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8538. HTT_RX_IND_SERVICE_S)
  8539. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8540. do { \
  8541. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8542. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8543. } while (0)
  8544. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8545. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8546. HTT_RX_IND_SA_ANT_MATRIX_S)
  8547. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8548. do { \
  8549. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8550. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8551. } while (0)
  8552. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8553. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8554. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8555. do { \
  8556. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8557. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8558. } while (0)
  8559. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8560. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8561. #define HTT_RX_IND_HL_BYTES \
  8562. (HTT_RX_IND_HDR_BYTES + \
  8563. 4 /* single FW rx MSDU descriptor */ + \
  8564. 4 /* single MPDU range information element */)
  8565. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8566. /* Could we use one macro entry? */
  8567. #define HTT_WORD_SET(word, field, value) \
  8568. do { \
  8569. HTT_CHECK_SET_VAL(field, value); \
  8570. (word) |= ((value) << field ## _S); \
  8571. } while (0)
  8572. #define HTT_WORD_GET(word, field) \
  8573. (((word) & field ## _M) >> field ## _S)
  8574. PREPACK struct hl_htt_rx_ind_base {
  8575. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8576. } POSTPACK;
  8577. /*
  8578. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8579. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8580. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8581. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8582. * htt_rx_ind_hl_rx_desc_t.
  8583. */
  8584. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8585. struct htt_rx_ind_hl_rx_desc_t {
  8586. A_UINT8 ver;
  8587. A_UINT8 len;
  8588. struct {
  8589. A_UINT8
  8590. first_msdu: 1,
  8591. last_msdu: 1,
  8592. c3_failed: 1,
  8593. c4_failed: 1,
  8594. ipv6: 1,
  8595. tcp: 1,
  8596. udp: 1,
  8597. reserved: 1;
  8598. } flags;
  8599. /* NOTE: no reserved space - don't append any new fields here */
  8600. };
  8601. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8602. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8603. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8604. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8605. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8606. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8607. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8608. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8609. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8610. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8611. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8612. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8613. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8614. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8615. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8616. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8617. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8618. /* This structure is used in HL, the basic descriptor information
  8619. * used by host. the structure is translated by FW from HW desc
  8620. * or generated by FW. But in HL monitor mode, the host would use
  8621. * the same structure with LL.
  8622. */
  8623. PREPACK struct hl_htt_rx_desc_base {
  8624. A_UINT32
  8625. seq_num:12,
  8626. encrypted:1,
  8627. chan_info_present:1,
  8628. resv0:2,
  8629. mcast_bcast:1,
  8630. fragment:1,
  8631. key_id_oct:8,
  8632. resv1:6;
  8633. A_UINT32
  8634. pn_31_0;
  8635. union {
  8636. struct {
  8637. A_UINT16 pn_47_32;
  8638. A_UINT16 pn_63_48;
  8639. } pn16;
  8640. A_UINT32 pn_63_32;
  8641. } u0;
  8642. A_UINT32
  8643. pn_95_64;
  8644. A_UINT32
  8645. pn_127_96;
  8646. } POSTPACK;
  8647. /*
  8648. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8649. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8650. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8651. * Please see htt_chan_change_t for description of the fields.
  8652. */
  8653. PREPACK struct htt_chan_info_t
  8654. {
  8655. A_UINT32 primary_chan_center_freq_mhz: 16,
  8656. contig_chan1_center_freq_mhz: 16;
  8657. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8658. phy_mode: 8,
  8659. reserved: 8;
  8660. } POSTPACK;
  8661. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8662. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8663. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8664. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8665. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8666. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8667. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8668. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8669. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8670. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8671. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8672. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8673. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8674. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8675. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8676. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8677. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8678. /* Channel information */
  8679. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8680. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8681. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8682. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8683. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8684. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8685. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8686. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8687. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8688. do { \
  8689. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8690. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8691. } while (0)
  8692. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8693. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8694. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8697. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8698. } while (0)
  8699. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8700. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8701. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8702. do { \
  8703. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8704. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8705. } while (0)
  8706. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8707. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8708. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8709. do { \
  8710. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8711. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8712. } while (0)
  8713. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8714. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8715. /*
  8716. * @brief target -> host message definition for FW offloaded pkts
  8717. *
  8718. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8719. *
  8720. * @details
  8721. * The following field definitions describe the format of the firmware
  8722. * offload deliver message sent from the target to the host.
  8723. *
  8724. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8725. *
  8726. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8727. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8728. * | reserved_1 | msg type |
  8729. * |--------------------------------------------------------------------------|
  8730. * | phy_timestamp_l32 |
  8731. * |--------------------------------------------------------------------------|
  8732. * | WORD2 (see below) |
  8733. * |--------------------------------------------------------------------------|
  8734. * | seqno | framectrl |
  8735. * |--------------------------------------------------------------------------|
  8736. * | reserved_3 | vdev_id | tid_num|
  8737. * |--------------------------------------------------------------------------|
  8738. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8739. * |--------------------------------------------------------------------------|
  8740. *
  8741. * where:
  8742. * STAT = status
  8743. * F = format (802.3 vs. 802.11)
  8744. *
  8745. * definition for word 2
  8746. *
  8747. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8748. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8749. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8750. * |--------------------------------------------------------------------------|
  8751. *
  8752. * where:
  8753. * PR = preamble
  8754. * BF = beamformed
  8755. */
  8756. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8757. {
  8758. A_UINT32 /* word 0 */
  8759. msg_type:8, /* [ 7: 0] */
  8760. reserved_1:24; /* [31: 8] */
  8761. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8762. A_UINT32 /* word 2 */
  8763. /* preamble:
  8764. * 0-OFDM,
  8765. * 1-CCk,
  8766. * 2-HT,
  8767. * 3-VHT
  8768. */
  8769. preamble: 2, /* [1:0] */
  8770. /* mcs:
  8771. * In case of HT preamble interpret
  8772. * MCS along with NSS.
  8773. * Valid values for HT are 0 to 7.
  8774. * HT mcs 0 with NSS 2 is mcs 8.
  8775. * Valid values for VHT are 0 to 9.
  8776. */
  8777. mcs: 4, /* [5:2] */
  8778. /* rate:
  8779. * This is applicable only for
  8780. * CCK and OFDM preamble type
  8781. * rate 0: OFDM 48 Mbps,
  8782. * 1: OFDM 24 Mbps,
  8783. * 2: OFDM 12 Mbps
  8784. * 3: OFDM 6 Mbps
  8785. * 4: OFDM 54 Mbps
  8786. * 5: OFDM 36 Mbps
  8787. * 6: OFDM 18 Mbps
  8788. * 7: OFDM 9 Mbps
  8789. * rate 0: CCK 11 Mbps Long
  8790. * 1: CCK 5.5 Mbps Long
  8791. * 2: CCK 2 Mbps Long
  8792. * 3: CCK 1 Mbps Long
  8793. * 4: CCK 11 Mbps Short
  8794. * 5: CCK 5.5 Mbps Short
  8795. * 6: CCK 2 Mbps Short
  8796. */
  8797. rate : 3, /* [ 8: 6] */
  8798. rssi : 8, /* [16: 9] units=dBm */
  8799. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8800. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8801. stbc : 1, /* [22] */
  8802. sgi : 1, /* [23] */
  8803. ldpc : 1, /* [24] */
  8804. beamformed: 1, /* [25] */
  8805. reserved_2: 6; /* [31:26] */
  8806. A_UINT32 /* word 3 */
  8807. framectrl:16, /* [15: 0] */
  8808. seqno:16; /* [31:16] */
  8809. A_UINT32 /* word 4 */
  8810. tid_num:5, /* [ 4: 0] actual TID number */
  8811. vdev_id:8, /* [12: 5] */
  8812. reserved_3:19; /* [31:13] */
  8813. A_UINT32 /* word 5 */
  8814. /* status:
  8815. * 0: tx_ok
  8816. * 1: retry
  8817. * 2: drop
  8818. * 3: filtered
  8819. * 4: abort
  8820. * 5: tid delete
  8821. * 6: sw abort
  8822. * 7: dropped by peer migration
  8823. */
  8824. status:3, /* [2:0] */
  8825. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8826. tx_mpdu_bytes:16, /* [19:4] */
  8827. /* Indicates retry count of offloaded/local generated Data tx frames */
  8828. tx_retry_cnt:6, /* [25:20] */
  8829. reserved_4:6; /* [31:26] */
  8830. } POSTPACK;
  8831. /* FW offload deliver ind message header fields */
  8832. /* DWORD one */
  8833. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8834. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8835. /* DWORD two */
  8836. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8837. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8838. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8839. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8840. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8841. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8842. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8843. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8844. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8845. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8846. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8847. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8848. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8849. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8850. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8851. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8852. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8853. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8854. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8855. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8856. /* DWORD three*/
  8857. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8858. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8859. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8860. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8861. /* DWORD four */
  8862. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8863. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8864. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8865. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8866. /* DWORD five */
  8867. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8868. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8869. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8870. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8871. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8872. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8873. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8874. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8875. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8876. do { \
  8877. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8878. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8879. } while (0)
  8880. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8881. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8882. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8883. do { \
  8884. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8885. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8886. } while (0)
  8887. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8888. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8889. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8890. do { \
  8891. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8892. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8893. } while (0)
  8894. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8895. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8896. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8897. do { \
  8898. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8899. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8900. } while (0)
  8901. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8902. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8903. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8904. do { \
  8905. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8906. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8907. } while (0)
  8908. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8909. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8910. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8911. do { \
  8912. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8913. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8914. } while (0)
  8915. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8916. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8917. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8918. do { \
  8919. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8920. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8921. } while (0)
  8922. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8923. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8924. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8925. do { \
  8926. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8927. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8928. } while (0)
  8929. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8930. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8931. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8932. do { \
  8933. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8934. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8935. } while (0)
  8936. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8937. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8938. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8939. do { \
  8940. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8941. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8942. } while (0)
  8943. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8944. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8945. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8946. do { \
  8947. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8948. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8949. } while (0)
  8950. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8951. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8952. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8953. do { \
  8954. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8955. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8956. } while (0)
  8957. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8958. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8959. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8960. do { \
  8961. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8962. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8963. } while (0)
  8964. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8965. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8966. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8967. do { \
  8968. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8969. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8970. } while (0)
  8971. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8972. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8973. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8974. do { \
  8975. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8976. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8977. } while (0)
  8978. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8979. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8980. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8981. do { \
  8982. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8983. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8984. } while (0)
  8985. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8986. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8987. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8988. do { \
  8989. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8990. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8991. } while (0)
  8992. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8993. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8994. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8995. do { \
  8996. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8997. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8998. } while (0)
  8999. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9000. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9001. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9002. do { \
  9003. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9004. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9005. } while (0)
  9006. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9007. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9008. /*
  9009. * @brief target -> host rx reorder flush message definition
  9010. *
  9011. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9012. *
  9013. * @details
  9014. * The following field definitions describe the format of the rx flush
  9015. * message sent from the target to the host.
  9016. * The message consists of a 4-octet header, followed by one or more
  9017. * 4-octet payload information elements.
  9018. *
  9019. * |31 24|23 8|7 0|
  9020. * |--------------------------------------------------------------|
  9021. * | TID | peer ID | msg type |
  9022. * |--------------------------------------------------------------|
  9023. * | seq num end | seq num start | MPDU status | reserved |
  9024. * |--------------------------------------------------------------|
  9025. * First DWORD:
  9026. * - MSG_TYPE
  9027. * Bits 7:0
  9028. * Purpose: identifies this as an rx flush message
  9029. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9030. * - PEER_ID
  9031. * Bits 23:8 (only bits 18:8 actually used)
  9032. * Purpose: identify which peer's rx data is being flushed
  9033. * Value: (rx) peer ID
  9034. * - TID
  9035. * Bits 31:24 (only bits 27:24 actually used)
  9036. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9037. * Value: traffic identifier
  9038. * Second DWORD:
  9039. * - MPDU_STATUS
  9040. * Bits 15:8
  9041. * Purpose:
  9042. * Indicate whether the flushed MPDUs should be discarded or processed.
  9043. * Value:
  9044. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9045. * stages of rx processing
  9046. * other: discard the MPDUs
  9047. * It is anticipated that flush messages will always have
  9048. * MPDU status == 1, but the status flag is included for
  9049. * flexibility.
  9050. * - SEQ_NUM_START
  9051. * Bits 23:16
  9052. * Purpose:
  9053. * Indicate the start of a series of consecutive MPDUs being flushed.
  9054. * Not all MPDUs within this range are necessarily valid - the host
  9055. * must check each sequence number within this range to see if the
  9056. * corresponding MPDU is actually present.
  9057. * Value:
  9058. * The sequence number for the first MPDU in the sequence.
  9059. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9060. * - SEQ_NUM_END
  9061. * Bits 30:24
  9062. * Purpose:
  9063. * Indicate the end of a series of consecutive MPDUs being flushed.
  9064. * Value:
  9065. * The sequence number one larger than the sequence number of the
  9066. * last MPDU being flushed.
  9067. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9068. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9069. * are to be released for further rx processing.
  9070. * Not all MPDUs within this range are necessarily valid - the host
  9071. * must check each sequence number within this range to see if the
  9072. * corresponding MPDU is actually present.
  9073. */
  9074. /* first DWORD */
  9075. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9076. #define HTT_RX_FLUSH_PEER_ID_S 8
  9077. #define HTT_RX_FLUSH_TID_M 0xff000000
  9078. #define HTT_RX_FLUSH_TID_S 24
  9079. /* second DWORD */
  9080. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9081. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9082. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9083. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9084. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9085. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9086. #define HTT_RX_FLUSH_BYTES 8
  9087. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9088. do { \
  9089. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9090. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9091. } while (0)
  9092. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9093. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9094. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9095. do { \
  9096. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9097. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9098. } while (0)
  9099. #define HTT_RX_FLUSH_TID_GET(word) \
  9100. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9101. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9102. do { \
  9103. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9104. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9105. } while (0)
  9106. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9107. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9108. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9109. do { \
  9110. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9111. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9112. } while (0)
  9113. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9114. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9115. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9116. do { \
  9117. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9118. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9119. } while (0)
  9120. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9121. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9122. /*
  9123. * @brief target -> host rx pn check indication message
  9124. *
  9125. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9126. *
  9127. * @details
  9128. * The following field definitions describe the format of the Rx PN check
  9129. * indication message sent from the target to the host.
  9130. * The message consists of a 4-octet header, followed by the start and
  9131. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9132. * IE is one octet containing the sequence number that failed the PN
  9133. * check.
  9134. *
  9135. * |31 24|23 8|7 0|
  9136. * |--------------------------------------------------------------|
  9137. * | TID | peer ID | msg type |
  9138. * |--------------------------------------------------------------|
  9139. * | Reserved | PN IE count | seq num end | seq num start|
  9140. * |--------------------------------------------------------------|
  9141. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9142. * |--------------------------------------------------------------|
  9143. * First DWORD:
  9144. * - MSG_TYPE
  9145. * Bits 7:0
  9146. * Purpose: Identifies this as an rx pn check indication message
  9147. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9148. * - PEER_ID
  9149. * Bits 23:8 (only bits 18:8 actually used)
  9150. * Purpose: identify which peer
  9151. * Value: (rx) peer ID
  9152. * - TID
  9153. * Bits 31:24 (only bits 27:24 actually used)
  9154. * Purpose: identify traffic identifier
  9155. * Value: traffic identifier
  9156. * Second DWORD:
  9157. * - SEQ_NUM_START
  9158. * Bits 7:0
  9159. * Purpose:
  9160. * Indicates the starting sequence number of the MPDU in this
  9161. * series of MPDUs that went though PN check.
  9162. * Value:
  9163. * The sequence number for the first MPDU in the sequence.
  9164. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9165. * - SEQ_NUM_END
  9166. * Bits 15:8
  9167. * Purpose:
  9168. * Indicates the ending sequence number of the MPDU in this
  9169. * series of MPDUs that went though PN check.
  9170. * Value:
  9171. * The sequence number one larger then the sequence number of the last
  9172. * MPDU being flushed.
  9173. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9174. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9175. * for invalid PN numbers and are ready to be released for further processing.
  9176. * Not all MPDUs within this range are necessarily valid - the host
  9177. * must check each sequence number within this range to see if the
  9178. * corresponding MPDU is actually present.
  9179. * - PN_IE_COUNT
  9180. * Bits 23:16
  9181. * Purpose:
  9182. * Used to determine the variable number of PN information elements in this
  9183. * message
  9184. *
  9185. * PN information elements:
  9186. * - PN_IE_x-
  9187. * Purpose:
  9188. * Each PN information element contains the sequence number of the MPDU that
  9189. * has failed the target PN check.
  9190. * Value:
  9191. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9192. * that failed the PN check.
  9193. */
  9194. /* first DWORD */
  9195. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9196. #define HTT_RX_PN_IND_PEER_ID_S 8
  9197. #define HTT_RX_PN_IND_TID_M 0xff000000
  9198. #define HTT_RX_PN_IND_TID_S 24
  9199. /* second DWORD */
  9200. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9201. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9202. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9203. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9204. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9205. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9206. #define HTT_RX_PN_IND_BYTES 8
  9207. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9208. do { \
  9209. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9210. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9211. } while (0)
  9212. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9213. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9214. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9215. do { \
  9216. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9217. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9218. } while (0)
  9219. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9220. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9221. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9222. do { \
  9223. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9224. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9225. } while (0)
  9226. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9227. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9228. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9231. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9232. } while (0)
  9233. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9234. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9235. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9236. do { \
  9237. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9238. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9239. } while (0)
  9240. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9241. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9242. /*
  9243. * @brief target -> host rx offload deliver message for LL system
  9244. *
  9245. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9246. *
  9247. * @details
  9248. * In a low latency system this message is sent whenever the offload
  9249. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9250. * The DMA of the actual packets into host memory is done before sending out
  9251. * this message. This message indicates only how many MSDUs to reap. The
  9252. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9253. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9254. * DMA'd by the MAC directly into host memory these packets do not contain
  9255. * the MAC descriptors in the header portion of the packet. Instead they contain
  9256. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9257. * message, the packets are delivered directly to the NW stack without going
  9258. * through the regular reorder buffering and PN checking path since it has
  9259. * already been done in target.
  9260. *
  9261. * |31 24|23 16|15 8|7 0|
  9262. * |-----------------------------------------------------------------------|
  9263. * | Total MSDU count | reserved | msg type |
  9264. * |-----------------------------------------------------------------------|
  9265. *
  9266. * @brief target -> host rx offload deliver message for HL system
  9267. *
  9268. * @details
  9269. * In a high latency system this message is sent whenever the offload manager
  9270. * flushes out the packets it has coalesced in its coalescing buffer. The
  9271. * actual packets are also carried along with this message. When the host
  9272. * receives this message, it is expected to deliver these packets to the NW
  9273. * stack directly instead of routing them through the reorder buffering and
  9274. * PN checking path since it has already been done in target.
  9275. *
  9276. * |31 24|23 16|15 8|7 0|
  9277. * |-----------------------------------------------------------------------|
  9278. * | Total MSDU count | reserved | msg type |
  9279. * |-----------------------------------------------------------------------|
  9280. * | peer ID | MSDU length |
  9281. * |-----------------------------------------------------------------------|
  9282. * | MSDU payload | FW Desc | tid | vdev ID |
  9283. * |-----------------------------------------------------------------------|
  9284. * | MSDU payload contd. |
  9285. * |-----------------------------------------------------------------------|
  9286. * | peer ID | MSDU length |
  9287. * |-----------------------------------------------------------------------|
  9288. * | MSDU payload | FW Desc | tid | vdev ID |
  9289. * |-----------------------------------------------------------------------|
  9290. * | MSDU payload contd. |
  9291. * |-----------------------------------------------------------------------|
  9292. *
  9293. */
  9294. /* first DWORD */
  9295. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9296. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9298. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9299. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9301. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9303. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9304. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9306. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9307. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9308. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9309. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9310. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9311. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9312. do { \
  9313. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9314. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9315. } while (0)
  9316. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9317. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9318. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9319. do { \
  9320. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9321. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9322. } while (0)
  9323. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9324. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9325. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9326. do { \
  9327. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9328. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9329. } while (0)
  9330. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9331. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9332. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9333. do { \
  9334. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9335. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9336. } while (0)
  9337. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9338. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9339. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9340. do { \
  9341. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9342. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9343. } while (0)
  9344. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9345. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9346. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9347. do { \
  9348. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9349. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9350. } while (0)
  9351. /**
  9352. * @brief target -> host rx peer map/unmap message definition
  9353. *
  9354. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9355. *
  9356. * @details
  9357. * The following diagram shows the format of the rx peer map message sent
  9358. * from the target to the host. This layout assumes the target operates
  9359. * as little-endian.
  9360. *
  9361. * This message always contains a SW peer ID. The main purpose of the
  9362. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9363. * with, so that the host can use that peer ID to determine which peer
  9364. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9365. * other purposes, such as identifying during tx completions which peer
  9366. * the tx frames in question were transmitted to.
  9367. *
  9368. * In certain generations of chips, the peer map message also contains
  9369. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9370. * to identify which peer the frame needs to be forwarded to (i.e. the
  9371. * peer assocated with the Destination MAC Address within the packet),
  9372. * and particularly which vdev needs to transmit the frame (for cases
  9373. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9374. * meaning as AST_INDEX_0.
  9375. * This DA-based peer ID that is provided for certain rx frames
  9376. * (the rx frames that need to be re-transmitted as tx frames)
  9377. * is the ID that the HW uses for referring to the peer in question,
  9378. * rather than the peer ID that the SW+FW use to refer to the peer.
  9379. *
  9380. *
  9381. * |31 24|23 16|15 8|7 0|
  9382. * |-----------------------------------------------------------------------|
  9383. * | SW peer ID | VDEV ID | msg type |
  9384. * |-----------------------------------------------------------------------|
  9385. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9386. * |-----------------------------------------------------------------------|
  9387. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9388. * |-----------------------------------------------------------------------|
  9389. *
  9390. *
  9391. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9392. *
  9393. * The following diagram shows the format of the rx peer unmap message sent
  9394. * from the target to the host.
  9395. *
  9396. * |31 24|23 16|15 8|7 0|
  9397. * |-----------------------------------------------------------------------|
  9398. * | SW peer ID | VDEV ID | msg type |
  9399. * |-----------------------------------------------------------------------|
  9400. *
  9401. * The following field definitions describe the format of the rx peer map
  9402. * and peer unmap messages sent from the target to the host.
  9403. * - MSG_TYPE
  9404. * Bits 7:0
  9405. * Purpose: identifies this as an rx peer map or peer unmap message
  9406. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9407. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9408. * - VDEV_ID
  9409. * Bits 15:8
  9410. * Purpose: Indicates which virtual device the peer is associated
  9411. * with.
  9412. * Value: vdev ID (used in the host to look up the vdev object)
  9413. * - PEER_ID (a.k.a. SW_PEER_ID)
  9414. * Bits 31:16
  9415. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9416. * freeing (unmap)
  9417. * Value: (rx) peer ID
  9418. * - MAC_ADDR_L32 (peer map only)
  9419. * Bits 31:0
  9420. * Purpose: Identifies which peer node the peer ID is for.
  9421. * Value: lower 4 bytes of peer node's MAC address
  9422. * - MAC_ADDR_U16 (peer map only)
  9423. * Bits 15:0
  9424. * Purpose: Identifies which peer node the peer ID is for.
  9425. * Value: upper 2 bytes of peer node's MAC address
  9426. * - HW_PEER_ID
  9427. * Bits 31:16
  9428. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9429. * address, so for rx frames marked for rx --> tx forwarding, the
  9430. * host can determine from the HW peer ID provided as meta-data with
  9431. * the rx frame which peer the frame is supposed to be forwarded to.
  9432. * Value: ID used by the MAC HW to identify the peer
  9433. */
  9434. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9435. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9436. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9437. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9438. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9439. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9440. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9441. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9442. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9443. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9444. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9445. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9446. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9447. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9448. do { \
  9449. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9450. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9451. } while (0)
  9452. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9453. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9454. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9455. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9456. do { \
  9457. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9458. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9459. } while (0)
  9460. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9461. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9462. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9463. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9464. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9465. do { \
  9466. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9467. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9468. } while (0)
  9469. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9470. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9471. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9472. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9473. #define HTT_RX_PEER_MAP_BYTES 12
  9474. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9475. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9476. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9477. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9478. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9479. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9480. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9481. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9482. #define HTT_RX_PEER_UNMAP_BYTES 4
  9483. /**
  9484. * @brief target -> host rx peer map V2 message definition
  9485. *
  9486. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9487. *
  9488. * @details
  9489. * The following diagram shows the format of the rx peer map v2 message sent
  9490. * from the target to the host. This layout assumes the target operates
  9491. * as little-endian.
  9492. *
  9493. * This message always contains a SW peer ID. The main purpose of the
  9494. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9495. * with, so that the host can use that peer ID to determine which peer
  9496. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9497. * other purposes, such as identifying during tx completions which peer
  9498. * the tx frames in question were transmitted to.
  9499. *
  9500. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9501. * is used during rx --> tx frame forwarding to identify which peer the
  9502. * frame needs to be forwarded to (i.e. the peer assocated with the
  9503. * Destination MAC Address within the packet), and particularly which vdev
  9504. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9505. * This DA-based peer ID that is provided for certain rx frames
  9506. * (the rx frames that need to be re-transmitted as tx frames)
  9507. * is the ID that the HW uses for referring to the peer in question,
  9508. * rather than the peer ID that the SW+FW use to refer to the peer.
  9509. *
  9510. * The HW peer id here is the same meaning as AST_INDEX_0.
  9511. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9512. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9513. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9514. * AST is valid.
  9515. *
  9516. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9517. * |-------------------------------------------------------------------------|
  9518. * | SW peer ID | VDEV ID | msg type |
  9519. * |-------------------------------------------------------------------------|
  9520. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9521. * |-------------------------------------------------------------------------|
  9522. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9523. * |-------------------------------------------------------------------------|
  9524. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9525. * |-------------------------------------------------------------------------|
  9526. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9527. * |-------------------------------------------------------------------------|
  9528. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9529. * |-------------------------------------------------------------------------|
  9530. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9531. * |-------------------------------------------------------------------------|
  9532. * | Reserved_2 |
  9533. * |-------------------------------------------------------------------------|
  9534. * Where:
  9535. * NH = Next Hop
  9536. * ASTVM = AST valid mask
  9537. * OA = on-chip AST valid bit
  9538. * ASTFM = AST flow mask
  9539. *
  9540. * The following field definitions describe the format of the rx peer map v2
  9541. * messages sent from the target to the host.
  9542. * - MSG_TYPE
  9543. * Bits 7:0
  9544. * Purpose: identifies this as an rx peer map v2 message
  9545. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9546. * - VDEV_ID
  9547. * Bits 15:8
  9548. * Purpose: Indicates which virtual device the peer is associated with.
  9549. * Value: vdev ID (used in the host to look up the vdev object)
  9550. * - SW_PEER_ID
  9551. * Bits 31:16
  9552. * Purpose: The peer ID (index) that WAL is allocating
  9553. * Value: (rx) peer ID
  9554. * - MAC_ADDR_L32
  9555. * Bits 31:0
  9556. * Purpose: Identifies which peer node the peer ID is for.
  9557. * Value: lower 4 bytes of peer node's MAC address
  9558. * - MAC_ADDR_U16
  9559. * Bits 15:0
  9560. * Purpose: Identifies which peer node the peer ID is for.
  9561. * Value: upper 2 bytes of peer node's MAC address
  9562. * - HW_PEER_ID / AST_INDEX_0
  9563. * Bits 31:16
  9564. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9565. * address, so for rx frames marked for rx --> tx forwarding, the
  9566. * host can determine from the HW peer ID provided as meta-data with
  9567. * the rx frame which peer the frame is supposed to be forwarded to.
  9568. * Value: ID used by the MAC HW to identify the peer
  9569. * - AST_HASH_VALUE
  9570. * Bits 15:0
  9571. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9572. * override feature.
  9573. * - NEXT_HOP
  9574. * Bit 16
  9575. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9576. * (Wireless Distribution System).
  9577. * - AST_VALID_MASK
  9578. * Bits 19:17
  9579. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9580. * - ONCHIP_AST_VALID_FLAG
  9581. * Bit 20
  9582. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9583. * is valid.
  9584. * - AST_INDEX_1
  9585. * Bits 15:0
  9586. * Purpose: indicate the second AST index for this peer
  9587. * - AST_0_FLOW_MASK
  9588. * Bits 19:16
  9589. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9590. * - AST_1_FLOW_MASK
  9591. * Bits 23:20
  9592. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9593. * - AST_2_FLOW_MASK
  9594. * Bits 27:24
  9595. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9596. * - AST_3_FLOW_MASK
  9597. * Bits 31:28
  9598. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9599. * - AST_INDEX_2
  9600. * Bits 15:0
  9601. * Purpose: indicate the third AST index for this peer
  9602. * - TID_VALID_HI_PRI
  9603. * Bits 23:16
  9604. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9605. * - TID_VALID_LOW_PRI
  9606. * Bits 31:24
  9607. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9608. * - AST_INDEX_3
  9609. * Bits 15:0
  9610. * Purpose: indicate the fourth AST index for this peer
  9611. * - ONCHIP_AST_IDX / RESERVED
  9612. * Bits 31:16
  9613. * Purpose: This field is valid only when split AST feature is enabled.
  9614. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9615. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9616. * address, this ast_idx is used for LMAC modules for RXPCU.
  9617. * Value: ID used by the LMAC HW to identify the peer
  9618. */
  9619. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9620. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9621. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9622. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9623. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9624. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9625. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9626. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9627. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9628. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9629. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9630. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9631. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9632. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9633. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9634. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9635. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9636. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9637. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9638. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9639. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9640. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9641. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9642. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9643. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9644. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9645. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9646. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9647. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9648. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9649. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9650. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9651. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9652. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9653. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9654. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9655. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9656. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9657. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9658. do { \
  9659. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9660. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9661. } while (0)
  9662. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9663. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9664. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9665. do { \
  9666. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9667. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9668. } while (0)
  9669. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9670. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9671. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9672. do { \
  9673. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9674. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9675. } while (0)
  9676. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9677. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9678. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9679. do { \
  9680. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9681. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9682. } while (0)
  9683. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9684. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9685. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9686. do { \
  9687. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9688. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9689. } while (0)
  9690. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9691. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9692. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9693. do { \
  9694. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9695. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9696. } while (0)
  9697. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9698. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9699. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9700. do { \
  9701. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9702. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9703. } while (0)
  9704. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9705. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9706. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9707. do { \
  9708. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9709. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9710. } while (0)
  9711. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9712. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9713. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9714. do { \
  9715. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9716. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9717. } while (0)
  9718. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9719. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9720. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9721. do { \
  9722. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9723. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9724. } while (0)
  9725. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9726. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9727. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9728. do { \
  9729. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9730. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9731. } while (0)
  9732. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9733. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9734. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9735. do { \
  9736. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9737. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9738. } while (0)
  9739. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9740. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9741. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9742. do { \
  9743. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9744. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9745. } while (0)
  9746. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9747. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9748. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9749. do { \
  9750. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9751. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9752. } while (0)
  9753. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9754. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9755. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9756. do { \
  9757. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9758. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9759. } while (0)
  9760. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9761. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9762. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9763. do { \
  9764. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9765. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9766. } while (0)
  9767. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9768. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9769. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9770. do { \
  9771. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9772. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9773. } while (0)
  9774. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9775. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9776. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9777. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9778. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9779. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9780. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9781. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9782. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9783. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9784. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9785. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9786. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9787. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9788. /**
  9789. * @brief target -> host rx peer map V3 message definition
  9790. *
  9791. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9792. *
  9793. * @details
  9794. * The following diagram shows the format of the rx peer map v3 message sent
  9795. * from the target to the host.
  9796. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9797. * This layout assumes the target operates as little-endian.
  9798. *
  9799. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9800. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9801. * | SW peer ID | VDEV ID | msg type |
  9802. * |-----------------+--------------------+-----------------+-----------------|
  9803. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9804. * |-----------------+--------------------+-----------------+-----------------|
  9805. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9806. * |-----------------+--------+-----------+-----------------+-----------------|
  9807. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9808. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9809. * | (8bits) | | (4bits) | |
  9810. * |-----------------+--------+--+--+--+--------------------------------------|
  9811. * | RESERVED |E |O | | |
  9812. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9813. * | |V |V | | |
  9814. * |-----------------+--------------------+-----------------------------------|
  9815. * | HTT_MSDU_IDX_ | RESERVED | |
  9816. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9817. * | (8bits) | | |
  9818. * |-----------------+--------------------+-----------------------------------|
  9819. * | Reserved_2 |
  9820. * |--------------------------------------------------------------------------|
  9821. * | Reserved_3 |
  9822. * |--------------------------------------------------------------------------|
  9823. *
  9824. * Where:
  9825. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9826. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9827. * NH = Next Hop
  9828. * The following field definitions describe the format of the rx peer map v3
  9829. * messages sent from the target to the host.
  9830. * - MSG_TYPE
  9831. * Bits 7:0
  9832. * Purpose: identifies this as a peer map v3 message
  9833. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9834. * - VDEV_ID
  9835. * Bits 15:8
  9836. * Purpose: Indicates which virtual device the peer is associated with.
  9837. * - SW_PEER_ID
  9838. * Bits 31:16
  9839. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9840. * - MAC_ADDR_L32
  9841. * Bits 31:0
  9842. * Purpose: Identifies which peer node the peer ID is for.
  9843. * Value: lower 4 bytes of peer node's MAC address
  9844. * - MAC_ADDR_U16
  9845. * Bits 15:0
  9846. * Purpose: Identifies which peer node the peer ID is for.
  9847. * Value: upper 2 bytes of peer node's MAC address
  9848. * - MULTICAST_SW_PEER_ID
  9849. * Bits 31:16
  9850. * Purpose: The multicast peer ID (index)
  9851. * Value: set to HTT_INVALID_PEER if not valid
  9852. * - HW_PEER_ID / AST_INDEX
  9853. * Bits 15:0
  9854. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9855. * address, so for rx frames marked for rx --> tx forwarding, the
  9856. * host can determine from the HW peer ID provided as meta-data with
  9857. * the rx frame which peer the frame is supposed to be forwarded to.
  9858. * - CACHE_SET_NUM
  9859. * Bits 19:16
  9860. * Purpose: Cache Set Number for AST_INDEX
  9861. * Cache set number that should be used to cache the index based
  9862. * search results, for address and flow search.
  9863. * This value should be equal to LSB 4 bits of the hash value
  9864. * of match data, in case of search index points to an entry which
  9865. * may be used in content based search also. The value can be
  9866. * anything when the entry pointed by search index will not be
  9867. * used for content based search.
  9868. * - HTT_MSDU_IDX_VALID_MASK
  9869. * Bits 31:24
  9870. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9871. * - ONCHIP_AST_IDX / RESERVED
  9872. * Bits 15:0
  9873. * Purpose: This field is valid only when split AST feature is enabled.
  9874. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9875. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9876. * address, this ast_idx is used for LMAC modules for RXPCU.
  9877. * - NEXT_HOP
  9878. * Bits 16
  9879. * Purpose: Flag indicates next_hop AST entry used for WDS
  9880. * (Wireless Distribution System).
  9881. * - ONCHIP_AST_VALID
  9882. * Bits 17
  9883. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9884. * - EXT_AST_VALID
  9885. * Bits 18
  9886. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9887. * - EXT_AST_INDEX
  9888. * Bits 15:0
  9889. * Purpose: This field describes Extended AST index
  9890. * Valid if EXT_AST_VALID flag set
  9891. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9892. * Bits 31:24
  9893. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9894. */
  9895. /* dword 0 */
  9896. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9897. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9898. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9899. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9900. /* dword 1 */
  9901. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9902. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9903. /* dword 2 */
  9904. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9905. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9906. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9907. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9908. /* dword 3 */
  9909. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9910. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9911. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9912. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9913. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9914. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9915. /* dword 4 */
  9916. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9917. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9918. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9919. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9920. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9921. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9922. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9923. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9924. /* dword 5 */
  9925. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9926. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9927. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9928. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9929. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9930. do { \
  9931. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9932. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9933. } while (0)
  9934. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9935. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9936. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9937. do { \
  9938. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9939. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9940. } while (0)
  9941. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9942. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9943. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9946. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9947. } while (0)
  9948. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9949. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9950. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9953. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9954. } while (0)
  9955. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9956. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9957. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9958. do { \
  9959. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9960. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9961. } while (0)
  9962. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9963. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9964. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9965. do { \
  9966. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9967. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9968. } while (0)
  9969. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9970. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9971. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9972. do { \
  9973. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9974. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9975. } while (0)
  9976. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9977. (((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)
  9978. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9981. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9982. } while (0)
  9983. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9984. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9985. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9986. do { \
  9987. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9988. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9989. } while (0)
  9990. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9991. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9992. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9993. do { \
  9994. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9995. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9996. } while (0)
  9997. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9998. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9999. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10000. do { \
  10001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10002. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10003. } while (0)
  10004. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10005. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10006. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10007. do { \
  10008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10009. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10010. } while (0)
  10011. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10012. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10013. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10014. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10015. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10016. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10019. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10020. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10021. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10023. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10024. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10025. /**
  10026. * @brief target -> host rx peer unmap V2 message definition
  10027. *
  10028. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10029. *
  10030. * The following diagram shows the format of the rx peer unmap message sent
  10031. * from the target to the host.
  10032. *
  10033. * |31 24|23 16|15 8|7 0|
  10034. * |-----------------------------------------------------------------------|
  10035. * | SW peer ID | VDEV ID | msg type |
  10036. * |-----------------------------------------------------------------------|
  10037. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10038. * |-----------------------------------------------------------------------|
  10039. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10040. * |-----------------------------------------------------------------------|
  10041. * | Peer Delete Duration |
  10042. * |-----------------------------------------------------------------------|
  10043. * | Reserved_0 | WDS Free Count |
  10044. * |-----------------------------------------------------------------------|
  10045. * | Reserved_1 |
  10046. * |-----------------------------------------------------------------------|
  10047. * | Reserved_2 |
  10048. * |-----------------------------------------------------------------------|
  10049. *
  10050. *
  10051. * The following field definitions describe the format of the rx peer unmap
  10052. * messages sent from the target to the host.
  10053. * - MSG_TYPE
  10054. * Bits 7:0
  10055. * Purpose: identifies this as an rx peer unmap v2 message
  10056. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10057. * - VDEV_ID
  10058. * Bits 15:8
  10059. * Purpose: Indicates which virtual device the peer is associated
  10060. * with.
  10061. * Value: vdev ID (used in the host to look up the vdev object)
  10062. * - SW_PEER_ID
  10063. * Bits 31:16
  10064. * Purpose: The peer ID (index) that WAL is freeing
  10065. * Value: (rx) peer ID
  10066. * - MAC_ADDR_L32
  10067. * Bits 31:0
  10068. * Purpose: Identifies which peer node the peer ID is for.
  10069. * Value: lower 4 bytes of peer node's MAC address
  10070. * - MAC_ADDR_U16
  10071. * Bits 15:0
  10072. * Purpose: Identifies which peer node the peer ID is for.
  10073. * Value: upper 2 bytes of peer node's MAC address
  10074. * - NEXT_HOP
  10075. * Bits 16
  10076. * Purpose: Bit indicates next_hop AST entry used for WDS
  10077. * (Wireless Distribution System).
  10078. * - PEER_DELETE_DURATION
  10079. * Bits 31:0
  10080. * Purpose: Time taken to delete peer, in msec,
  10081. * Used for monitoring / debugging PEER delete response delay
  10082. * - PEER_WDS_FREE_COUNT
  10083. * Bits 15:0
  10084. * Purpose: Count of WDS entries deleted associated to peer deleted
  10085. */
  10086. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10087. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10088. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10089. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10090. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10091. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10092. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10093. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10094. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10095. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10096. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10097. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10098. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10099. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10100. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10101. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10102. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10103. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10104. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10105. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10106. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10107. do { \
  10108. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10109. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10110. } while (0)
  10111. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10112. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10113. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10114. do { \
  10115. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10116. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10117. } while (0)
  10118. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10119. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10120. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10121. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10122. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10123. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10124. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10125. /**
  10126. * @brief target -> host rx peer mlo map message definition
  10127. *
  10128. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10129. *
  10130. * @details
  10131. * The following diagram shows the format of the rx mlo peer map message sent
  10132. * from the target to the host. This layout assumes the target operates
  10133. * as little-endian.
  10134. *
  10135. * MCC:
  10136. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10137. *
  10138. * WIN:
  10139. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10140. * It will be sent on the Assoc Link.
  10141. *
  10142. * This message always contains a MLO peer ID. The main purpose of the
  10143. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10144. * with, so that the host can use that MLO peer ID to determine which peer
  10145. * transmitted the rx frame.
  10146. *
  10147. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10148. * |-------------------------------------------------------------------------|
  10149. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10150. * |-------------------------------------------------------------------------|
  10151. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10152. * |-------------------------------------------------------------------------|
  10153. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10154. * |-------------------------------------------------------------------------|
  10155. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10156. * |-------------------------------------------------------------------------|
  10157. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10158. * |-------------------------------------------------------------------------|
  10159. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10160. * |-------------------------------------------------------------------------|
  10161. * |RSVD |
  10162. * |-------------------------------------------------------------------------|
  10163. * |RSVD |
  10164. * |-------------------------------------------------------------------------|
  10165. * | htt_tlv_hdr_t |
  10166. * |-------------------------------------------------------------------------|
  10167. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10168. * |-------------------------------------------------------------------------|
  10169. * | htt_tlv_hdr_t |
  10170. * |-------------------------------------------------------------------------|
  10171. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10172. * |-------------------------------------------------------------------------|
  10173. * | htt_tlv_hdr_t |
  10174. * |-------------------------------------------------------------------------|
  10175. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10176. * |-------------------------------------------------------------------------|
  10177. *
  10178. * Where:
  10179. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10180. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10181. * V (valid) - 1 Bit Bit17
  10182. * CHIPID - 3 Bits
  10183. * TIDMASK - 8 Bits
  10184. * CACHE_SET_NUM - 8 Bits
  10185. *
  10186. * The following field definitions describe the format of the rx MLO peer map
  10187. * messages sent from the target to the host.
  10188. * - MSG_TYPE
  10189. * Bits 7:0
  10190. * Purpose: identifies this as an rx mlo peer map message
  10191. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10192. *
  10193. * - MLO_PEER_ID
  10194. * Bits 23:8
  10195. * Purpose: The MLO peer ID (index).
  10196. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10197. * Value: MLO peer ID
  10198. *
  10199. * - NUMLINK
  10200. * Bits: 26:24 (3Bits)
  10201. * Purpose: Indicate the max number of logical links supported per client.
  10202. * Value: number of logical links
  10203. *
  10204. * - PRC
  10205. * Bits: 29:27 (3Bits)
  10206. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10207. * if there is migration of the primary chip.
  10208. * Value: Primary REO CHIPID
  10209. *
  10210. * - MAC_ADDR_L32
  10211. * Bits 31:0
  10212. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10213. * Value: lower 4 bytes of peer node's MAC address
  10214. *
  10215. * - MAC_ADDR_U16
  10216. * Bits 15:0
  10217. * Purpose: Identifies which peer node the peer ID is for.
  10218. * Value: upper 2 bytes of peer node's MAC address
  10219. *
  10220. * - PRIMARY_TCL_AST_IDX
  10221. * Bits 15:0
  10222. * Purpose: Primary TCL AST index for this peer.
  10223. *
  10224. * - V
  10225. * 1 Bit Position 16
  10226. * Purpose: If the ast idx is valid.
  10227. *
  10228. * - CHIPID
  10229. * Bits 19:17
  10230. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10231. *
  10232. * - TIDMASK
  10233. * Bits 27:20
  10234. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10235. *
  10236. * - CACHE_SET_NUM
  10237. * Bits 31:28
  10238. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10239. * Cache set number that should be used to cache the index based
  10240. * search results, for address and flow search.
  10241. * This value should be equal to LSB four bits of the hash value
  10242. * of match data, in case of search index points to an entry which
  10243. * may be used in content based search also. The value can be
  10244. * anything when the entry pointed by search index will not be
  10245. * used for content based search.
  10246. *
  10247. * - htt_tlv_hdr_t
  10248. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10249. *
  10250. * Bits 11:0
  10251. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10252. *
  10253. * Bits 23:12
  10254. * Purpose: Length, Length of the value that follows the header
  10255. *
  10256. * Bits 31:28
  10257. * Purpose: Reserved.
  10258. *
  10259. *
  10260. * - SW_PEER_ID
  10261. * Bits 15:0
  10262. * Purpose: The peer ID (index) that WAL is allocating
  10263. * Value: (rx) peer ID
  10264. *
  10265. * - VDEV_ID
  10266. * Bits 23:16
  10267. * Purpose: Indicates which virtual device the peer is associated with.
  10268. * Value: vdev ID (used in the host to look up the vdev object)
  10269. *
  10270. * - CHIPID
  10271. * Bits 26:24
  10272. * Purpose: Indicates which Chip id the peer is associated with.
  10273. * Value: chip ID (Provided by Host as part of QMI exchange)
  10274. */
  10275. typedef enum {
  10276. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10277. } MLO_PEER_MAP_TLV_TAG_ID;
  10278. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10279. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10280. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10281. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10282. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10283. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10284. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10285. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10286. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10287. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10288. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10289. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10290. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10291. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10292. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10293. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10294. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10295. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10296. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10297. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10298. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10299. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10300. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10301. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10302. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10303. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10304. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10305. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10306. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10307. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10308. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10309. do { \
  10310. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10311. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10312. } while (0)
  10313. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10314. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10315. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10316. do { \
  10317. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10318. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10319. } while (0)
  10320. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10321. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10322. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10323. do { \
  10324. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10325. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10326. } while (0)
  10327. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10328. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10329. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10330. do { \
  10331. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10332. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10333. } while (0)
  10334. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10335. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10336. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10337. do { \
  10338. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10339. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10340. } while (0)
  10341. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10342. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10343. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10344. do { \
  10345. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10346. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10347. } while (0)
  10348. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10349. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10350. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10351. do { \
  10352. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10353. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10354. } while (0)
  10355. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10356. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10357. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10358. do { \
  10359. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10360. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10361. } while (0)
  10362. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10363. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10364. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10365. do { \
  10366. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10367. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10368. } while (0)
  10369. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10370. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10371. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10372. do { \
  10373. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10374. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10375. } while (0)
  10376. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10377. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10378. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10379. do { \
  10380. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10381. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10382. } while (0)
  10383. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10384. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10385. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10386. do { \
  10387. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10388. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10389. } while (0)
  10390. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10391. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10392. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10393. do { \
  10394. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10395. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10396. } while (0)
  10397. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10398. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10399. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10400. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10401. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10402. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10403. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10404. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10405. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10406. *
  10407. * The following diagram shows the format of the rx mlo peer unmap message sent
  10408. * from the target to the host.
  10409. *
  10410. * |31 24|23 16|15 8|7 0|
  10411. * |-----------------------------------------------------------------------|
  10412. * | RSVD_24_31 | MLO peer ID | msg type |
  10413. * |-----------------------------------------------------------------------|
  10414. */
  10415. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10416. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10417. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10418. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10419. /**
  10420. * @brief target -> host message specifying security parameters
  10421. *
  10422. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10423. *
  10424. * @details
  10425. * The following diagram shows the format of the security specification
  10426. * message sent from the target to the host.
  10427. * This security specification message tells the host whether a PN check is
  10428. * necessary on rx data frames, and if so, how large the PN counter is.
  10429. * This message also tells the host about the security processing to apply
  10430. * to defragmented rx frames - specifically, whether a Message Integrity
  10431. * Check is required, and the Michael key to use.
  10432. *
  10433. * |31 24|23 16|15|14 8|7 0|
  10434. * |-----------------------------------------------------------------------|
  10435. * | peer ID | U| security type | msg type |
  10436. * |-----------------------------------------------------------------------|
  10437. * | Michael Key K0 |
  10438. * |-----------------------------------------------------------------------|
  10439. * | Michael Key K1 |
  10440. * |-----------------------------------------------------------------------|
  10441. * | WAPI RSC Low0 |
  10442. * |-----------------------------------------------------------------------|
  10443. * | WAPI RSC Low1 |
  10444. * |-----------------------------------------------------------------------|
  10445. * | WAPI RSC Hi0 |
  10446. * |-----------------------------------------------------------------------|
  10447. * | WAPI RSC Hi1 |
  10448. * |-----------------------------------------------------------------------|
  10449. *
  10450. * The following field definitions describe the format of the security
  10451. * indication message sent from the target to the host.
  10452. * - MSG_TYPE
  10453. * Bits 7:0
  10454. * Purpose: identifies this as a security specification message
  10455. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10456. * - SEC_TYPE
  10457. * Bits 14:8
  10458. * Purpose: specifies which type of security applies to the peer
  10459. * Value: htt_sec_type enum value
  10460. * - UNICAST
  10461. * Bit 15
  10462. * Purpose: whether this security is applied to unicast or multicast data
  10463. * Value: 1 -> unicast, 0 -> multicast
  10464. * - PEER_ID
  10465. * Bits 31:16
  10466. * Purpose: The ID number for the peer the security specification is for
  10467. * Value: peer ID
  10468. * - MICHAEL_KEY_K0
  10469. * Bits 31:0
  10470. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10471. * Value: Michael Key K0 (if security type is TKIP)
  10472. * - MICHAEL_KEY_K1
  10473. * Bits 31:0
  10474. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10475. * Value: Michael Key K1 (if security type is TKIP)
  10476. * - WAPI_RSC_LOW0
  10477. * Bits 31:0
  10478. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10479. * Value: WAPI RSC Low0 (if security type is WAPI)
  10480. * - WAPI_RSC_LOW1
  10481. * Bits 31:0
  10482. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10483. * Value: WAPI RSC Low1 (if security type is WAPI)
  10484. * - WAPI_RSC_HI0
  10485. * Bits 31:0
  10486. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10487. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10488. * - WAPI_RSC_HI1
  10489. * Bits 31:0
  10490. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10491. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10492. */
  10493. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10494. #define HTT_SEC_IND_SEC_TYPE_S 8
  10495. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10496. #define HTT_SEC_IND_UNICAST_S 15
  10497. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10498. #define HTT_SEC_IND_PEER_ID_S 16
  10499. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10500. do { \
  10501. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10502. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10503. } while (0)
  10504. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10505. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10506. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10507. do { \
  10508. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10509. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10510. } while (0)
  10511. #define HTT_SEC_IND_UNICAST_GET(word) \
  10512. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10513. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10514. do { \
  10515. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10516. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10517. } while (0)
  10518. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10519. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10520. #define HTT_SEC_IND_BYTES 28
  10521. /**
  10522. * @brief target -> host rx ADDBA / DELBA message definitions
  10523. *
  10524. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10525. *
  10526. * @details
  10527. * The following diagram shows the format of the rx ADDBA message sent
  10528. * from the target to the host:
  10529. *
  10530. * |31 20|19 16|15 8|7 0|
  10531. * |---------------------------------------------------------------------|
  10532. * | peer ID | TID | window size | msg type |
  10533. * |---------------------------------------------------------------------|
  10534. *
  10535. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10536. *
  10537. * The following diagram shows the format of the rx DELBA message sent
  10538. * from the target to the host:
  10539. *
  10540. * |31 20|19 16|15 10|9 8|7 0|
  10541. * |---------------------------------------------------------------------|
  10542. * | peer ID | TID | window size | IR| msg type |
  10543. * |---------------------------------------------------------------------|
  10544. *
  10545. * The following field definitions describe the format of the rx ADDBA
  10546. * and DELBA messages sent from the target to the host.
  10547. * - MSG_TYPE
  10548. * Bits 7:0
  10549. * Purpose: identifies this as an rx ADDBA or DELBA message
  10550. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10551. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10552. * - IR (initiator / recipient)
  10553. * Bits 9:8 (DELBA only)
  10554. * Purpose: specify whether the DELBA handshake was initiated by the
  10555. * local STA/AP, or by the peer STA/AP
  10556. * Value:
  10557. * 0 - unspecified
  10558. * 1 - initiator (a.k.a. originator)
  10559. * 2 - recipient (a.k.a. responder)
  10560. * 3 - unused / reserved
  10561. * - WIN_SIZE
  10562. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10563. * Purpose: Specifies the length of the block ack window (max = 64).
  10564. * Value:
  10565. * block ack window length specified by the received ADDBA/DELBA
  10566. * management message.
  10567. * - TID
  10568. * Bits 19:16
  10569. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10570. * Value:
  10571. * TID specified by the received ADDBA or DELBA management message.
  10572. * - PEER_ID
  10573. * Bits 31:20
  10574. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10575. * Value:
  10576. * ID (hash value) used by the host for fast, direct lookup of
  10577. * host SW peer info, including rx reorder states.
  10578. */
  10579. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10580. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10581. #define HTT_RX_ADDBA_TID_M 0xf0000
  10582. #define HTT_RX_ADDBA_TID_S 16
  10583. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10584. #define HTT_RX_ADDBA_PEER_ID_S 20
  10585. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10588. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10589. } while (0)
  10590. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10591. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10592. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10593. do { \
  10594. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10595. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10596. } while (0)
  10597. #define HTT_RX_ADDBA_TID_GET(word) \
  10598. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10599. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10600. do { \
  10601. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10602. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10603. } while (0)
  10604. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10605. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10606. #define HTT_RX_ADDBA_BYTES 4
  10607. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10608. #define HTT_RX_DELBA_INITIATOR_S 8
  10609. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10610. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10611. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10612. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10613. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10614. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10615. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10616. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10617. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10618. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10619. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10620. do { \
  10621. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10622. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10623. } while (0)
  10624. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10625. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10626. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10627. do { \
  10628. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10629. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10630. } while (0)
  10631. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10632. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10633. #define HTT_RX_DELBA_BYTES 4
  10634. /**
  10635. * @brief tx queue group information element definition
  10636. *
  10637. * @details
  10638. * The following diagram shows the format of the tx queue group
  10639. * information element, which can be included in target --> host
  10640. * messages to specify the number of tx "credits" (tx descriptors
  10641. * for LL, or tx buffers for HL) available to a particular group
  10642. * of host-side tx queues, and which host-side tx queues belong to
  10643. * the group.
  10644. *
  10645. * |31|30 24|23 16|15|14|13 0|
  10646. * |------------------------------------------------------------------------|
  10647. * | X| reserved | tx queue grp ID | A| S| credit count |
  10648. * |------------------------------------------------------------------------|
  10649. * | vdev ID mask | AC mask |
  10650. * |------------------------------------------------------------------------|
  10651. *
  10652. * The following definitions describe the fields within the tx queue group
  10653. * information element:
  10654. * - credit_count
  10655. * Bits 13:1
  10656. * Purpose: specify how many tx credits are available to the tx queue group
  10657. * Value: An absolute or relative, positive or negative credit value
  10658. * The 'A' bit specifies whether the value is absolute or relative.
  10659. * The 'S' bit specifies whether the value is positive or negative.
  10660. * A negative value can only be relative, not absolute.
  10661. * An absolute value replaces any prior credit value the host has for
  10662. * the tx queue group in question.
  10663. * A relative value is added to the prior credit value the host has for
  10664. * the tx queue group in question.
  10665. * - sign
  10666. * Bit 14
  10667. * Purpose: specify whether the credit count is positive or negative
  10668. * Value: 0 -> positive, 1 -> negative
  10669. * - absolute
  10670. * Bit 15
  10671. * Purpose: specify whether the credit count is absolute or relative
  10672. * Value: 0 -> relative, 1 -> absolute
  10673. * - txq_group_id
  10674. * Bits 23:16
  10675. * Purpose: indicate which tx queue group's credit and/or membership are
  10676. * being specified
  10677. * Value: 0 to max_tx_queue_groups-1
  10678. * - reserved
  10679. * Bits 30:16
  10680. * Value: 0x0
  10681. * - eXtension
  10682. * Bit 31
  10683. * Purpose: specify whether another tx queue group info element follows
  10684. * Value: 0 -> no more tx queue group information elements
  10685. * 1 -> another tx queue group information element immediately follows
  10686. * - ac_mask
  10687. * Bits 15:0
  10688. * Purpose: specify which Access Categories belong to the tx queue group
  10689. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10690. * the tx queue group.
  10691. * The AC bit-mask values are obtained by left-shifting by the
  10692. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10693. * - vdev_id_mask
  10694. * Bits 31:16
  10695. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10696. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10697. * belong to the tx queue group.
  10698. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10699. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10700. */
  10701. PREPACK struct htt_txq_group {
  10702. A_UINT32
  10703. credit_count: 14,
  10704. sign: 1,
  10705. absolute: 1,
  10706. tx_queue_group_id: 8,
  10707. reserved0: 7,
  10708. extension: 1;
  10709. A_UINT32
  10710. ac_mask: 16,
  10711. vdev_id_mask: 16;
  10712. } POSTPACK;
  10713. /* first word */
  10714. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10715. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10716. #define HTT_TXQ_GROUP_SIGN_S 14
  10717. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10718. #define HTT_TXQ_GROUP_ABS_S 15
  10719. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10720. #define HTT_TXQ_GROUP_ID_S 16
  10721. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10722. #define HTT_TXQ_GROUP_EXT_S 31
  10723. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10724. /* second word */
  10725. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10726. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10727. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10728. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10729. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10730. do { \
  10731. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10732. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10733. } while (0)
  10734. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10735. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10736. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10737. do { \
  10738. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10739. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10740. } while (0)
  10741. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10742. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10743. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10744. do { \
  10745. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10746. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10747. } while (0)
  10748. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10749. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10750. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10751. do { \
  10752. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10753. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10754. } while (0)
  10755. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10756. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10757. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10758. do { \
  10759. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10760. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10761. } while (0)
  10762. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10763. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10764. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10765. do { \
  10766. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10767. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10768. } while (0)
  10769. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10770. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10771. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10772. do { \
  10773. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10774. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10775. } while (0)
  10776. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10777. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10778. /**
  10779. * @brief target -> host TX completion indication message definition
  10780. *
  10781. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10782. *
  10783. * @details
  10784. * The following diagram shows the format of the TX completion indication sent
  10785. * from the target to the host
  10786. *
  10787. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10788. * |-------------------------------------------------------------------|
  10789. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10790. * |-------------------------------------------------------------------|
  10791. * payload:| MSDU1 ID | MSDU0 ID |
  10792. * |-------------------------------------------------------------------|
  10793. * : MSDU3 ID | MSDU2 ID :
  10794. * |-------------------------------------------------------------------|
  10795. * | struct htt_tx_compl_ind_append_retries |
  10796. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10797. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10798. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10799. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10800. * |-------------------------------------------------------------------|
  10801. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10802. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10803. * | MSDU0 tx_tsf64_low |
  10804. * |-------------------------------------------------------------------|
  10805. * | MSDU0 tx_tsf64_high |
  10806. * |-------------------------------------------------------------------|
  10807. * | MSDU1 tx_tsf64_low |
  10808. * |-------------------------------------------------------------------|
  10809. * | MSDU1 tx_tsf64_high |
  10810. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10811. * | phy_timestamp |
  10812. * |-------------------------------------------------------------------|
  10813. * | rate specs (see below) |
  10814. * |-------------------------------------------------------------------|
  10815. * | seqctrl | framectrl |
  10816. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10817. * Where:
  10818. * A0 = append (a.k.a. append0)
  10819. * A1 = append1
  10820. * TP = MSDU tx power presence
  10821. * A2 = append2
  10822. * A3 = append3
  10823. * A4 = append4
  10824. *
  10825. * The following field definitions describe the format of the TX completion
  10826. * indication sent from the target to the host
  10827. * Header fields:
  10828. * - msg_type
  10829. * Bits 7:0
  10830. * Purpose: identifies this as HTT TX completion indication
  10831. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10832. * - status
  10833. * Bits 10:8
  10834. * Purpose: the TX completion status of payload fragmentations descriptors
  10835. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10836. * - tid
  10837. * Bits 14:11
  10838. * Purpose: the tid associated with those fragmentation descriptors. It is
  10839. * valid or not, depending on the tid_invalid bit.
  10840. * Value: 0 to 15
  10841. * - tid_invalid
  10842. * Bits 15:15
  10843. * Purpose: this bit indicates whether the tid field is valid or not
  10844. * Value: 0 indicates valid; 1 indicates invalid
  10845. * - num
  10846. * Bits 23:16
  10847. * Purpose: the number of payload in this indication
  10848. * Value: 1 to 255
  10849. * - append (a.k.a. append0)
  10850. * Bits 24:24
  10851. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10852. * the number of tx retries for one MSDU at the end of this message
  10853. * Value: 0 indicates no appending; 1 indicates appending
  10854. * - append1
  10855. * Bits 25:25
  10856. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10857. * contains the timestamp info for each TX msdu id in payload.
  10858. * The order of the timestamps matches the order of the MSDU IDs.
  10859. * Note that a big-endian host needs to account for the reordering
  10860. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10861. * conversion) when determining which tx timestamp corresponds to
  10862. * which MSDU ID.
  10863. * Value: 0 indicates no appending; 1 indicates appending
  10864. * - msdu_tx_power_presence
  10865. * Bits 26:26
  10866. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10867. * for each MSDU referenced by the TX_COMPL_IND message.
  10868. * The tx power is reported in 0.5 dBm units.
  10869. * The order of the per-MSDU tx power reports matches the order
  10870. * of the MSDU IDs.
  10871. * Note that a big-endian host needs to account for the reordering
  10872. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10873. * conversion) when determining which Tx Power corresponds to
  10874. * which MSDU ID.
  10875. * Value: 0 indicates MSDU tx power reports are not appended,
  10876. * 1 indicates MSDU tx power reports are appended
  10877. * - append2
  10878. * Bits 27:27
  10879. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10880. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10881. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10882. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10883. * for each MSDU, for convenience.
  10884. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10885. * this append2 bit is set).
  10886. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10887. * dB above the noise floor.
  10888. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10889. * 1 indicates MSDU ACK RSSI values are appended.
  10890. * - append3
  10891. * Bits 28:28
  10892. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10893. * contains the tx tsf info based on wlan global TSF for
  10894. * each TX msdu id in payload.
  10895. * The order of the tx tsf matches the order of the MSDU IDs.
  10896. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10897. * values to indicate the the lower 32 bits and higher 32 bits of
  10898. * the tx tsf.
  10899. * The tx_tsf64 here represents the time MSDU was acked and the
  10900. * tx_tsf64 has microseconds units.
  10901. * Value: 0 indicates no appending; 1 indicates appending
  10902. * - append4
  10903. * Bits 29:29
  10904. * Purpose: Indicate whether data frame control fields and fields required
  10905. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10906. * message. The order of the this message matches the order of
  10907. * the MSDU IDs.
  10908. * Value: 0 indicates frame control fields and fields required for
  10909. * radio tap header values are not appended,
  10910. * 1 indicates frame control fields and fields required for
  10911. * radio tap header values are appended.
  10912. * Payload fields:
  10913. * - hmsdu_id
  10914. * Bits 15:0
  10915. * Purpose: this ID is used to track the Tx buffer in host
  10916. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10917. */
  10918. PREPACK struct htt_tx_data_hdr_information {
  10919. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10920. A_UINT32 /* word 1 */
  10921. /* preamble:
  10922. * 0-OFDM,
  10923. * 1-CCk,
  10924. * 2-HT,
  10925. * 3-VHT
  10926. */
  10927. preamble: 2, /* [1:0] */
  10928. /* mcs:
  10929. * In case of HT preamble interpret
  10930. * MCS along with NSS.
  10931. * Valid values for HT are 0 to 7.
  10932. * HT mcs 0 with NSS 2 is mcs 8.
  10933. * Valid values for VHT are 0 to 9.
  10934. */
  10935. mcs: 4, /* [5:2] */
  10936. /* rate:
  10937. * This is applicable only for
  10938. * CCK and OFDM preamble type
  10939. * rate 0: OFDM 48 Mbps,
  10940. * 1: OFDM 24 Mbps,
  10941. * 2: OFDM 12 Mbps
  10942. * 3: OFDM 6 Mbps
  10943. * 4: OFDM 54 Mbps
  10944. * 5: OFDM 36 Mbps
  10945. * 6: OFDM 18 Mbps
  10946. * 7: OFDM 9 Mbps
  10947. * rate 0: CCK 11 Mbps Long
  10948. * 1: CCK 5.5 Mbps Long
  10949. * 2: CCK 2 Mbps Long
  10950. * 3: CCK 1 Mbps Long
  10951. * 4: CCK 11 Mbps Short
  10952. * 5: CCK 5.5 Mbps Short
  10953. * 6: CCK 2 Mbps Short
  10954. */
  10955. rate : 3, /* [ 8: 6] */
  10956. rssi : 8, /* [16: 9] units=dBm */
  10957. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10958. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10959. stbc : 1, /* [22] */
  10960. sgi : 1, /* [23] */
  10961. ldpc : 1, /* [24] */
  10962. beamformed: 1, /* [25] */
  10963. /* tx_retry_cnt:
  10964. * Indicates retry count of data tx frames provided by the host.
  10965. */
  10966. tx_retry_cnt: 6; /* [31:26] */
  10967. A_UINT32 /* word 2 */
  10968. framectrl:16, /* [15: 0] */
  10969. seqno:16; /* [31:16] */
  10970. } POSTPACK;
  10971. #define HTT_TX_COMPL_IND_STATUS_S 8
  10972. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10973. #define HTT_TX_COMPL_IND_TID_S 11
  10974. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10975. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10976. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10977. #define HTT_TX_COMPL_IND_NUM_S 16
  10978. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10979. #define HTT_TX_COMPL_IND_APPEND_S 24
  10980. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10981. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10982. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10983. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10984. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10985. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10986. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10987. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10988. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10989. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10990. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10991. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10992. do { \
  10993. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10994. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10995. } while (0)
  10996. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10997. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10998. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10999. do { \
  11000. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11001. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11002. } while (0)
  11003. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11004. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11005. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11006. do { \
  11007. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11008. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11009. } while (0)
  11010. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11011. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11012. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11013. do { \
  11014. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11015. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11016. } while (0)
  11017. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11018. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11019. HTT_TX_COMPL_IND_TID_INV_S)
  11020. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11021. do { \
  11022. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11023. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11024. } while (0)
  11025. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11026. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11027. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11028. do { \
  11029. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11030. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11031. } while (0)
  11032. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11033. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11034. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11035. do { \
  11036. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11037. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11038. } while (0)
  11039. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11040. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11041. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11042. do { \
  11043. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11044. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11045. } while (0)
  11046. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11047. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11048. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11049. do { \
  11050. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11051. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11052. } while (0)
  11053. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11054. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11055. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11056. do { \
  11057. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11058. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11059. } while (0)
  11060. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11061. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11062. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11063. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11064. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11065. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11066. #define HTT_TX_COMPL_IND_STAT_OK 0
  11067. /* DISCARD:
  11068. * current meaning:
  11069. * MSDUs were queued for transmission but filtered by HW or SW
  11070. * without any over the air attempts
  11071. * legacy meaning (HL Rome):
  11072. * MSDUs were discarded by the target FW without any over the air
  11073. * attempts due to lack of space
  11074. */
  11075. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11076. /* NO_ACK:
  11077. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11078. */
  11079. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11080. /* POSTPONE:
  11081. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11082. * be downloaded again later (in the appropriate order), when they are
  11083. * deliverable.
  11084. */
  11085. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11086. /*
  11087. * The PEER_DEL tx completion status is used for HL cases
  11088. * where the peer the frame is for has been deleted.
  11089. * The host has already discarded its copy of the frame, but
  11090. * it still needs the tx completion to restore its credit.
  11091. */
  11092. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11093. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11094. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11095. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11096. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11097. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11098. PREPACK struct htt_tx_compl_ind_base {
  11099. A_UINT32 hdr;
  11100. A_UINT16 payload[1/*or more*/];
  11101. } POSTPACK;
  11102. PREPACK struct htt_tx_compl_ind_append_retries {
  11103. A_UINT16 msdu_id;
  11104. A_UINT8 tx_retries;
  11105. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11106. 0: this is the last append_retries struct */
  11107. } POSTPACK;
  11108. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11109. A_UINT32 timestamp[1/*or more*/];
  11110. } POSTPACK;
  11111. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11112. A_UINT32 tx_tsf64_low;
  11113. A_UINT32 tx_tsf64_high;
  11114. } POSTPACK;
  11115. /* htt_tx_data_hdr_information payload extension fields: */
  11116. /* DWORD zero */
  11117. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11118. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11119. /* DWORD one */
  11120. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11121. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11122. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11123. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11124. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11125. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11126. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11127. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11128. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11129. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11130. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11131. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11132. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11133. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11134. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11135. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11136. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11137. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11138. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11139. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11140. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11141. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11142. /* DWORD two */
  11143. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11144. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11145. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11146. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11147. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11148. do { \
  11149. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11150. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11151. } while (0)
  11152. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11153. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11154. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11155. do { \
  11156. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11157. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11158. } while (0)
  11159. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11160. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11161. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11162. do { \
  11163. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11164. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11165. } while (0)
  11166. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11167. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11168. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11169. do { \
  11170. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11171. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11172. } while (0)
  11173. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11174. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11175. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11176. do { \
  11177. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11178. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11179. } while (0)
  11180. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11181. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11182. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11183. do { \
  11184. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11185. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11186. } while (0)
  11187. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11188. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11189. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11190. do { \
  11191. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11192. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11193. } while (0)
  11194. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11195. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11196. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11197. do { \
  11198. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11199. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11200. } while (0)
  11201. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11202. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11203. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11204. do { \
  11205. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11206. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11207. } while (0)
  11208. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11209. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11210. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11211. do { \
  11212. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11213. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11214. } while (0)
  11215. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11216. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11217. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11218. do { \
  11219. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11220. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11221. } while (0)
  11222. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11223. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11224. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11225. do { \
  11226. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11227. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11228. } while (0)
  11229. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11230. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11231. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11232. do { \
  11233. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11234. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11235. } while (0)
  11236. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11237. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11238. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11239. do { \
  11240. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11241. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11242. } while (0)
  11243. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11244. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11245. /**
  11246. * @brief target -> host rate-control update indication message
  11247. *
  11248. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11249. *
  11250. * @details
  11251. * The following diagram shows the format of the RC Update message
  11252. * sent from the target to the host, while processing the tx-completion
  11253. * of a transmitted PPDU.
  11254. *
  11255. * |31 24|23 16|15 8|7 0|
  11256. * |-------------------------------------------------------------|
  11257. * | peer ID | vdev ID | msg_type |
  11258. * |-------------------------------------------------------------|
  11259. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11260. * |-------------------------------------------------------------|
  11261. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11262. * |-------------------------------------------------------------|
  11263. * | : |
  11264. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11265. * | : |
  11266. * |-------------------------------------------------------------|
  11267. * | : |
  11268. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11269. * | : |
  11270. * |-------------------------------------------------------------|
  11271. * : :
  11272. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11273. *
  11274. */
  11275. typedef struct {
  11276. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11277. A_UINT32 rate_code_flags;
  11278. A_UINT32 flags; /* Encodes information such as excessive
  11279. retransmission, aggregate, some info
  11280. from .11 frame control,
  11281. STBC, LDPC, (SGI and Tx Chain Mask
  11282. are encoded in ptx_rc->flags field),
  11283. AMPDU truncation (BT/time based etc.),
  11284. RTS/CTS attempt */
  11285. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11286. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11287. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11288. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11289. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11290. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11291. } HTT_RC_TX_DONE_PARAMS;
  11292. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11293. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11294. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11295. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11296. #define HTT_RC_UPDATE_VDEVID_S 8
  11297. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11298. #define HTT_RC_UPDATE_PEERID_S 16
  11299. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11300. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11301. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11302. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11303. do { \
  11304. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11305. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11306. } while (0)
  11307. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11308. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11309. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11310. do { \
  11311. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11312. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11313. } while (0)
  11314. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11315. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11316. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11317. do { \
  11318. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11319. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11320. } while (0)
  11321. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11322. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11323. /**
  11324. * @brief target -> host rx fragment indication message definition
  11325. *
  11326. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11327. *
  11328. * @details
  11329. * The following field definitions describe the format of the rx fragment
  11330. * indication message sent from the target to the host.
  11331. * The rx fragment indication message shares the format of the
  11332. * rx indication message, but not all fields from the rx indication message
  11333. * are relevant to the rx fragment indication message.
  11334. *
  11335. *
  11336. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11337. * |-----------+-------------------+---------------------+-------------|
  11338. * | peer ID | |FV| ext TID | msg type |
  11339. * |-------------------------------------------------------------------|
  11340. * | | flush | flush |
  11341. * | | end | start |
  11342. * | | seq num | seq num |
  11343. * |-------------------------------------------------------------------|
  11344. * | reserved | FW rx desc bytes |
  11345. * |-------------------------------------------------------------------|
  11346. * | | FW MSDU Rx |
  11347. * | | desc B0 |
  11348. * |-------------------------------------------------------------------|
  11349. * Header fields:
  11350. * - MSG_TYPE
  11351. * Bits 7:0
  11352. * Purpose: identifies this as an rx fragment indication message
  11353. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11354. * - EXT_TID
  11355. * Bits 12:8
  11356. * Purpose: identify the traffic ID of the rx data, including
  11357. * special "extended" TID values for multicast, broadcast, and
  11358. * non-QoS data frames
  11359. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11360. * - FLUSH_VALID (FV)
  11361. * Bit 13
  11362. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11363. * is valid
  11364. * Value:
  11365. * 1 -> flush IE is valid and needs to be processed
  11366. * 0 -> flush IE is not valid and should be ignored
  11367. * - PEER_ID
  11368. * Bits 31:16
  11369. * Purpose: Identify, by ID, which peer sent the rx data
  11370. * Value: ID of the peer who sent the rx data
  11371. * - FLUSH_SEQ_NUM_START
  11372. * Bits 5:0
  11373. * Purpose: Indicate the start of a series of MPDUs to flush
  11374. * Not all MPDUs within this series are necessarily valid - the host
  11375. * must check each sequence number within this range to see if the
  11376. * corresponding MPDU is actually present.
  11377. * This field is only valid if the FV bit is set.
  11378. * Value:
  11379. * The sequence number for the first MPDUs to check to flush.
  11380. * The sequence number is masked by 0x3f.
  11381. * - FLUSH_SEQ_NUM_END
  11382. * Bits 11:6
  11383. * Purpose: Indicate the end of a series of MPDUs to flush
  11384. * Value:
  11385. * The sequence number one larger than the sequence number of the
  11386. * last MPDU to check to flush.
  11387. * The sequence number is masked by 0x3f.
  11388. * Not all MPDUs within this series are necessarily valid - the host
  11389. * must check each sequence number within this range to see if the
  11390. * corresponding MPDU is actually present.
  11391. * This field is only valid if the FV bit is set.
  11392. * Rx descriptor fields:
  11393. * - FW_RX_DESC_BYTES
  11394. * Bits 15:0
  11395. * Purpose: Indicate how many bytes in the Rx indication are used for
  11396. * FW Rx descriptors
  11397. * Value: 1
  11398. */
  11399. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11400. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11401. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11402. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11403. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11404. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11405. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11406. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11407. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11408. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11409. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11410. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11411. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11412. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11413. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11414. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11415. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11416. #define HTT_RX_FRAG_IND_BYTES \
  11417. (4 /* msg hdr */ + \
  11418. 4 /* flush spec */ + \
  11419. 4 /* (unused) FW rx desc bytes spec */ + \
  11420. 4 /* FW rx desc */)
  11421. /**
  11422. * @brief target -> host test message definition
  11423. *
  11424. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11425. *
  11426. * @details
  11427. * The following field definitions describe the format of the test
  11428. * message sent from the target to the host.
  11429. * The message consists of a 4-octet header, followed by a variable
  11430. * number of 32-bit integer values, followed by a variable number
  11431. * of 8-bit character values.
  11432. *
  11433. * |31 16|15 8|7 0|
  11434. * |-----------------------------------------------------------|
  11435. * | num chars | num ints | msg type |
  11436. * |-----------------------------------------------------------|
  11437. * | int 0 |
  11438. * |-----------------------------------------------------------|
  11439. * | int 1 |
  11440. * |-----------------------------------------------------------|
  11441. * | ... |
  11442. * |-----------------------------------------------------------|
  11443. * | char 3 | char 2 | char 1 | char 0 |
  11444. * |-----------------------------------------------------------|
  11445. * | | | ... | char 4 |
  11446. * |-----------------------------------------------------------|
  11447. * - MSG_TYPE
  11448. * Bits 7:0
  11449. * Purpose: identifies this as a test message
  11450. * Value: HTT_MSG_TYPE_TEST
  11451. * - NUM_INTS
  11452. * Bits 15:8
  11453. * Purpose: indicate how many 32-bit integers follow the message header
  11454. * - NUM_CHARS
  11455. * Bits 31:16
  11456. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11457. */
  11458. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11459. #define HTT_RX_TEST_NUM_INTS_S 8
  11460. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11461. #define HTT_RX_TEST_NUM_CHARS_S 16
  11462. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11463. do { \
  11464. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11465. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11466. } while (0)
  11467. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11468. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11469. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11470. do { \
  11471. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11472. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11473. } while (0)
  11474. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11475. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11476. /**
  11477. * @brief target -> host packet log message
  11478. *
  11479. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11480. *
  11481. * @details
  11482. * The following field definitions describe the format of the packet log
  11483. * message sent from the target to the host.
  11484. * The message consists of a 4-octet header,followed by a variable number
  11485. * of 32-bit character values.
  11486. *
  11487. * |31 16|15 12|11 10|9 8|7 0|
  11488. * |------------------------------------------------------------------|
  11489. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11490. * |------------------------------------------------------------------|
  11491. * | payload |
  11492. * |------------------------------------------------------------------|
  11493. * - MSG_TYPE
  11494. * Bits 7:0
  11495. * Purpose: identifies this as a pktlog message
  11496. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11497. * - mac_id
  11498. * Bits 9:8
  11499. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11500. * Value: 0-3
  11501. * - pdev_id
  11502. * Bits 11:10
  11503. * Purpose: pdev_id
  11504. * Value: 0-3
  11505. * 0 (for rings at SOC level),
  11506. * 1/2/3 PDEV -> 0/1/2
  11507. * - payload_size
  11508. * Bits 31:16
  11509. * Purpose: explicitly specify the payload size
  11510. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11511. */
  11512. PREPACK struct htt_pktlog_msg {
  11513. A_UINT32 header;
  11514. A_UINT32 payload[1/* or more */];
  11515. } POSTPACK;
  11516. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11517. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11518. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11519. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11520. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11521. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11522. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11523. do { \
  11524. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11525. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11526. } while (0)
  11527. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11528. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11529. HTT_T2H_PKTLOG_MAC_ID_S)
  11530. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11531. do { \
  11532. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11533. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11534. } while (0)
  11535. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11536. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11537. HTT_T2H_PKTLOG_PDEV_ID_S)
  11538. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11539. do { \
  11540. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11541. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11542. } while (0)
  11543. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11544. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11545. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11546. /*
  11547. * Rx reorder statistics
  11548. * NB: all the fields must be defined in 4 octets size.
  11549. */
  11550. struct rx_reorder_stats {
  11551. /* Non QoS MPDUs received */
  11552. A_UINT32 deliver_non_qos;
  11553. /* MPDUs received in-order */
  11554. A_UINT32 deliver_in_order;
  11555. /* Flush due to reorder timer expired */
  11556. A_UINT32 deliver_flush_timeout;
  11557. /* Flush due to move out of window */
  11558. A_UINT32 deliver_flush_oow;
  11559. /* Flush due to DELBA */
  11560. A_UINT32 deliver_flush_delba;
  11561. /* MPDUs dropped due to FCS error */
  11562. A_UINT32 fcs_error;
  11563. /* MPDUs dropped due to monitor mode non-data packet */
  11564. A_UINT32 mgmt_ctrl;
  11565. /* Unicast-data MPDUs dropped due to invalid peer */
  11566. A_UINT32 invalid_peer;
  11567. /* MPDUs dropped due to duplication (non aggregation) */
  11568. A_UINT32 dup_non_aggr;
  11569. /* MPDUs dropped due to processed before */
  11570. A_UINT32 dup_past;
  11571. /* MPDUs dropped due to duplicate in reorder queue */
  11572. A_UINT32 dup_in_reorder;
  11573. /* Reorder timeout happened */
  11574. A_UINT32 reorder_timeout;
  11575. /* invalid bar ssn */
  11576. A_UINT32 invalid_bar_ssn;
  11577. /* reorder reset due to bar ssn */
  11578. A_UINT32 ssn_reset;
  11579. /* Flush due to delete peer */
  11580. A_UINT32 deliver_flush_delpeer;
  11581. /* Flush due to offload*/
  11582. A_UINT32 deliver_flush_offload;
  11583. /* Flush due to out of buffer*/
  11584. A_UINT32 deliver_flush_oob;
  11585. /* MPDUs dropped due to PN check fail */
  11586. A_UINT32 pn_fail;
  11587. /* MPDUs dropped due to unable to allocate memory */
  11588. A_UINT32 store_fail;
  11589. /* Number of times the tid pool alloc succeeded */
  11590. A_UINT32 tid_pool_alloc_succ;
  11591. /* Number of times the MPDU pool alloc succeeded */
  11592. A_UINT32 mpdu_pool_alloc_succ;
  11593. /* Number of times the MSDU pool alloc succeeded */
  11594. A_UINT32 msdu_pool_alloc_succ;
  11595. /* Number of times the tid pool alloc failed */
  11596. A_UINT32 tid_pool_alloc_fail;
  11597. /* Number of times the MPDU pool alloc failed */
  11598. A_UINT32 mpdu_pool_alloc_fail;
  11599. /* Number of times the MSDU pool alloc failed */
  11600. A_UINT32 msdu_pool_alloc_fail;
  11601. /* Number of times the tid pool freed */
  11602. A_UINT32 tid_pool_free;
  11603. /* Number of times the MPDU pool freed */
  11604. A_UINT32 mpdu_pool_free;
  11605. /* Number of times the MSDU pool freed */
  11606. A_UINT32 msdu_pool_free;
  11607. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11608. A_UINT32 msdu_queued;
  11609. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11610. A_UINT32 msdu_recycled;
  11611. /* Number of MPDUs with invalid peer but A2 found in AST */
  11612. A_UINT32 invalid_peer_a2_in_ast;
  11613. /* Number of MPDUs with invalid peer but A3 found in AST */
  11614. A_UINT32 invalid_peer_a3_in_ast;
  11615. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11616. A_UINT32 invalid_peer_bmc_mpdus;
  11617. /* Number of MSDUs with err attention word */
  11618. A_UINT32 rxdesc_err_att;
  11619. /* Number of MSDUs with flag of peer_idx_invalid */
  11620. A_UINT32 rxdesc_err_peer_idx_inv;
  11621. /* Number of MSDUs with flag of peer_idx_timeout */
  11622. A_UINT32 rxdesc_err_peer_idx_to;
  11623. /* Number of MSDUs with flag of overflow */
  11624. A_UINT32 rxdesc_err_ov;
  11625. /* Number of MSDUs with flag of msdu_length_err */
  11626. A_UINT32 rxdesc_err_msdu_len;
  11627. /* Number of MSDUs with flag of mpdu_length_err */
  11628. A_UINT32 rxdesc_err_mpdu_len;
  11629. /* Number of MSDUs with flag of tkip_mic_err */
  11630. A_UINT32 rxdesc_err_tkip_mic;
  11631. /* Number of MSDUs with flag of decrypt_err */
  11632. A_UINT32 rxdesc_err_decrypt;
  11633. /* Number of MSDUs with flag of fcs_err */
  11634. A_UINT32 rxdesc_err_fcs;
  11635. /* Number of Unicast (bc_mc bit is not set in attention word)
  11636. * frames with invalid peer handler
  11637. */
  11638. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11639. /* Number of unicast frame directly (direct bit is set in attention word)
  11640. * to DUT with invalid peer handler
  11641. */
  11642. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11643. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11644. * frames with invalid peer handler
  11645. */
  11646. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11647. /* Number of MSDUs dropped due to no first MSDU flag */
  11648. A_UINT32 rxdesc_no_1st_msdu;
  11649. /* Number of MSDUs droped due to ring overflow */
  11650. A_UINT32 msdu_drop_ring_ov;
  11651. /* Number of MSDUs dropped due to FC mismatch */
  11652. A_UINT32 msdu_drop_fc_mismatch;
  11653. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11654. A_UINT32 msdu_drop_mgmt_remote_ring;
  11655. /* Number of MSDUs dropped due to errors not reported in attention word */
  11656. A_UINT32 msdu_drop_misc;
  11657. /* Number of MSDUs go to offload before reorder */
  11658. A_UINT32 offload_msdu_wal;
  11659. /* Number of data frame dropped by offload after reorder */
  11660. A_UINT32 offload_msdu_reorder;
  11661. /* Number of MPDUs with sequence number in the past and within the BA window */
  11662. A_UINT32 dup_past_within_window;
  11663. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11664. A_UINT32 dup_past_outside_window;
  11665. /* Number of MSDUs with decrypt/MIC error */
  11666. A_UINT32 rxdesc_err_decrypt_mic;
  11667. /* Number of data MSDUs received on both local and remote rings */
  11668. A_UINT32 data_msdus_on_both_rings;
  11669. /* MPDUs never filled */
  11670. A_UINT32 holes_not_filled;
  11671. };
  11672. /*
  11673. * Rx Remote buffer statistics
  11674. * NB: all the fields must be defined in 4 octets size.
  11675. */
  11676. struct rx_remote_buffer_mgmt_stats {
  11677. /* Total number of MSDUs reaped for Rx processing */
  11678. A_UINT32 remote_reaped;
  11679. /* MSDUs recycled within firmware */
  11680. A_UINT32 remote_recycled;
  11681. /* MSDUs stored by Data Rx */
  11682. A_UINT32 data_rx_msdus_stored;
  11683. /* Number of HTT indications from WAL Rx MSDU */
  11684. A_UINT32 wal_rx_ind;
  11685. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11686. A_UINT32 wal_rx_ind_unconsumed;
  11687. /* Number of HTT indications from Data Rx MSDU */
  11688. A_UINT32 data_rx_ind;
  11689. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11690. A_UINT32 data_rx_ind_unconsumed;
  11691. /* Number of HTT indications from ATHBUF */
  11692. A_UINT32 athbuf_rx_ind;
  11693. /* Number of remote buffers requested for refill */
  11694. A_UINT32 refill_buf_req;
  11695. /* Number of remote buffers filled by the host */
  11696. A_UINT32 refill_buf_rsp;
  11697. /* Number of times MAC hw_index = f/w write_index */
  11698. A_INT32 mac_no_bufs;
  11699. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11700. A_INT32 fw_indices_equal;
  11701. /* Number of times f/w finds no buffers to post */
  11702. A_INT32 host_no_bufs;
  11703. };
  11704. /*
  11705. * TXBF MU/SU packets and NDPA statistics
  11706. * NB: all the fields must be defined in 4 octets size.
  11707. */
  11708. struct rx_txbf_musu_ndpa_pkts_stats {
  11709. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11710. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11711. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11712. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11713. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11714. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11715. };
  11716. /*
  11717. * htt_dbg_stats_status -
  11718. * present - The requested stats have been delivered in full.
  11719. * This indicates that either the stats information was contained
  11720. * in its entirety within this message, or else this message
  11721. * completes the delivery of the requested stats info that was
  11722. * partially delivered through earlier STATS_CONF messages.
  11723. * partial - The requested stats have been delivered in part.
  11724. * One or more subsequent STATS_CONF messages with the same
  11725. * cookie value will be sent to deliver the remainder of the
  11726. * information.
  11727. * error - The requested stats could not be delivered, for example due
  11728. * to a shortage of memory to construct a message holding the
  11729. * requested stats.
  11730. * invalid - The requested stat type is either not recognized, or the
  11731. * target is configured to not gather the stats type in question.
  11732. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11733. * series_done - This special value indicates that no further stats info
  11734. * elements are present within a series of stats info elems
  11735. * (within a stats upload confirmation message).
  11736. */
  11737. enum htt_dbg_stats_status {
  11738. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11739. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11740. HTT_DBG_STATS_STATUS_ERROR = 2,
  11741. HTT_DBG_STATS_STATUS_INVALID = 3,
  11742. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11743. };
  11744. /**
  11745. * @brief target -> host statistics upload
  11746. *
  11747. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11748. *
  11749. * @details
  11750. * The following field definitions describe the format of the HTT target
  11751. * to host stats upload confirmation message.
  11752. * The message contains a cookie echoed from the HTT host->target stats
  11753. * upload request, which identifies which request the confirmation is
  11754. * for, and a series of tag-length-value stats information elements.
  11755. * The tag-length header for each stats info element also includes a
  11756. * status field, to indicate whether the request for the stat type in
  11757. * question was fully met, partially met, unable to be met, or invalid
  11758. * (if the stat type in question is disabled in the target).
  11759. * A special value of all 1's in this status field is used to indicate
  11760. * the end of the series of stats info elements.
  11761. *
  11762. *
  11763. * |31 16|15 8|7 5|4 0|
  11764. * |------------------------------------------------------------|
  11765. * | reserved | msg type |
  11766. * |------------------------------------------------------------|
  11767. * | cookie LSBs |
  11768. * |------------------------------------------------------------|
  11769. * | cookie MSBs |
  11770. * |------------------------------------------------------------|
  11771. * | stats entry length | reserved | S |stat type|
  11772. * |------------------------------------------------------------|
  11773. * | |
  11774. * | type-specific stats info |
  11775. * | |
  11776. * |------------------------------------------------------------|
  11777. * | stats entry length | reserved | S |stat type|
  11778. * |------------------------------------------------------------|
  11779. * | |
  11780. * | type-specific stats info |
  11781. * | |
  11782. * |------------------------------------------------------------|
  11783. * | n/a | reserved | 111 | n/a |
  11784. * |------------------------------------------------------------|
  11785. * Header fields:
  11786. * - MSG_TYPE
  11787. * Bits 7:0
  11788. * Purpose: identifies this is a statistics upload confirmation message
  11789. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11790. * - COOKIE_LSBS
  11791. * Bits 31:0
  11792. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11793. * message with its preceding host->target stats request message.
  11794. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11795. * - COOKIE_MSBS
  11796. * Bits 31:0
  11797. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11798. * message with its preceding host->target stats request message.
  11799. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11800. *
  11801. * Stats Information Element tag-length header fields:
  11802. * - STAT_TYPE
  11803. * Bits 4:0
  11804. * Purpose: identifies the type of statistics info held in the
  11805. * following information element
  11806. * Value: htt_dbg_stats_type
  11807. * - STATUS
  11808. * Bits 7:5
  11809. * Purpose: indicate whether the requested stats are present
  11810. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11811. * the completion of the stats entry series
  11812. * - LENGTH
  11813. * Bits 31:16
  11814. * Purpose: indicate the stats information size
  11815. * Value: This field specifies the number of bytes of stats information
  11816. * that follows the element tag-length header.
  11817. * It is expected but not required that this length is a multiple of
  11818. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11819. * subsequent stats entry header will begin on a 4-byte aligned
  11820. * boundary.
  11821. */
  11822. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11823. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11824. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11825. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11826. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11827. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11828. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11829. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11830. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11831. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11832. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11833. do { \
  11834. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11835. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11836. } while (0)
  11837. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11838. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11839. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11840. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11841. do { \
  11842. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11843. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11844. } while (0)
  11845. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11846. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11847. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11848. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11851. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11852. } while (0)
  11853. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11854. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11855. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11856. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11857. #define HTT_MAX_AGGR 64
  11858. #define HTT_HL_MAX_AGGR 18
  11859. /**
  11860. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11861. *
  11862. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11863. *
  11864. * @details
  11865. * The following field definitions describe the format of the HTT host
  11866. * to target frag_desc/msdu_ext bank configuration message.
  11867. * The message contains the based address and the min and max id of the
  11868. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11869. * MSDU_EXT/FRAG_DESC.
  11870. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11871. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11872. * the hardware does the mapping/translation.
  11873. *
  11874. * Total banks that can be configured is configured to 16.
  11875. *
  11876. * This should be called before any TX has be initiated by the HTT
  11877. *
  11878. * |31 16|15 8|7 5|4 0|
  11879. * |------------------------------------------------------------|
  11880. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11881. * |------------------------------------------------------------|
  11882. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11883. #if HTT_PADDR64
  11884. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11885. #endif
  11886. * |------------------------------------------------------------|
  11887. * | ... |
  11888. * |------------------------------------------------------------|
  11889. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11890. #if HTT_PADDR64
  11891. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11892. #endif
  11893. * |------------------------------------------------------------|
  11894. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11895. * |------------------------------------------------------------|
  11896. * | ... |
  11897. * |------------------------------------------------------------|
  11898. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11899. * |------------------------------------------------------------|
  11900. * Header fields:
  11901. * - MSG_TYPE
  11902. * Bits 7:0
  11903. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11904. * for systems with 64-bit format for bus addresses:
  11905. * - BANKx_BASE_ADDRESS_LO
  11906. * Bits 31:0
  11907. * Purpose: Provide a mechanism to specify the base address of the
  11908. * MSDU_EXT bank physical/bus address.
  11909. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11910. * - BANKx_BASE_ADDRESS_HI
  11911. * Bits 31:0
  11912. * Purpose: Provide a mechanism to specify the base address of the
  11913. * MSDU_EXT bank physical/bus address.
  11914. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11915. * for systems with 32-bit format for bus addresses:
  11916. * - BANKx_BASE_ADDRESS
  11917. * Bits 31:0
  11918. * Purpose: Provide a mechanism to specify the base address of the
  11919. * MSDU_EXT bank physical/bus address.
  11920. * Value: MSDU_EXT bank physical / bus address
  11921. * - BANKx_MIN_ID
  11922. * Bits 15:0
  11923. * Purpose: Provide a mechanism to specify the min index that needs to
  11924. * mapped.
  11925. * - BANKx_MAX_ID
  11926. * Bits 31:16
  11927. * Purpose: Provide a mechanism to specify the max index that needs to
  11928. * mapped.
  11929. *
  11930. */
  11931. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11932. * safe value.
  11933. * @note MAX supported banks is 16.
  11934. */
  11935. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11936. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11937. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11938. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11939. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11940. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11941. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11942. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11943. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11944. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11945. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11946. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11947. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11948. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11949. do { \
  11950. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11951. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11952. } while (0)
  11953. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11954. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11955. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11956. do { \
  11957. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11958. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11959. } while (0)
  11960. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11961. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11962. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11963. do { \
  11964. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11965. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11966. } while (0)
  11967. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11968. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11969. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11970. do { \
  11971. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11972. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11973. } while (0)
  11974. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11975. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11976. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11977. do { \
  11978. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11979. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11980. } while (0)
  11981. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11982. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11983. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11984. do { \
  11985. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11986. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11987. } while (0)
  11988. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11989. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11990. /*
  11991. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11992. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11993. * addresses are stored in a XXX-bit field.
  11994. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11995. * htt_tx_frag_desc64_bank_cfg_t structs.
  11996. */
  11997. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11998. _paddr_bits_, \
  11999. _paddr__bank_base_address_) \
  12000. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12001. /** word 0 \
  12002. * msg_type: 8, \
  12003. * pdev_id: 2, \
  12004. * swap: 1, \
  12005. * reserved0: 5, \
  12006. * num_banks: 8, \
  12007. * desc_size: 8; \
  12008. */ \
  12009. A_UINT32 word0; \
  12010. /* \
  12011. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12012. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12013. * the second A_UINT32). \
  12014. */ \
  12015. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12016. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12017. } POSTPACK
  12018. /* define htt_tx_frag_desc32_bank_cfg_t */
  12019. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12020. /* define htt_tx_frag_desc64_bank_cfg_t */
  12021. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12022. /*
  12023. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12024. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12025. */
  12026. #if HTT_PADDR64
  12027. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12028. #else
  12029. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12030. #endif
  12031. /**
  12032. * @brief target -> host HTT TX Credit total count update message definition
  12033. *
  12034. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12035. *
  12036. *|31 16|15|14 9| 8 |7 0 |
  12037. *|---------------------+--+----------+-------+----------|
  12038. *|cur htt credit delta | Q| reserved | sign | msg type |
  12039. *|------------------------------------------------------|
  12040. *
  12041. * Header fields:
  12042. * - MSG_TYPE
  12043. * Bits 7:0
  12044. * Purpose: identifies this as a htt tx credit delta update message
  12045. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12046. * - SIGN
  12047. * Bits 8
  12048. * identifies whether credit delta is positive or negative
  12049. * Value:
  12050. * - 0x0: credit delta is positive, rebalance in some buffers
  12051. * - 0x1: credit delta is negative, rebalance out some buffers
  12052. * - reserved
  12053. * Bits 14:9
  12054. * Value: 0x0
  12055. * - TXQ_GRP
  12056. * Bit 15
  12057. * Purpose: indicates whether any tx queue group information elements
  12058. * are appended to the tx credit update message
  12059. * Value: 0 -> no tx queue group information element is present
  12060. * 1 -> a tx queue group information element immediately follows
  12061. * - DELTA_COUNT
  12062. * Bits 31:16
  12063. * Purpose: Specify current htt credit delta absolute count
  12064. */
  12065. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12066. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12067. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12068. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12069. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12070. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12071. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12074. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12075. } while (0)
  12076. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12077. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12078. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12079. do { \
  12080. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12081. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12082. } while (0)
  12083. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12084. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12085. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12086. do { \
  12087. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12088. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12089. } while (0)
  12090. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12091. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12092. #define HTT_TX_CREDIT_MSG_BYTES 4
  12093. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12094. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12095. /**
  12096. * @brief HTT WDI_IPA Operation Response Message
  12097. *
  12098. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12099. *
  12100. * @details
  12101. * HTT WDI_IPA Operation Response message is sent by target
  12102. * to host confirming suspend or resume operation.
  12103. * |31 24|23 16|15 8|7 0|
  12104. * |----------------+----------------+----------------+----------------|
  12105. * | op_code | Rsvd | msg_type |
  12106. * |-------------------------------------------------------------------|
  12107. * | Rsvd | Response len |
  12108. * |-------------------------------------------------------------------|
  12109. * | |
  12110. * | Response-type specific info |
  12111. * | |
  12112. * | |
  12113. * |-------------------------------------------------------------------|
  12114. * Header fields:
  12115. * - MSG_TYPE
  12116. * Bits 7:0
  12117. * Purpose: Identifies this as WDI_IPA Operation Response message
  12118. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12119. * - OP_CODE
  12120. * Bits 31:16
  12121. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12122. * value: = enum htt_wdi_ipa_op_code
  12123. * - RSP_LEN
  12124. * Bits 16:0
  12125. * Purpose: length for the response-type specific info
  12126. * value: = length in bytes for response-type specific info
  12127. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12128. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12129. */
  12130. PREPACK struct htt_wdi_ipa_op_response_t
  12131. {
  12132. /* DWORD 0: flags and meta-data */
  12133. A_UINT32
  12134. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12135. reserved1: 8,
  12136. op_code: 16;
  12137. A_UINT32
  12138. rsp_len: 16,
  12139. reserved2: 16;
  12140. } POSTPACK;
  12141. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12142. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12143. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12144. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12145. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12146. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12147. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12148. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12149. do { \
  12150. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12151. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12152. } while (0)
  12153. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12154. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12155. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12156. do { \
  12157. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12158. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12159. } while (0)
  12160. enum htt_phy_mode {
  12161. htt_phy_mode_11a = 0,
  12162. htt_phy_mode_11g = 1,
  12163. htt_phy_mode_11b = 2,
  12164. htt_phy_mode_11g_only = 3,
  12165. htt_phy_mode_11na_ht20 = 4,
  12166. htt_phy_mode_11ng_ht20 = 5,
  12167. htt_phy_mode_11na_ht40 = 6,
  12168. htt_phy_mode_11ng_ht40 = 7,
  12169. htt_phy_mode_11ac_vht20 = 8,
  12170. htt_phy_mode_11ac_vht40 = 9,
  12171. htt_phy_mode_11ac_vht80 = 10,
  12172. htt_phy_mode_11ac_vht20_2g = 11,
  12173. htt_phy_mode_11ac_vht40_2g = 12,
  12174. htt_phy_mode_11ac_vht80_2g = 13,
  12175. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12176. htt_phy_mode_11ac_vht160 = 15,
  12177. htt_phy_mode_max,
  12178. };
  12179. /**
  12180. * @brief target -> host HTT channel change indication
  12181. *
  12182. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12183. *
  12184. * @details
  12185. * Specify when a channel change occurs.
  12186. * This allows the host to precisely determine which rx frames arrived
  12187. * on the old channel and which rx frames arrived on the new channel.
  12188. *
  12189. *|31 |7 0 |
  12190. *|-------------------------------------------+----------|
  12191. *| reserved | msg type |
  12192. *|------------------------------------------------------|
  12193. *| primary_chan_center_freq_mhz |
  12194. *|------------------------------------------------------|
  12195. *| contiguous_chan1_center_freq_mhz |
  12196. *|------------------------------------------------------|
  12197. *| contiguous_chan2_center_freq_mhz |
  12198. *|------------------------------------------------------|
  12199. *| phy_mode |
  12200. *|------------------------------------------------------|
  12201. *
  12202. * Header fields:
  12203. * - MSG_TYPE
  12204. * Bits 7:0
  12205. * Purpose: identifies this as a htt channel change indication message
  12206. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12207. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12208. * Bits 31:0
  12209. * Purpose: identify the (center of the) new 20 MHz primary channel
  12210. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12211. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12212. * Bits 31:0
  12213. * Purpose: identify the (center of the) contiguous frequency range
  12214. * comprising the new channel.
  12215. * For example, if the new channel is a 80 MHz channel extending
  12216. * 60 MHz beyond the primary channel, this field would be 30 larger
  12217. * than the primary channel center frequency field.
  12218. * Value: center frequency of the contiguous frequency range comprising
  12219. * the full channel in MHz units
  12220. * (80+80 channels also use the CONTIG_CHAN2 field)
  12221. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12222. * Bits 31:0
  12223. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12224. * within a VHT 80+80 channel.
  12225. * This field is only relevant for VHT 80+80 channels.
  12226. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12227. * channel (arbitrary value for cases besides VHT 80+80)
  12228. * - PHY_MODE
  12229. * Bits 31:0
  12230. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12231. * and band
  12232. * Value: htt_phy_mode enum value
  12233. */
  12234. PREPACK struct htt_chan_change_t
  12235. {
  12236. /* DWORD 0: flags and meta-data */
  12237. A_UINT32
  12238. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12239. reserved1: 24;
  12240. A_UINT32 primary_chan_center_freq_mhz;
  12241. A_UINT32 contig_chan1_center_freq_mhz;
  12242. A_UINT32 contig_chan2_center_freq_mhz;
  12243. A_UINT32 phy_mode;
  12244. } POSTPACK;
  12245. /*
  12246. * Due to historical / backwards-compatibility reasons, maintain the
  12247. * below htt_chan_change_msg struct definition, which needs to be
  12248. * consistent with the above htt_chan_change_t struct definition
  12249. * (aside from the htt_chan_change_t definition including the msg_type
  12250. * dword within the message, and the htt_chan_change_msg only containing
  12251. * the payload of the message that follows the msg_type dword).
  12252. */
  12253. PREPACK struct htt_chan_change_msg {
  12254. A_UINT32 chan_mhz; /* frequency in mhz */
  12255. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12256. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12257. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12258. } POSTPACK;
  12259. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12260. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12261. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12262. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12263. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12264. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12265. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12266. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12267. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12268. do { \
  12269. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12270. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12271. } while (0)
  12272. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12273. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12274. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12275. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12276. do { \
  12277. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12278. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12279. } while (0)
  12280. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12281. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12282. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12283. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12284. do { \
  12285. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12286. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12287. } while (0)
  12288. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12289. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12290. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12291. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12292. do { \
  12293. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12294. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12295. } while (0)
  12296. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12297. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12298. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12299. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12300. /**
  12301. * @brief rx offload packet error message
  12302. *
  12303. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12304. *
  12305. * @details
  12306. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12307. * of target payload like mic err.
  12308. *
  12309. * |31 24|23 16|15 8|7 0|
  12310. * |----------------+----------------+----------------+----------------|
  12311. * | tid | vdev_id | msg_sub_type | msg_type |
  12312. * |-------------------------------------------------------------------|
  12313. * : (sub-type dependent content) :
  12314. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12315. * Header fields:
  12316. * - msg_type
  12317. * Bits 7:0
  12318. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12319. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12320. * - msg_sub_type
  12321. * Bits 15:8
  12322. * Purpose: Identifies which type of rx error is reported by this message
  12323. * value: htt_rx_ofld_pkt_err_type
  12324. * - vdev_id
  12325. * Bits 23:16
  12326. * Purpose: Identifies which vdev received the erroneous rx frame
  12327. * value:
  12328. * - tid
  12329. * Bits 31:24
  12330. * Purpose: Identifies the traffic type of the rx frame
  12331. * value:
  12332. *
  12333. * - The payload fields used if the sub-type == MIC error are shown below.
  12334. * Note - MIC err is per MSDU, while PN is per MPDU.
  12335. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12336. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12337. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12338. * instead of sending separate HTT messages for each wrong MSDU within
  12339. * the MPDU.
  12340. *
  12341. * |31 24|23 16|15 8|7 0|
  12342. * |----------------+----------------+----------------+----------------|
  12343. * | Rsvd | key_id | peer_id |
  12344. * |-------------------------------------------------------------------|
  12345. * | receiver MAC addr 31:0 |
  12346. * |-------------------------------------------------------------------|
  12347. * | Rsvd | receiver MAC addr 47:32 |
  12348. * |-------------------------------------------------------------------|
  12349. * | transmitter MAC addr 31:0 |
  12350. * |-------------------------------------------------------------------|
  12351. * | Rsvd | transmitter MAC addr 47:32 |
  12352. * |-------------------------------------------------------------------|
  12353. * | PN 31:0 |
  12354. * |-------------------------------------------------------------------|
  12355. * | Rsvd | PN 47:32 |
  12356. * |-------------------------------------------------------------------|
  12357. * - peer_id
  12358. * Bits 15:0
  12359. * Purpose: identifies which peer is frame is from
  12360. * value:
  12361. * - key_id
  12362. * Bits 23:16
  12363. * Purpose: identifies key_id of rx frame
  12364. * value:
  12365. * - RA_31_0 (receiver MAC addr 31:0)
  12366. * Bits 31:0
  12367. * Purpose: identifies by MAC address which vdev received the frame
  12368. * value: MAC address lower 4 bytes
  12369. * - RA_47_32 (receiver MAC addr 47:32)
  12370. * Bits 15:0
  12371. * Purpose: identifies by MAC address which vdev received the frame
  12372. * value: MAC address upper 2 bytes
  12373. * - TA_31_0 (transmitter MAC addr 31:0)
  12374. * Bits 31:0
  12375. * Purpose: identifies by MAC address which peer transmitted the frame
  12376. * value: MAC address lower 4 bytes
  12377. * - TA_47_32 (transmitter MAC addr 47:32)
  12378. * Bits 15:0
  12379. * Purpose: identifies by MAC address which peer transmitted the frame
  12380. * value: MAC address upper 2 bytes
  12381. * - PN_31_0
  12382. * Bits 31:0
  12383. * Purpose: Identifies pn of rx frame
  12384. * value: PN lower 4 bytes
  12385. * - PN_47_32
  12386. * Bits 15:0
  12387. * Purpose: Identifies pn of rx frame
  12388. * value:
  12389. * TKIP or CCMP: PN upper 2 bytes
  12390. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12391. */
  12392. enum htt_rx_ofld_pkt_err_type {
  12393. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12394. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12395. };
  12396. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12397. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12398. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12399. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12400. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12401. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12402. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12403. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12404. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12405. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12406. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12407. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12408. do { \
  12409. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12410. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12411. } while (0)
  12412. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12413. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12414. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12415. do { \
  12416. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12417. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12418. } while (0)
  12419. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12420. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12421. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12422. do { \
  12423. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12424. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12425. } while (0)
  12426. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12442. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12443. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12444. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12445. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12446. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12447. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12448. do { \
  12449. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12450. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12451. } while (0)
  12452. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12453. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12454. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12455. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12456. do { \
  12457. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12458. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12459. } while (0)
  12460. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12461. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12462. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12463. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12464. do { \
  12465. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12466. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12467. } while (0)
  12468. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12469. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12470. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12471. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12472. do { \
  12473. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12474. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12475. } while (0)
  12476. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12477. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12478. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12479. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12480. do { \
  12481. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12482. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12483. } while (0)
  12484. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12485. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12486. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12487. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12488. do { \
  12489. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12490. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12491. } while (0)
  12492. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12493. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12494. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12495. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12496. do { \
  12497. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12498. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12499. } while (0)
  12500. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12501. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12502. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12504. do { \
  12505. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12506. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12507. } while (0)
  12508. /**
  12509. * @brief target -> host peer rate report message
  12510. *
  12511. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12512. *
  12513. * @details
  12514. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12515. * justified rate of all the peers.
  12516. *
  12517. * |31 24|23 16|15 8|7 0|
  12518. * |----------------+----------------+----------------+----------------|
  12519. * | peer_count | | msg_type |
  12520. * |-------------------------------------------------------------------|
  12521. * : Payload (variant number of peer rate report) :
  12522. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12523. * Header fields:
  12524. * - msg_type
  12525. * Bits 7:0
  12526. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12527. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12528. * - reserved
  12529. * Bits 15:8
  12530. * Purpose:
  12531. * value:
  12532. * - peer_count
  12533. * Bits 31:16
  12534. * Purpose: Specify how many peer rate report elements are present in the payload.
  12535. * value:
  12536. *
  12537. * Payload:
  12538. * There are variant number of peer rate report follow the first 32 bits.
  12539. * The peer rate report is defined as follows.
  12540. *
  12541. * |31 20|19 16|15 0|
  12542. * |-----------------------+---------+---------------------------------|-
  12543. * | reserved | phy | peer_id | \
  12544. * |-------------------------------------------------------------------| -> report #0
  12545. * | rate | /
  12546. * |-----------------------+---------+---------------------------------|-
  12547. * | reserved | phy | peer_id | \
  12548. * |-------------------------------------------------------------------| -> report #1
  12549. * | rate | /
  12550. * |-----------------------+---------+---------------------------------|-
  12551. * | reserved | phy | peer_id | \
  12552. * |-------------------------------------------------------------------| -> report #2
  12553. * | rate | /
  12554. * |-------------------------------------------------------------------|-
  12555. * : :
  12556. * : :
  12557. * : :
  12558. * :-------------------------------------------------------------------:
  12559. *
  12560. * - peer_id
  12561. * Bits 15:0
  12562. * Purpose: identify the peer
  12563. * value:
  12564. * - phy
  12565. * Bits 19:16
  12566. * Purpose: identify which phy is in use
  12567. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12568. * Please see enum htt_peer_report_phy_type for detail.
  12569. * - reserved
  12570. * Bits 31:20
  12571. * Purpose:
  12572. * value:
  12573. * - rate
  12574. * Bits 31:0
  12575. * Purpose: represent the justified rate of the peer specified by peer_id
  12576. * value:
  12577. */
  12578. enum htt_peer_rate_report_phy_type {
  12579. HTT_PEER_RATE_REPORT_11B = 0,
  12580. HTT_PEER_RATE_REPORT_11A_G,
  12581. HTT_PEER_RATE_REPORT_11N,
  12582. HTT_PEER_RATE_REPORT_11AC,
  12583. };
  12584. #define HTT_PEER_RATE_REPORT_SIZE 8
  12585. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12586. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12587. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12588. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12589. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12590. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12591. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12592. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12593. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12594. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12595. do { \
  12596. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12597. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12598. } while (0)
  12599. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12600. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12601. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12602. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12603. do { \
  12604. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12605. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12606. } while (0)
  12607. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12608. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12609. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12610. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12611. do { \
  12612. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12613. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12614. } while (0)
  12615. /**
  12616. * @brief target -> host flow pool map message
  12617. *
  12618. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12619. *
  12620. * @details
  12621. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12622. * a flow of descriptors.
  12623. *
  12624. * This message is in TLV format and indicates the parameters to be setup a
  12625. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12626. * receive descriptors from a specified pool.
  12627. *
  12628. * The message would appear as follows:
  12629. *
  12630. * |31 24|23 16|15 8|7 0|
  12631. * |----------------+----------------+----------------+----------------|
  12632. * header | reserved | num_flows | msg_type |
  12633. * |-------------------------------------------------------------------|
  12634. * | |
  12635. * : payload :
  12636. * | |
  12637. * |-------------------------------------------------------------------|
  12638. *
  12639. * The header field is one DWORD long and is interpreted as follows:
  12640. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12641. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12642. * this message
  12643. * b'16-31 - reserved: These bits are reserved for future use
  12644. *
  12645. * Payload:
  12646. * The payload would contain multiple objects of the following structure. Each
  12647. * object represents a flow.
  12648. *
  12649. * |31 24|23 16|15 8|7 0|
  12650. * |----------------+----------------+----------------+----------------|
  12651. * header | reserved | num_flows | msg_type |
  12652. * |-------------------------------------------------------------------|
  12653. * payload0| flow_type |
  12654. * |-------------------------------------------------------------------|
  12655. * | flow_id |
  12656. * |-------------------------------------------------------------------|
  12657. * | reserved0 | flow_pool_id |
  12658. * |-------------------------------------------------------------------|
  12659. * | reserved1 | flow_pool_size |
  12660. * |-------------------------------------------------------------------|
  12661. * | reserved2 |
  12662. * |-------------------------------------------------------------------|
  12663. * payload1| flow_type |
  12664. * |-------------------------------------------------------------------|
  12665. * | flow_id |
  12666. * |-------------------------------------------------------------------|
  12667. * | reserved0 | flow_pool_id |
  12668. * |-------------------------------------------------------------------|
  12669. * | reserved1 | flow_pool_size |
  12670. * |-------------------------------------------------------------------|
  12671. * | reserved2 |
  12672. * |-------------------------------------------------------------------|
  12673. * | . |
  12674. * | . |
  12675. * | . |
  12676. * |-------------------------------------------------------------------|
  12677. *
  12678. * Each payload is 5 DWORDS long and is interpreted as follows:
  12679. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12680. * this flow is associated. It can be VDEV, peer,
  12681. * or tid (AC). Based on enum htt_flow_type.
  12682. *
  12683. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12684. * object. For flow_type vdev it is set to the
  12685. * vdevid, for peer it is peerid and for tid, it is
  12686. * tid_num.
  12687. *
  12688. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12689. * in the host for this flow
  12690. * b'16:31 - reserved0: This field in reserved for the future. In case
  12691. * we have a hierarchical implementation (HCM) of
  12692. * pools, it can be used to indicate the ID of the
  12693. * parent-pool.
  12694. *
  12695. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12696. * Descriptors for this flow will be
  12697. * allocated from this pool in the host.
  12698. * b'16:31 - reserved1: This field in reserved for the future. In case
  12699. * we have a hierarchical implementation of pools,
  12700. * it can be used to indicate the max number of
  12701. * descriptors in the pool. The b'0:15 can be used
  12702. * to indicate min number of descriptors in the
  12703. * HCM scheme.
  12704. *
  12705. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12706. * we have a hierarchical implementation of pools,
  12707. * b'0:15 can be used to indicate the
  12708. * priority-based borrowing (PBB) threshold of
  12709. * the flow's pool. The b'16:31 are still left
  12710. * reserved.
  12711. */
  12712. enum htt_flow_type {
  12713. FLOW_TYPE_VDEV = 0,
  12714. /* Insert new flow types above this line */
  12715. };
  12716. PREPACK struct htt_flow_pool_map_payload_t {
  12717. A_UINT32 flow_type;
  12718. A_UINT32 flow_id;
  12719. A_UINT32 flow_pool_id:16,
  12720. reserved0:16;
  12721. A_UINT32 flow_pool_size:16,
  12722. reserved1:16;
  12723. A_UINT32 reserved2;
  12724. } POSTPACK;
  12725. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12726. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12727. (sizeof(struct htt_flow_pool_map_payload_t))
  12728. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12729. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12730. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12731. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12732. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12733. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12734. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12735. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12736. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12737. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12738. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12739. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12740. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12741. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12742. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12743. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12744. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12745. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12746. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12747. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12748. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12749. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12750. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12751. do { \
  12752. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12753. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12754. } while (0)
  12755. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12756. do { \
  12757. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12758. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12759. } while (0)
  12760. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12761. do { \
  12762. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12763. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12764. } while (0)
  12765. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12766. do { \
  12767. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12768. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12769. } while (0)
  12770. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12771. do { \
  12772. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12773. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12774. } while (0)
  12775. /**
  12776. * @brief target -> host flow pool unmap message
  12777. *
  12778. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12779. *
  12780. * @details
  12781. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12782. * down a flow of descriptors.
  12783. * This message indicates that for the flow (whose ID is provided) is wanting
  12784. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12785. * pool of descriptors from where descriptors are being allocated for this
  12786. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12787. * be unmapped by the host.
  12788. *
  12789. * The message would appear as follows:
  12790. *
  12791. * |31 24|23 16|15 8|7 0|
  12792. * |----------------+----------------+----------------+----------------|
  12793. * | reserved0 | msg_type |
  12794. * |-------------------------------------------------------------------|
  12795. * | flow_type |
  12796. * |-------------------------------------------------------------------|
  12797. * | flow_id |
  12798. * |-------------------------------------------------------------------|
  12799. * | reserved1 | flow_pool_id |
  12800. * |-------------------------------------------------------------------|
  12801. *
  12802. * The message is interpreted as follows:
  12803. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12804. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12805. * b'8:31 - reserved0: Reserved for future use
  12806. *
  12807. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12808. * this flow is associated. It can be VDEV, peer,
  12809. * or tid (AC). Based on enum htt_flow_type.
  12810. *
  12811. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12812. * object. For flow_type vdev it is set to the
  12813. * vdevid, for peer it is peerid and for tid, it is
  12814. * tid_num.
  12815. *
  12816. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12817. * used in the host for this flow
  12818. * b'16:31 - reserved0: This field in reserved for the future.
  12819. *
  12820. */
  12821. PREPACK struct htt_flow_pool_unmap_t {
  12822. A_UINT32 msg_type:8,
  12823. reserved0:24;
  12824. A_UINT32 flow_type;
  12825. A_UINT32 flow_id;
  12826. A_UINT32 flow_pool_id:16,
  12827. reserved1:16;
  12828. } POSTPACK;
  12829. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12830. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12831. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12832. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12833. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12834. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12835. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12836. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12837. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12838. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12839. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12840. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12841. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12842. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12843. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12844. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12845. do { \
  12846. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12847. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12848. } while (0)
  12849. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12850. do { \
  12851. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12852. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12853. } while (0)
  12854. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12855. do { \
  12856. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12857. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12858. } while (0)
  12859. /**
  12860. * @brief target -> host SRING setup done message
  12861. *
  12862. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12863. *
  12864. * @details
  12865. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12866. * SRNG ring setup is done
  12867. *
  12868. * This message indicates whether the last setup operation is successful.
  12869. * It will be sent to host when host set respose_required bit in
  12870. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12871. * The message would appear as follows:
  12872. *
  12873. * |31 24|23 16|15 8|7 0|
  12874. * |--------------- +----------------+----------------+----------------|
  12875. * | setup_status | ring_id | pdev_id | msg_type |
  12876. * |-------------------------------------------------------------------|
  12877. *
  12878. * The message is interpreted as follows:
  12879. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12880. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12881. * b'8:15 - pdev_id:
  12882. * 0 (for rings at SOC/UMAC level),
  12883. * 1/2/3 mac id (for rings at LMAC level)
  12884. * b'16:23 - ring_id: Identify the ring which is set up
  12885. * More details can be got from enum htt_srng_ring_id
  12886. * b'24:31 - setup_status: Indicate status of setup operation
  12887. * Refer to htt_ring_setup_status
  12888. */
  12889. PREPACK struct htt_sring_setup_done_t {
  12890. A_UINT32 msg_type: 8,
  12891. pdev_id: 8,
  12892. ring_id: 8,
  12893. setup_status: 8;
  12894. } POSTPACK;
  12895. enum htt_ring_setup_status {
  12896. htt_ring_setup_status_ok = 0,
  12897. htt_ring_setup_status_error,
  12898. };
  12899. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12900. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12901. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12902. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12903. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12904. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12905. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12906. do { \
  12907. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12908. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12909. } while (0)
  12910. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12911. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12912. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12913. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12914. HTT_SRING_SETUP_DONE_RING_ID_S)
  12915. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12916. do { \
  12917. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12918. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12919. } while (0)
  12920. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12921. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12922. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12923. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12924. HTT_SRING_SETUP_DONE_STATUS_S)
  12925. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12926. do { \
  12927. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12928. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12929. } while (0)
  12930. /**
  12931. * @brief target -> flow map flow info
  12932. *
  12933. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12934. *
  12935. * @details
  12936. * HTT TX map flow entry with tqm flow pointer
  12937. * Sent from firmware to host to add tqm flow pointer in corresponding
  12938. * flow search entry. Flow metadata is replayed back to host as part of this
  12939. * struct to enable host to find the specific flow search entry
  12940. *
  12941. * The message would appear as follows:
  12942. *
  12943. * |31 28|27 18|17 14|13 8|7 0|
  12944. * |-------+------------------------------------------+----------------|
  12945. * | rsvd0 | fse_hsh_idx | msg_type |
  12946. * |-------------------------------------------------------------------|
  12947. * | rsvd1 | tid | peer_id |
  12948. * |-------------------------------------------------------------------|
  12949. * | tqm_flow_pntr_lo |
  12950. * |-------------------------------------------------------------------|
  12951. * | tqm_flow_pntr_hi |
  12952. * |-------------------------------------------------------------------|
  12953. * | fse_meta_data |
  12954. * |-------------------------------------------------------------------|
  12955. *
  12956. * The message is interpreted as follows:
  12957. *
  12958. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12959. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12960. *
  12961. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12962. * for this flow entry
  12963. *
  12964. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12965. *
  12966. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12967. *
  12968. * dword1 - b'14:17 - tid
  12969. *
  12970. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12971. *
  12972. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12973. *
  12974. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12975. *
  12976. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12977. * given by host
  12978. */
  12979. PREPACK struct htt_tx_map_flow_info {
  12980. A_UINT32
  12981. msg_type: 8,
  12982. fse_hsh_idx: 20,
  12983. rsvd0: 4;
  12984. A_UINT32
  12985. peer_id: 14,
  12986. tid: 4,
  12987. rsvd1: 14;
  12988. A_UINT32 tqm_flow_pntr_lo;
  12989. A_UINT32 tqm_flow_pntr_hi;
  12990. struct htt_tx_flow_metadata fse_meta_data;
  12991. } POSTPACK;
  12992. /* DWORD 0 */
  12993. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12994. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12995. /* DWORD 1 */
  12996. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12997. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12998. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12999. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13000. /* DWORD 0 */
  13001. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13002. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13003. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13004. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13005. do { \
  13006. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13007. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13008. } while (0)
  13009. /* DWORD 1 */
  13010. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13011. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13012. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13013. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13014. do { \
  13015. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13016. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13017. } while (0)
  13018. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13019. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13020. HTT_TX_MAP_FLOW_INFO_TID_S)
  13021. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13022. do { \
  13023. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13024. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13025. } while (0)
  13026. /*
  13027. * htt_dbg_ext_stats_status -
  13028. * present - The requested stats have been delivered in full.
  13029. * This indicates that either the stats information was contained
  13030. * in its entirety within this message, or else this message
  13031. * completes the delivery of the requested stats info that was
  13032. * partially delivered through earlier STATS_CONF messages.
  13033. * partial - The requested stats have been delivered in part.
  13034. * One or more subsequent STATS_CONF messages with the same
  13035. * cookie value will be sent to deliver the remainder of the
  13036. * information.
  13037. * error - The requested stats could not be delivered, for example due
  13038. * to a shortage of memory to construct a message holding the
  13039. * requested stats.
  13040. * invalid - The requested stat type is either not recognized, or the
  13041. * target is configured to not gather the stats type in question.
  13042. */
  13043. enum htt_dbg_ext_stats_status {
  13044. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13045. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13046. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13047. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13048. };
  13049. /**
  13050. * @brief target -> host ppdu stats upload
  13051. *
  13052. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13053. *
  13054. * @details
  13055. * The following field definitions describe the format of the HTT target
  13056. * to host ppdu stats indication message.
  13057. *
  13058. *
  13059. * |31 16|15 12|11 10|9 8|7 0 |
  13060. * |----------------------------------------------------------------------|
  13061. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13062. * |----------------------------------------------------------------------|
  13063. * | ppdu_id |
  13064. * |----------------------------------------------------------------------|
  13065. * | Timestamp in us |
  13066. * |----------------------------------------------------------------------|
  13067. * | reserved |
  13068. * |----------------------------------------------------------------------|
  13069. * | type-specific stats info |
  13070. * | (see htt_ppdu_stats.h) |
  13071. * |----------------------------------------------------------------------|
  13072. * Header fields:
  13073. * - MSG_TYPE
  13074. * Bits 7:0
  13075. * Purpose: Identifies this is a PPDU STATS indication
  13076. * message.
  13077. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13078. * - mac_id
  13079. * Bits 9:8
  13080. * Purpose: mac_id of this ppdu_id
  13081. * Value: 0-3
  13082. * - pdev_id
  13083. * Bits 11:10
  13084. * Purpose: pdev_id of this ppdu_id
  13085. * Value: 0-3
  13086. * 0 (for rings at SOC level),
  13087. * 1/2/3 PDEV -> 0/1/2
  13088. * - payload_size
  13089. * Bits 31:16
  13090. * Purpose: total tlv size
  13091. * Value: payload_size in bytes
  13092. */
  13093. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13094. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13095. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13096. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13097. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13098. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13099. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13100. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13101. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13102. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13103. do { \
  13104. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13105. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13106. } while (0)
  13107. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13108. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13109. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13110. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13111. do { \
  13112. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13113. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13114. } while (0)
  13115. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13116. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13117. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13118. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13119. do { \
  13120. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13121. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13122. } while (0)
  13123. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13124. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13125. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13126. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13127. do { \
  13128. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13129. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13130. } while (0)
  13131. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13132. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13133. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13134. /* htt_t2h_ppdu_stats_ind_hdr_t
  13135. * This struct contains the fields within the header of the
  13136. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13137. * stats info.
  13138. * This struct assumes little-endian layout, and thus is only
  13139. * suitable for use within processors known to be little-endian
  13140. * (such as the target).
  13141. * In contrast, the above macros provide endian-portable methods
  13142. * to get and set the bitfields within this PPDU_STATS_IND header.
  13143. */
  13144. typedef struct {
  13145. A_UINT32 msg_type: 8, /* bits 7:0 */
  13146. mac_id: 2, /* bits 9:8 */
  13147. pdev_id: 2, /* bits 11:10 */
  13148. reserved1: 4, /* bits 15:12 */
  13149. payload_size: 16; /* bits 31:16 */
  13150. A_UINT32 ppdu_id;
  13151. A_UINT32 timestamp_us;
  13152. A_UINT32 reserved2;
  13153. } htt_t2h_ppdu_stats_ind_hdr_t;
  13154. /**
  13155. * @brief target -> host extended statistics upload
  13156. *
  13157. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13158. *
  13159. * @details
  13160. * The following field definitions describe the format of the HTT target
  13161. * to host stats upload confirmation message.
  13162. * The message contains a cookie echoed from the HTT host->target stats
  13163. * upload request, which identifies which request the confirmation is
  13164. * for, and a single stats can span over multiple HTT stats indication
  13165. * due to the HTT message size limitation so every HTT ext stats indication
  13166. * will have tag-length-value stats information elements.
  13167. * The tag-length header for each HTT stats IND message also includes a
  13168. * status field, to indicate whether the request for the stat type in
  13169. * question was fully met, partially met, unable to be met, or invalid
  13170. * (if the stat type in question is disabled in the target).
  13171. * A Done bit 1's indicate the end of the of stats info elements.
  13172. *
  13173. *
  13174. * |31 16|15 12|11|10 8|7 5|4 0|
  13175. * |--------------------------------------------------------------|
  13176. * | reserved | msg type |
  13177. * |--------------------------------------------------------------|
  13178. * | cookie LSBs |
  13179. * |--------------------------------------------------------------|
  13180. * | cookie MSBs |
  13181. * |--------------------------------------------------------------|
  13182. * | stats entry length | rsvd | D| S | stat type |
  13183. * |--------------------------------------------------------------|
  13184. * | type-specific stats info |
  13185. * | (see htt_stats.h) |
  13186. * |--------------------------------------------------------------|
  13187. * Header fields:
  13188. * - MSG_TYPE
  13189. * Bits 7:0
  13190. * Purpose: Identifies this is a extended statistics upload confirmation
  13191. * message.
  13192. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13193. * - COOKIE_LSBS
  13194. * Bits 31:0
  13195. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13196. * message with its preceding host->target stats request message.
  13197. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13198. * - COOKIE_MSBS
  13199. * Bits 31:0
  13200. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13201. * message with its preceding host->target stats request message.
  13202. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13203. *
  13204. * Stats Information Element tag-length header fields:
  13205. * - STAT_TYPE
  13206. * Bits 7:0
  13207. * Purpose: identifies the type of statistics info held in the
  13208. * following information element
  13209. * Value: htt_dbg_ext_stats_type
  13210. * - STATUS
  13211. * Bits 10:8
  13212. * Purpose: indicate whether the requested stats are present
  13213. * Value: htt_dbg_ext_stats_status
  13214. * - DONE
  13215. * Bits 11
  13216. * Purpose:
  13217. * Indicates the completion of the stats entry, this will be the last
  13218. * stats conf HTT segment for the requested stats type.
  13219. * Value:
  13220. * 0 -> the stats retrieval is ongoing
  13221. * 1 -> the stats retrieval is complete
  13222. * - LENGTH
  13223. * Bits 31:16
  13224. * Purpose: indicate the stats information size
  13225. * Value: This field specifies the number of bytes of stats information
  13226. * that follows the element tag-length header.
  13227. * It is expected but not required that this length is a multiple of
  13228. * 4 bytes.
  13229. */
  13230. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13231. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13232. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13233. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13234. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13235. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13236. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13237. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13238. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13239. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13240. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13241. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13242. do { \
  13243. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13244. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13245. } while (0)
  13246. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13247. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13248. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13249. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13250. do { \
  13251. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13252. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13253. } while (0)
  13254. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13255. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13256. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13257. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13258. do { \
  13259. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13260. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13261. } while (0)
  13262. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13263. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13264. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13265. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13266. do { \
  13267. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13268. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13269. } while (0)
  13270. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13271. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13272. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13273. typedef enum {
  13274. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13275. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13276. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13277. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13278. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13279. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13280. /* Reserved from 128 - 255 for target internal use.*/
  13281. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13282. } HTT_PEER_TYPE;
  13283. /** macro to convert MAC address from char array to HTT word format */
  13284. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13285. (phtt_mac_addr)->mac_addr31to0 = \
  13286. (((c_macaddr)[0] << 0) | \
  13287. ((c_macaddr)[1] << 8) | \
  13288. ((c_macaddr)[2] << 16) | \
  13289. ((c_macaddr)[3] << 24)); \
  13290. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13291. } while (0)
  13292. /**
  13293. * @brief target -> host monitor mac header indication message
  13294. *
  13295. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13296. *
  13297. * @details
  13298. * The following diagram shows the format of the monitor mac header message
  13299. * sent from the target to the host.
  13300. * This message is primarily sent when promiscuous rx mode is enabled.
  13301. * One message is sent per rx PPDU.
  13302. *
  13303. * |31 24|23 16|15 8|7 0|
  13304. * |-------------------------------------------------------------|
  13305. * | peer_id | reserved0 | msg_type |
  13306. * |-------------------------------------------------------------|
  13307. * | reserved1 | num_mpdu |
  13308. * |-------------------------------------------------------------|
  13309. * | struct hw_rx_desc |
  13310. * | (see wal_rx_desc.h) |
  13311. * |-------------------------------------------------------------|
  13312. * | struct ieee80211_frame_addr4 |
  13313. * | (see ieee80211_defs.h) |
  13314. * |-------------------------------------------------------------|
  13315. * | struct ieee80211_frame_addr4 |
  13316. * | (see ieee80211_defs.h) |
  13317. * |-------------------------------------------------------------|
  13318. * | ...... |
  13319. * |-------------------------------------------------------------|
  13320. *
  13321. * Header fields:
  13322. * - msg_type
  13323. * Bits 7:0
  13324. * Purpose: Identifies this is a monitor mac header indication message.
  13325. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13326. * - peer_id
  13327. * Bits 31:16
  13328. * Purpose: Software peer id given by host during association,
  13329. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13330. * for rx PPDUs received from unassociated peers.
  13331. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13332. * - num_mpdu
  13333. * Bits 15:0
  13334. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13335. * delivered within the message.
  13336. * Value: 1 to 32
  13337. * num_mpdu is limited to a maximum value of 32, due to buffer
  13338. * size limits. For PPDUs with more than 32 MPDUs, only the
  13339. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13340. * the PPDU will be provided.
  13341. */
  13342. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13343. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13344. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13345. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13346. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13347. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13348. do { \
  13349. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13350. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13351. } while (0)
  13352. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13353. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13354. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13355. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13356. do { \
  13357. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13358. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13359. } while (0)
  13360. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13361. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13362. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13363. /**
  13364. * @brief target -> host flow pool resize Message
  13365. *
  13366. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13367. *
  13368. * @details
  13369. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13370. * the flow pool associated with the specified ID is resized
  13371. *
  13372. * The message would appear as follows:
  13373. *
  13374. * |31 16|15 8|7 0|
  13375. * |---------------------------------+----------------+----------------|
  13376. * | reserved0 | Msg type |
  13377. * |-------------------------------------------------------------------|
  13378. * | flow pool new size | flow pool ID |
  13379. * |-------------------------------------------------------------------|
  13380. *
  13381. * The message is interpreted as follows:
  13382. * b'0:7 - msg_type: This will be set to 0x21
  13383. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13384. *
  13385. * b'0:15 - flow pool ID: Existing flow pool ID
  13386. *
  13387. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13388. *
  13389. */
  13390. PREPACK struct htt_flow_pool_resize_t {
  13391. A_UINT32 msg_type:8,
  13392. reserved0:24;
  13393. A_UINT32 flow_pool_id:16,
  13394. flow_pool_new_size:16;
  13395. } POSTPACK;
  13396. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13397. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13398. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13399. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13400. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13401. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13402. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13403. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13404. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13405. do { \
  13406. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13407. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13408. } while (0)
  13409. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13410. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13411. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13412. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13413. do { \
  13414. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13415. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13416. } while (0)
  13417. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13418. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13419. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13420. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13421. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13422. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13423. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13424. /*
  13425. * The read and write indices point to the data within the host buffer.
  13426. * Because the first 4 bytes of the host buffer is used for the read index and
  13427. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13428. * The read index and write index are the byte offsets from the base of the
  13429. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13430. * Refer the ASCII text picture below.
  13431. */
  13432. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13433. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13434. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13435. /*
  13436. ***************************************************************************
  13437. *
  13438. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13439. *
  13440. ***************************************************************************
  13441. *
  13442. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13443. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13444. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13445. * written into the Host memory region mentioned below.
  13446. *
  13447. * Read index is updated by the Host. At any point of time, the read index will
  13448. * indicate the index that will next be read by the Host. The read index is
  13449. * in units of bytes offset from the base of the meta-data buffer.
  13450. *
  13451. * Write index is updated by the FW. At any point of time, the write index will
  13452. * indicate from where the FW can start writing any new data. The write index is
  13453. * in units of bytes offset from the base of the meta-data buffer.
  13454. *
  13455. * If the Host is not fast enough in reading the CFR data, any new capture data
  13456. * would be dropped if there is no space left to write the new captures.
  13457. *
  13458. * The last 4 bytes of the memory region will have the magic pattern
  13459. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13460. * not overrun the host buffer.
  13461. *
  13462. * ,--------------------. read and write indices store the
  13463. * | | byte offset from the base of the
  13464. * | ,--------+--------. meta-data buffer to the next
  13465. * | | | | location within the data buffer
  13466. * | | v v that will be read / written
  13467. * ************************************************************************
  13468. * * Read * Write * * Magic *
  13469. * * index * index * CFR data1 ...... CFR data N * pattern *
  13470. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13471. * ************************************************************************
  13472. * |<---------- data buffer ---------->|
  13473. *
  13474. * |<----------------- meta-data buffer allocated in Host ----------------|
  13475. *
  13476. * Note:
  13477. * - Considering the 4 bytes needed to store the Read index (R) and the
  13478. * Write index (W), the initial value is as follows:
  13479. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13480. * - Buffer empty condition:
  13481. * R = W
  13482. *
  13483. * Regarding CFR data format:
  13484. * --------------------------
  13485. *
  13486. * Each CFR tone is stored in HW as 16-bits with the following format:
  13487. * {bits[15:12], bits[11:6], bits[5:0]} =
  13488. * {unsigned exponent (4 bits),
  13489. * signed mantissa_real (6 bits),
  13490. * signed mantissa_imag (6 bits)}
  13491. *
  13492. * CFR_real = mantissa_real * 2^(exponent-5)
  13493. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13494. *
  13495. *
  13496. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13497. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13498. *
  13499. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13500. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13501. * .
  13502. * .
  13503. * .
  13504. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13505. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13506. */
  13507. /* Bandwidth of peer CFR captures */
  13508. typedef enum {
  13509. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13510. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13511. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13512. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13513. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13514. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13515. } HTT_PEER_CFR_CAPTURE_BW;
  13516. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13517. * was captured
  13518. */
  13519. typedef enum {
  13520. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13521. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13522. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13523. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13524. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13525. } HTT_PEER_CFR_CAPTURE_MODE;
  13526. typedef enum {
  13527. /* This message type is currently used for the below purpose:
  13528. *
  13529. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13530. * wmi_peer_cfr_capture_cmd.
  13531. * If payload_present bit is set to 0 then the associated memory region
  13532. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13533. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13534. * message; the CFR dump will be present at the end of the message,
  13535. * after the chan_phy_mode.
  13536. */
  13537. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13538. /* Always keep this last */
  13539. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13540. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13541. /**
  13542. * @brief target -> host CFR dump completion indication message definition
  13543. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13544. *
  13545. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13546. *
  13547. * @details
  13548. * The following diagram shows the format of the Channel Frequency Response
  13549. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13550. * the channel capture of a peer is copied by Firmware into the Host memory
  13551. *
  13552. * **************************************************************************
  13553. *
  13554. * Message format when the CFR capture message type is
  13555. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13556. *
  13557. * **************************************************************************
  13558. *
  13559. * |31 16|15 |8|7 0|
  13560. * |----------------------------------------------------------------|
  13561. * header: | reserved |P| msg_type |
  13562. * word 0 | | | |
  13563. * |----------------------------------------------------------------|
  13564. * payload: | cfr_capture_msg_type |
  13565. * word 1 | |
  13566. * |----------------------------------------------------------------|
  13567. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13568. * word 2 | | | | | | | | |
  13569. * |----------------------------------------------------------------|
  13570. * | mac_addr31to0 |
  13571. * word 3 | |
  13572. * |----------------------------------------------------------------|
  13573. * | unused / reserved | mac_addr47to32 |
  13574. * word 4 | | |
  13575. * |----------------------------------------------------------------|
  13576. * | index |
  13577. * word 5 | |
  13578. * |----------------------------------------------------------------|
  13579. * | length |
  13580. * word 6 | |
  13581. * |----------------------------------------------------------------|
  13582. * | timestamp |
  13583. * word 7 | |
  13584. * |----------------------------------------------------------------|
  13585. * | counter |
  13586. * word 8 | |
  13587. * |----------------------------------------------------------------|
  13588. * | chan_mhz |
  13589. * word 9 | |
  13590. * |----------------------------------------------------------------|
  13591. * | band_center_freq1 |
  13592. * word 10 | |
  13593. * |----------------------------------------------------------------|
  13594. * | band_center_freq2 |
  13595. * word 11 | |
  13596. * |----------------------------------------------------------------|
  13597. * | chan_phy_mode |
  13598. * word 12 | |
  13599. * |----------------------------------------------------------------|
  13600. * where,
  13601. * P - payload present bit (payload_present explained below)
  13602. * req_id - memory request id (mem_req_id explained below)
  13603. * S - status field (status explained below)
  13604. * capbw - capture bandwidth (capture_bw explained below)
  13605. * mode - mode of capture (mode explained below)
  13606. * sts - space time streams (sts_count explained below)
  13607. * chbw - channel bandwidth (channel_bw explained below)
  13608. * captype - capture type (cap_type explained below)
  13609. *
  13610. * The following field definitions describe the format of the CFR dump
  13611. * completion indication sent from the target to the host
  13612. *
  13613. * Header fields:
  13614. *
  13615. * Word 0
  13616. * - msg_type
  13617. * Bits 7:0
  13618. * Purpose: Identifies this as CFR TX completion indication
  13619. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13620. * - payload_present
  13621. * Bit 8
  13622. * Purpose: Identifies how CFR data is sent to host
  13623. * Value: 0 - If CFR Payload is written to host memory
  13624. * 1 - If CFR Payload is sent as part of HTT message
  13625. * (This is the requirement for SDIO/USB where it is
  13626. * not possible to write CFR data to host memory)
  13627. * - reserved
  13628. * Bits 31:9
  13629. * Purpose: Reserved
  13630. * Value: 0
  13631. *
  13632. * Payload fields:
  13633. *
  13634. * Word 1
  13635. * - cfr_capture_msg_type
  13636. * Bits 31:0
  13637. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13638. * to specify the format used for the remainder of the message
  13639. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13640. * (currently only MSG_TYPE_1 is defined)
  13641. *
  13642. * Word 2
  13643. * - mem_req_id
  13644. * Bits 6:0
  13645. * Purpose: Contain the mem request id of the region where the CFR capture
  13646. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13647. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13648. this value is invalid)
  13649. * - status
  13650. * Bit 7
  13651. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13652. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13653. * - capture_bw
  13654. * Bits 10:8
  13655. * Purpose: Carry the bandwidth of the CFR capture
  13656. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13657. * - mode
  13658. * Bits 13:11
  13659. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13660. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13661. * - sts_count
  13662. * Bits 16:14
  13663. * Purpose: Carry the number of space time streams
  13664. * Value: Number of space time streams
  13665. * - channel_bw
  13666. * Bits 19:17
  13667. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13668. * measurement
  13669. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13670. * - cap_type
  13671. * Bits 23:20
  13672. * Purpose: Carry the type of the capture
  13673. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13674. * - vdev_id
  13675. * Bits 31:24
  13676. * Purpose: Carry the virtual device id
  13677. * Value: vdev ID
  13678. *
  13679. * Word 3
  13680. * - mac_addr31to0
  13681. * Bits 31:0
  13682. * Purpose: Contain the bits 31:0 of the peer MAC address
  13683. * Value: Bits 31:0 of the peer MAC address
  13684. *
  13685. * Word 4
  13686. * - mac_addr47to32
  13687. * Bits 15:0
  13688. * Purpose: Contain the bits 47:32 of the peer MAC address
  13689. * Value: Bits 47:32 of the peer MAC address
  13690. *
  13691. * Word 5
  13692. * - index
  13693. * Bits 31:0
  13694. * Purpose: Contain the index at which this CFR dump was written in the Host
  13695. * allocated memory. This index is the number of bytes from the base address.
  13696. * Value: Index position
  13697. *
  13698. * Word 6
  13699. * - length
  13700. * Bits 31:0
  13701. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13702. * Value: Length of the CFR capture of the peer
  13703. *
  13704. * Word 7
  13705. * - timestamp
  13706. * Bits 31:0
  13707. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13708. * clock used for this timestamp is private to the target and not visible to
  13709. * the host i.e., Host can interpret only the relative timestamp deltas from
  13710. * one message to the next, but can't interpret the absolute timestamp from a
  13711. * single message.
  13712. * Value: Timestamp in microseconds
  13713. *
  13714. * Word 8
  13715. * - counter
  13716. * Bits 31:0
  13717. * Purpose: Carry the count of the current CFR capture from FW. This is
  13718. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13719. * in host memory)
  13720. * Value: Count of the current CFR capture
  13721. *
  13722. * Word 9
  13723. * - chan_mhz
  13724. * Bits 31:0
  13725. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13726. * Value: Primary 20 channel frequency
  13727. *
  13728. * Word 10
  13729. * - band_center_freq1
  13730. * Bits 31:0
  13731. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13732. * Value: Center frequency 1 in MHz
  13733. *
  13734. * Word 11
  13735. * - band_center_freq2
  13736. * Bits 31:0
  13737. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13738. * the VDEV
  13739. * 80plus80 mode
  13740. * Value: Center frequency 2 in MHz
  13741. *
  13742. * Word 12
  13743. * - chan_phy_mode
  13744. * Bits 31:0
  13745. * Purpose: Carry the phy mode of the channel, of the VDEV
  13746. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13747. */
  13748. PREPACK struct htt_cfr_dump_ind_type_1 {
  13749. A_UINT32 mem_req_id:7,
  13750. status:1,
  13751. capture_bw:3,
  13752. mode:3,
  13753. sts_count:3,
  13754. channel_bw:3,
  13755. cap_type:4,
  13756. vdev_id:8;
  13757. htt_mac_addr addr;
  13758. A_UINT32 index;
  13759. A_UINT32 length;
  13760. A_UINT32 timestamp;
  13761. A_UINT32 counter;
  13762. struct htt_chan_change_msg chan;
  13763. } POSTPACK;
  13764. PREPACK struct htt_cfr_dump_compl_ind {
  13765. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13766. union {
  13767. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13768. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13769. /* If there is a need to change the memory layout and its associated
  13770. * HTT indication format, a new CFR capture message type can be
  13771. * introduced and added into this union.
  13772. */
  13773. };
  13774. } POSTPACK;
  13775. /*
  13776. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13777. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13778. */
  13779. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13780. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13781. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13782. do { \
  13783. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13784. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13785. } while(0)
  13786. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13787. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13788. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13789. /*
  13790. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13791. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13792. */
  13793. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13794. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13795. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13796. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13797. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13798. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13799. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13800. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13803. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13804. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13805. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13806. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13807. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13808. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13809. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13810. do { \
  13811. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13812. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13813. } while (0)
  13814. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13815. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13816. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13817. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13818. do { \
  13819. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13820. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13821. } while (0)
  13822. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13823. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13824. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13825. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13826. do { \
  13827. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13828. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13829. } while (0)
  13830. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13831. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13832. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13833. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13834. do { \
  13835. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13836. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13837. } while (0)
  13838. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13839. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13840. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13841. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13842. do { \
  13843. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13844. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13845. } while (0)
  13846. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13847. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13848. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13849. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13850. do { \
  13851. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13852. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13853. } while (0)
  13854. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13855. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13856. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13857. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13858. do { \
  13859. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13860. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13861. } while (0)
  13862. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13863. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13864. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13865. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13866. do { \
  13867. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13868. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13869. } while (0)
  13870. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13871. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13872. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13873. /**
  13874. * @brief target -> host peer (PPDU) stats message
  13875. *
  13876. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13877. *
  13878. * @details
  13879. * This message is generated by FW when FW is sending stats to host
  13880. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13881. * This message is sent autonomously by the target rather than upon request
  13882. * by the host.
  13883. * The following field definitions describe the format of the HTT target
  13884. * to host peer stats indication message.
  13885. *
  13886. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13887. * or more PPDU stats records.
  13888. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13889. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13890. * then the message would start with the
  13891. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13892. * below.
  13893. *
  13894. * |31 16|15|14|13 11|10 9|8|7 0|
  13895. * |-------------------------------------------------------------|
  13896. * | reserved |MSG_TYPE |
  13897. * |-------------------------------------------------------------|
  13898. * rec 0 | TLV header |
  13899. * rec 0 |-------------------------------------------------------------|
  13900. * rec 0 | ppdu successful bytes |
  13901. * rec 0 |-------------------------------------------------------------|
  13902. * rec 0 | ppdu retry bytes |
  13903. * rec 0 |-------------------------------------------------------------|
  13904. * rec 0 | ppdu failed bytes |
  13905. * rec 0 |-------------------------------------------------------------|
  13906. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13907. * rec 0 |-------------------------------------------------------------|
  13908. * rec 0 | retried MSDUs | successful MSDUs |
  13909. * rec 0 |-------------------------------------------------------------|
  13910. * rec 0 | TX duration | failed MSDUs |
  13911. * rec 0 |-------------------------------------------------------------|
  13912. * ...
  13913. * |-------------------------------------------------------------|
  13914. * rec N | TLV header |
  13915. * rec N |-------------------------------------------------------------|
  13916. * rec N | ppdu successful bytes |
  13917. * rec N |-------------------------------------------------------------|
  13918. * rec N | ppdu retry bytes |
  13919. * rec N |-------------------------------------------------------------|
  13920. * rec N | ppdu failed bytes |
  13921. * rec N |-------------------------------------------------------------|
  13922. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13923. * rec N |-------------------------------------------------------------|
  13924. * rec N | retried MSDUs | successful MSDUs |
  13925. * rec N |-------------------------------------------------------------|
  13926. * rec N | TX duration | failed MSDUs |
  13927. * rec N |-------------------------------------------------------------|
  13928. *
  13929. * where:
  13930. * A = is A-MPDU flag
  13931. * BA = block-ack failure flags
  13932. * BW = bandwidth spec
  13933. * SG = SGI enabled spec
  13934. * S = skipped rate ctrl
  13935. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13936. *
  13937. * Header
  13938. * ------
  13939. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13940. * dword0 - b'8:31 - reserved : Reserved for future use
  13941. *
  13942. * payload include below peer_stats information
  13943. * --------------------------------------------
  13944. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13945. * @tx_success_bytes : total successful bytes in the PPDU.
  13946. * @tx_retry_bytes : total retried bytes in the PPDU.
  13947. * @tx_failed_bytes : total failed bytes in the PPDU.
  13948. * @tx_ratecode : rate code used for the PPDU.
  13949. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13950. * @ba_ack_failed : BA/ACK failed for this PPDU
  13951. * b00 -> BA received
  13952. * b01 -> BA failed once
  13953. * b10 -> BA failed twice, when HW retry is enabled.
  13954. * @bw : BW
  13955. * b00 -> 20 MHz
  13956. * b01 -> 40 MHz
  13957. * b10 -> 80 MHz
  13958. * b11 -> 160 MHz (or 80+80)
  13959. * @sg : SGI enabled
  13960. * @s : skipped ratectrl
  13961. * @peer_id : peer id
  13962. * @tx_success_msdus : successful MSDUs
  13963. * @tx_retry_msdus : retried MSDUs
  13964. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13965. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13966. */
  13967. /**
  13968. * @brief target -> host backpressure event
  13969. *
  13970. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13971. *
  13972. * @details
  13973. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13974. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13975. * This message will only be sent if the backpressure condition has existed
  13976. * continuously for an initial period (100 ms).
  13977. * Repeat messages with updated information will be sent after each
  13978. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13979. * This message indicates the ring id along with current head and tail index
  13980. * locations (i.e. write and read indices).
  13981. * The backpressure time indicates the time in ms for which continous
  13982. * backpressure has been observed in the ring.
  13983. *
  13984. * The message format is as follows:
  13985. *
  13986. * |31 24|23 16|15 8|7 0|
  13987. * |----------------+----------------+----------------+----------------|
  13988. * | ring_id | ring_type | pdev_id | msg_type |
  13989. * |-------------------------------------------------------------------|
  13990. * | tail_idx | head_idx |
  13991. * |-------------------------------------------------------------------|
  13992. * | backpressure_time_ms |
  13993. * |-------------------------------------------------------------------|
  13994. *
  13995. * The message is interpreted as follows:
  13996. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13997. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13998. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13999. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14000. the msg is for LMAC ring.
  14001. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14002. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14003. * htt_backpressure_lmac_ring_id. This represents
  14004. * the ring id for which continous backpressure is seen
  14005. *
  14006. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14007. * the ring indicated by the ring_id
  14008. *
  14009. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14010. * the ring indicated by the ring id
  14011. *
  14012. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14013. * backpressure has been seen in the ring
  14014. * indicated by the ring_id.
  14015. * Units = milliseconds
  14016. */
  14017. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14018. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14019. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14020. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14021. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14022. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14023. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14024. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14025. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14026. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14027. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14028. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14029. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14030. do { \
  14031. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14032. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14033. } while (0)
  14034. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14035. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14036. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14037. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14038. do { \
  14039. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14040. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14041. } while (0)
  14042. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14043. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14044. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14045. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14046. do { \
  14047. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14048. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14049. } while (0)
  14050. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14051. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14052. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14053. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14054. do { \
  14055. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14056. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14057. } while (0)
  14058. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14059. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14060. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14061. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14062. do { \
  14063. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14064. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14065. } while (0)
  14066. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14067. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14068. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14069. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14070. do { \
  14071. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14072. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14073. } while (0)
  14074. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14075. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14076. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14077. enum htt_backpressure_ring_type {
  14078. HTT_SW_RING_TYPE_UMAC,
  14079. HTT_SW_RING_TYPE_LMAC,
  14080. HTT_SW_RING_TYPE_MAX,
  14081. };
  14082. /* Ring id for which the message is sent to host */
  14083. enum htt_backpressure_umac_ringid {
  14084. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14085. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14086. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14087. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14088. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14089. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14090. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14091. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14092. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14093. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14094. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14095. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14096. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14097. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14098. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14099. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14100. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14101. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14102. HTT_SW_UMAC_RING_IDX_MAX,
  14103. };
  14104. enum htt_backpressure_lmac_ringid {
  14105. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14106. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14107. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14108. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14109. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14110. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14111. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14112. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14113. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14114. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14115. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14116. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14117. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14118. HTT_SW_LMAC_RING_IDX_MAX,
  14119. };
  14120. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14121. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14122. pdev_id: 8,
  14123. ring_type: 8, /* htt_backpressure_ring_type */
  14124. /*
  14125. * ring_id holds an enum value from either
  14126. * htt_backpressure_umac_ringid or
  14127. * htt_backpressure_lmac_ringid, based on
  14128. * the ring_type setting.
  14129. */
  14130. ring_id: 8;
  14131. A_UINT16 head_idx;
  14132. A_UINT16 tail_idx;
  14133. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14134. } POSTPACK;
  14135. /*
  14136. * Defines two 32 bit words that can be used by the target to indicate a per
  14137. * user RU allocation and rate information.
  14138. *
  14139. * This information is currently provided in the "sw_response_reference_ptr"
  14140. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14141. * "rx_ppdu_end_user_stats" TLV.
  14142. *
  14143. * VALID:
  14144. * The consumer of these words must explicitly check the valid bit,
  14145. * and only attempt interpretation of any of the remaining fields if
  14146. * the valid bit is set to 1.
  14147. *
  14148. * VERSION:
  14149. * The consumer of these words must also explicitly check the version bit,
  14150. * and only use the V0 definition if the VERSION field is set to 0.
  14151. *
  14152. * Version 1 is currently undefined, with the exception of the VALID and
  14153. * VERSION fields.
  14154. *
  14155. * Version 0:
  14156. *
  14157. * The fields below are duplicated per BW.
  14158. *
  14159. * The consumer must determine which BW field to use, based on the UL OFDMA
  14160. * PPDU BW indicated by HW.
  14161. *
  14162. * RU_START: RU26 start index for the user.
  14163. * Note that this is always using the RU26 index, regardless
  14164. * of the actual RU assigned to the user
  14165. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14166. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14167. *
  14168. * For example, 20MHz (the value in the top row is RU_START)
  14169. *
  14170. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14171. * RU Size 1 (52): | | | | | |
  14172. * RU Size 2 (106): | | | |
  14173. * RU Size 3 (242): | |
  14174. *
  14175. * RU_SIZE: Indicates the RU size, as defined by enum
  14176. * htt_ul_ofdma_user_info_ru_size.
  14177. *
  14178. * LDPC: LDPC enabled (if 0, BCC is used)
  14179. *
  14180. * DCM: DCM enabled
  14181. *
  14182. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14183. * |---------------------------------+--------------------------------|
  14184. * |Ver|Valid| FW internal |
  14185. * |---------------------------------+--------------------------------|
  14186. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14187. * |---------------------------------+--------------------------------|
  14188. */
  14189. enum htt_ul_ofdma_user_info_ru_size {
  14190. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14191. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14192. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14193. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14194. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14195. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14196. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14197. };
  14198. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14199. struct htt_ul_ofdma_user_info_v0 {
  14200. A_UINT32 word0;
  14201. A_UINT32 word1;
  14202. };
  14203. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14204. A_UINT32 w0_fw_rsvd:30; \
  14205. A_UINT32 w0_valid:1; \
  14206. A_UINT32 w0_version:1;
  14207. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14208. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14209. };
  14210. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14211. A_UINT32 w1_nss:3; \
  14212. A_UINT32 w1_mcs:4; \
  14213. A_UINT32 w1_ldpc:1; \
  14214. A_UINT32 w1_dcm:1; \
  14215. A_UINT32 w1_ru_start:7; \
  14216. A_UINT32 w1_ru_size:3; \
  14217. A_UINT32 w1_trig_type:4; \
  14218. A_UINT32 w1_unused:9;
  14219. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14220. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14221. };
  14222. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14223. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14224. union {
  14225. A_UINT32 word0;
  14226. struct {
  14227. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14228. };
  14229. };
  14230. union {
  14231. A_UINT32 word1;
  14232. struct {
  14233. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14234. };
  14235. };
  14236. } POSTPACK;
  14237. enum HTT_UL_OFDMA_TRIG_TYPE {
  14238. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14239. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14240. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14241. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14242. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14243. };
  14244. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14245. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14246. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14247. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14248. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14249. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14250. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14251. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14261. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14263. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14264. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14265. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14266. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14267. /*--- word 0 ---*/
  14268. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14269. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14270. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14271. do { \
  14272. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14273. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14274. } while (0)
  14275. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14276. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14277. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14278. do { \
  14279. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14280. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14281. } while (0)
  14282. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14283. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14284. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14285. do { \
  14286. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14287. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14288. } while (0)
  14289. /*--- word 1 ---*/
  14290. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14291. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14292. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14293. do { \
  14294. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14295. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14296. } while (0)
  14297. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14298. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14299. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14300. do { \
  14301. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14302. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14303. } while (0)
  14304. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14305. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14306. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14307. do { \
  14308. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14309. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14310. } while (0)
  14311. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14312. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14313. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14314. do { \
  14315. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14316. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14317. } while (0)
  14318. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14319. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14320. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14321. do { \
  14322. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14323. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14324. } while (0)
  14325. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14326. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14327. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14328. do { \
  14329. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14330. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14331. } while (0)
  14332. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14333. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14334. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14335. do { \
  14336. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14337. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14338. } while (0)
  14339. /**
  14340. * @brief target -> host channel calibration data message
  14341. *
  14342. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14343. *
  14344. * @brief host -> target channel calibration data message
  14345. *
  14346. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14347. *
  14348. * @details
  14349. * The following field definitions describe the format of the channel
  14350. * calibration data message sent from the target to the host when
  14351. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14352. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14353. * The message is defined as htt_chan_caldata_msg followed by a variable
  14354. * number of 32-bit character values.
  14355. *
  14356. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14357. * |------------------------------------------------------------------|
  14358. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14359. * |------------------------------------------------------------------|
  14360. * | payload size | mhz |
  14361. * |------------------------------------------------------------------|
  14362. * | center frequency 2 | center frequency 1 |
  14363. * |------------------------------------------------------------------|
  14364. * | check sum |
  14365. * |------------------------------------------------------------------|
  14366. * | payload |
  14367. * |------------------------------------------------------------------|
  14368. * message info field:
  14369. * - MSG_TYPE
  14370. * Bits 7:0
  14371. * Purpose: identifies this as a channel calibration data message
  14372. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14373. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14374. * - SUB_TYPE
  14375. * Bits 11:8
  14376. * Purpose: T2H: indicates whether target is providing chan cal data
  14377. * to the host to store, or requesting that the host
  14378. * download previously-stored data.
  14379. * H2T: indicates whether the host is providing the requested
  14380. * channel cal data, or if it is rejecting the data
  14381. * request because it does not have the requested data.
  14382. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14383. * - CHKSUM_VALID
  14384. * Bit 12
  14385. * Purpose: indicates if the checksum field is valid
  14386. * value:
  14387. * - FRAG
  14388. * Bit 19:16
  14389. * Purpose: indicates the fragment index for message
  14390. * value: 0 for first fragment, 1 for second fragment, ...
  14391. * - APPEND
  14392. * Bit 20
  14393. * Purpose: indicates if this is the last fragment
  14394. * value: 0 = final fragment, 1 = more fragments will be appended
  14395. *
  14396. * channel and payload size field
  14397. * - MHZ
  14398. * Bits 15:0
  14399. * Purpose: indicates the channel primary frequency
  14400. * Value:
  14401. * - PAYLOAD_SIZE
  14402. * Bits 31:16
  14403. * Purpose: indicates the bytes of calibration data in payload
  14404. * Value:
  14405. *
  14406. * center frequency field
  14407. * - CENTER FREQUENCY 1
  14408. * Bits 15:0
  14409. * Purpose: indicates the channel center frequency
  14410. * Value: channel center frequency, in MHz units
  14411. * - CENTER FREQUENCY 2
  14412. * Bits 31:16
  14413. * Purpose: indicates the secondary channel center frequency,
  14414. * only for 11acvht 80plus80 mode
  14415. * Value: secondary channel center frequeny, in MHz units, if applicable
  14416. *
  14417. * checksum field
  14418. * - CHECK_SUM
  14419. * Bits 31:0
  14420. * Purpose: check the payload data, it is just for this fragment.
  14421. * This is intended for the target to check that the channel
  14422. * calibration data returned by the host is the unmodified data
  14423. * that was previously provided to the host by the target.
  14424. * value: checksum of fragment payload
  14425. */
  14426. PREPACK struct htt_chan_caldata_msg {
  14427. /* DWORD 0: message info */
  14428. A_UINT32
  14429. msg_type: 8,
  14430. sub_type: 4 ,
  14431. chksum_valid: 1, /** 1:valid, 0:invalid */
  14432. reserved1: 3,
  14433. frag_idx: 4, /** fragment index for calibration data */
  14434. appending: 1, /** 0: no fragment appending,
  14435. * 1: extra fragment appending */
  14436. reserved2: 11;
  14437. /* DWORD 1: channel and payload size */
  14438. A_UINT32
  14439. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14440. payload_size: 16; /** unit: bytes */
  14441. /* DWORD 2: center frequency */
  14442. A_UINT32
  14443. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14444. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14445. * valid only for 11acvht 80plus80 mode */
  14446. /* DWORD 3: check sum */
  14447. A_UINT32 chksum;
  14448. /* variable length for calibration data */
  14449. A_UINT32 payload[1/* or more */];
  14450. } POSTPACK;
  14451. /* T2H SUBTYPE */
  14452. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14453. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14454. /* H2T SUBTYPE */
  14455. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14456. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14457. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14458. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14459. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14460. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14461. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14462. do { \
  14463. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14464. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14465. } while (0)
  14466. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14467. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14468. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14469. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14470. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14471. do { \
  14472. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14473. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14474. } while (0)
  14475. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14476. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14477. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14478. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14479. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14480. do { \
  14481. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14482. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14483. } while (0)
  14484. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14485. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14486. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14487. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14488. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14489. do { \
  14490. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14491. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14492. } while (0)
  14493. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14494. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14495. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14496. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14497. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14498. do { \
  14499. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14500. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14501. } while (0)
  14502. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14503. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14504. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14505. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14506. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14507. do { \
  14508. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14509. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14510. } while (0)
  14511. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14512. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14513. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14514. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14515. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14516. do { \
  14517. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14518. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14519. } while (0)
  14520. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14521. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14522. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14523. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14524. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14525. do { \
  14526. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14527. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14528. } while (0)
  14529. /**
  14530. * @brief target -> host FSE CMEM based send
  14531. *
  14532. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14533. *
  14534. * @details
  14535. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14536. * FSE placement in CMEM is enabled.
  14537. *
  14538. * This message sends the non-secure CMEM base address.
  14539. * It will be sent to host in response to message
  14540. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14541. * The message would appear as follows:
  14542. *
  14543. * |31 24|23 16|15 8|7 0|
  14544. * |----------------+----------------+----------------+----------------|
  14545. * | reserved | num_entries | msg_type |
  14546. * |----------------+----------------+----------------+----------------|
  14547. * | base_address_lo |
  14548. * |----------------+----------------+----------------+----------------|
  14549. * | base_address_hi |
  14550. * |-------------------------------------------------------------------|
  14551. *
  14552. * The message is interpreted as follows:
  14553. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14554. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14555. * b'8:15 - number_entries: Indicated the number of entries
  14556. * programmed.
  14557. * b'16:31 - reserved.
  14558. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14559. * CMEM base address
  14560. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14561. * CMEM base address
  14562. */
  14563. PREPACK struct htt_cmem_base_send_t {
  14564. A_UINT32 msg_type: 8,
  14565. num_entries: 8,
  14566. reserved: 16;
  14567. A_UINT32 base_address_lo;
  14568. A_UINT32 base_address_hi;
  14569. } POSTPACK;
  14570. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14571. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14572. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14573. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14574. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14575. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14576. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14577. do { \
  14578. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14579. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14580. } while (0)
  14581. /**
  14582. * @brief - HTT PPDU ID format
  14583. *
  14584. * @details
  14585. * The following field definitions describe the format of the PPDU ID.
  14586. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14587. *
  14588. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14589. * +--------------------------------------------------------------------------
  14590. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14591. * +--------------------------------------------------------------------------
  14592. *
  14593. * sch id :Schedule command id
  14594. * Bits [11 : 0] : monotonically increasing counter to track the
  14595. * PPDU posted to a specific transmit queue.
  14596. *
  14597. * hwq_id: Hardware Queue ID.
  14598. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14599. *
  14600. * mac_id: MAC ID
  14601. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14602. *
  14603. * seq_idx: Sequence index.
  14604. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14605. * a particular TXOP.
  14606. *
  14607. * tqm_cmd: HWSCH/TQM flag.
  14608. * Bit [23] : Always set to 0.
  14609. *
  14610. * seq_cmd_type: Sequence command type.
  14611. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14612. * Refer to enum HTT_STATS_FTYPE for values.
  14613. */
  14614. PREPACK struct htt_ppdu_id {
  14615. A_UINT32
  14616. sch_id: 12,
  14617. hwq_id: 5,
  14618. mac_id: 2,
  14619. seq_idx: 2,
  14620. reserved1: 2,
  14621. tqm_cmd: 1,
  14622. seq_cmd_type: 6,
  14623. reserved2: 2;
  14624. } POSTPACK;
  14625. #define HTT_PPDU_ID_SCH_ID_S 0
  14626. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14627. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14628. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14629. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14630. do { \
  14631. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14632. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14633. } while (0)
  14634. #define HTT_PPDU_ID_HWQ_ID_S 12
  14635. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14636. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14637. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14638. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14639. do { \
  14640. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14641. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14642. } while (0)
  14643. #define HTT_PPDU_ID_MAC_ID_S 17
  14644. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14645. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14646. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14647. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14648. do { \
  14649. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14650. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14651. } while (0)
  14652. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14653. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14654. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14655. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14656. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14657. do { \
  14658. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14659. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14660. } while (0)
  14661. #define HTT_PPDU_ID_TQM_CMD_S 23
  14662. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14663. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14664. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14665. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14666. do { \
  14667. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14668. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14669. } while (0)
  14670. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14671. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14672. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14673. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14674. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14675. do { \
  14676. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14677. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14678. } while (0)
  14679. /**
  14680. * @brief target -> RX PEER METADATA V0 format
  14681. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14682. * message from target, and will confirm to the target which peer metadata
  14683. * version to use in the wmi_init message.
  14684. *
  14685. * The following diagram shows the format of the RX PEER METADATA.
  14686. *
  14687. * |31 24|23 16|15 8|7 0|
  14688. * |-----------------------------------------------------------------------|
  14689. * | Reserved | VDEV ID | PEER ID |
  14690. * |-----------------------------------------------------------------------|
  14691. */
  14692. PREPACK struct htt_rx_peer_metadata_v0 {
  14693. A_UINT32
  14694. peer_id: 16,
  14695. vdev_id: 8,
  14696. reserved1: 8;
  14697. } POSTPACK;
  14698. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14699. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14700. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14701. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14702. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14703. do { \
  14704. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14705. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14706. } while (0)
  14707. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14708. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14709. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14710. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14711. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14712. do { \
  14713. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14714. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14715. } while (0)
  14716. /**
  14717. * @brief target -> RX PEER METADATA V1 format
  14718. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14719. * message from target, and will confirm to the target which peer metadata
  14720. * version to use in the wmi_init message.
  14721. *
  14722. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14723. *
  14724. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14725. * |-----------------------------------------------------------------------|
  14726. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14727. * |-----------------------------------------------------------------------|
  14728. */
  14729. PREPACK struct htt_rx_peer_metadata_v1 {
  14730. A_UINT32
  14731. peer_id: 13,
  14732. ml_peer_valid: 1,
  14733. reserved1: 2,
  14734. vdev_id: 8,
  14735. lmac_id: 2,
  14736. chip_id: 3,
  14737. reserved2: 3;
  14738. } POSTPACK;
  14739. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14740. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14741. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14742. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14743. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14744. do { \
  14745. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14746. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14747. } while (0)
  14748. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14749. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14750. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14751. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14752. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14753. do { \
  14754. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14755. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14756. } while (0)
  14757. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14758. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14759. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14760. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14761. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14762. do { \
  14763. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14764. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14765. } while (0)
  14766. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14767. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14768. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14769. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14770. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14771. do { \
  14772. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14773. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14774. } while (0)
  14775. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14776. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14777. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14778. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14779. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14780. do { \
  14781. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14782. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14783. } while (0)
  14784. /*
  14785. * In some systems, the host SW wants to specify priorities between
  14786. * different MSDU / flow queues within the same peer-TID.
  14787. * The below enums are used for the host to identify to the target
  14788. * which MSDU queue's priority it wants to adjust.
  14789. */
  14790. /*
  14791. * The MSDUQ index describe index of TCL HW, where each index is
  14792. * used for queuing particular types of MSDUs.
  14793. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14794. */
  14795. enum HTT_MSDUQ_INDEX {
  14796. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14797. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14798. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14799. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14800. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14801. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14802. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14803. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14804. HTT_MSDUQ_MAX_INDEX,
  14805. };
  14806. /* MSDU qtype definition */
  14807. enum HTT_MSDU_QTYPE {
  14808. /*
  14809. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14810. * relative priority. Instead, the relative priority of CRIT_0 versus
  14811. * CRIT_1 is controlled by the FW, through the configuration parameters
  14812. * it applies to the queues.
  14813. */
  14814. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14815. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14816. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14817. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14818. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14819. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  14820. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  14821. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  14822. /* New MSDU_QTYPE should be added above this line */
  14823. /*
  14824. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14825. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14826. * any host/target message definitions. The QTYPE_MAX value can
  14827. * only be used internally within the host or within the target.
  14828. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14829. * it must regard the unexpected value as a default qtype value,
  14830. * or ignore it.
  14831. */
  14832. HTT_MSDU_QTYPE_MAX,
  14833. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14834. };
  14835. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14836. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14837. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14838. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14839. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14840. };
  14841. /**
  14842. * @brief target -> host mlo timestamp offset indication
  14843. *
  14844. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14845. *
  14846. * @details
  14847. * The following field definitions describe the format of the HTT target
  14848. * to host mlo timestamp offset indication message.
  14849. *
  14850. *
  14851. * |31 16|15 12|11 10|9 8|7 0 |
  14852. * |----------------------------------------------------------------------|
  14853. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14854. * |----------------------------------------------------------------------|
  14855. * | Sync time stamp lo in us |
  14856. * |----------------------------------------------------------------------|
  14857. * | Sync time stamp hi in us |
  14858. * |----------------------------------------------------------------------|
  14859. * | mlo time stamp offset lo in us |
  14860. * |----------------------------------------------------------------------|
  14861. * | mlo time stamp offset hi in us |
  14862. * |----------------------------------------------------------------------|
  14863. * | mlo time stamp offset clocks in clock ticks |
  14864. * |----------------------------------------------------------------------|
  14865. * |31 26|25 16|15 0 |
  14866. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14867. * | | compensation in clks | |
  14868. * |----------------------------------------------------------------------|
  14869. * |31 22|21 0 |
  14870. * | rsvd 3 | mlo time stamp comp timer period |
  14871. * |----------------------------------------------------------------------|
  14872. * The message is interpreted as follows:
  14873. *
  14874. * dword0 - b'0:7 - msg_type: This will be set to
  14875. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14876. * value: 0x28
  14877. *
  14878. * dword0 - b'9:8 - pdev_id
  14879. *
  14880. * dword0 - b'11:10 - chip_id
  14881. *
  14882. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14883. *
  14884. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14885. *
  14886. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14887. * which last sync interrupt was received
  14888. *
  14889. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14890. * which last sync interrupt was received
  14891. *
  14892. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14893. *
  14894. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14895. *
  14896. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14897. *
  14898. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14899. *
  14900. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14901. * for sub us resolution
  14902. *
  14903. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14904. *
  14905. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14906. * is applied, in us
  14907. *
  14908. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14909. */
  14910. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14911. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14912. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14914. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14915. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14917. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14918. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14919. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14920. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14922. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14923. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14924. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14925. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14926. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14927. do { \
  14928. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14929. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14930. } while (0)
  14931. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14932. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14933. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14934. do { \
  14935. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14936. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14937. } while (0)
  14938. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14939. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14940. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14941. do { \
  14942. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14943. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14944. } while (0)
  14945. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14946. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14947. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14948. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14949. do { \
  14950. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14951. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14952. } while (0)
  14953. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14954. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14955. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14956. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14957. do { \
  14958. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14959. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14960. } while (0)
  14961. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14962. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14963. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14964. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14965. do { \
  14966. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14967. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14968. } while (0)
  14969. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14970. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14971. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14972. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14973. do { \
  14974. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14975. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14976. } while (0)
  14977. typedef struct {
  14978. A_UINT32 msg_type: 8, /* bits 7:0 */
  14979. pdev_id: 2, /* bits 9:8 */
  14980. chip_id: 2, /* bits 11:10 */
  14981. reserved1: 4, /* bits 15:12 */
  14982. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14983. A_UINT32 sync_timestamp_lo_us;
  14984. A_UINT32 sync_timestamp_hi_us;
  14985. A_UINT32 mlo_timestamp_offset_lo_us;
  14986. A_UINT32 mlo_timestamp_offset_hi_us;
  14987. A_UINT32 mlo_timestamp_offset_clks;
  14988. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14989. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14990. reserved2: 6; /* bits 31:26 */
  14991. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14992. reserved3: 10; /* bits 31:22 */
  14993. } htt_t2h_mlo_offset_ind_t;
  14994. /*
  14995. * @brief target -> host VDEV TX RX STATS
  14996. *
  14997. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14998. *
  14999. * @details
  15000. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15001. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15002. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15003. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15004. * periodically by target even in the absence of any further HTT request
  15005. * messages from host.
  15006. *
  15007. * The message is formatted as follows:
  15008. *
  15009. * |31 16|15 8|7 0|
  15010. * |---------------------------------+----------------+----------------|
  15011. * | payload_size | pdev_id | msg_type |
  15012. * |---------------------------------+----------------+----------------|
  15013. * | reserved0 |
  15014. * |-------------------------------------------------------------------|
  15015. * | reserved1 |
  15016. * |-------------------------------------------------------------------|
  15017. * | reserved2 |
  15018. * |-------------------------------------------------------------------|
  15019. * | |
  15020. * | VDEV specific Tx Rx stats info |
  15021. * | |
  15022. * |-------------------------------------------------------------------|
  15023. *
  15024. * The message is interpreted as follows:
  15025. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15026. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15027. * b'8:15 - pdev_id
  15028. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15029. * message header fields (msg_type through reserved2)
  15030. * dword1 - b'0:31 - reserved0.
  15031. * dword2 - b'0:31 - reserved1.
  15032. * dword3 - b'0:31 - reserved2.
  15033. */
  15034. typedef struct {
  15035. A_UINT32 msg_type: 8,
  15036. pdev_id: 8,
  15037. payload_size: 16;
  15038. A_UINT32 reserved0;
  15039. A_UINT32 reserved1;
  15040. A_UINT32 reserved2;
  15041. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15042. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15043. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15044. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15045. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15046. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15047. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15048. do { \
  15049. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15050. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15051. } while (0)
  15052. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15053. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15054. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15055. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15056. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15057. do { \
  15058. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15059. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15060. } while (0)
  15061. /* SOC related stats */
  15062. typedef struct {
  15063. htt_tlv_hdr_t tlv_hdr;
  15064. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15065. * This can be due to either the peer is deleted or deletion is ongoing
  15066. * */
  15067. A_UINT32 inv_peers_msdu_drop_count_lo;
  15068. A_UINT32 inv_peers_msdu_drop_count_hi;
  15069. } htt_t2h_soc_txrx_stats_common_tlv;
  15070. /* VDEV HW Tx/Rx stats */
  15071. typedef struct {
  15072. htt_tlv_hdr_t tlv_hdr;
  15073. A_UINT32 vdev_id;
  15074. /* Rx msdu byte cnt */
  15075. A_UINT32 rx_msdu_byte_cnt_lo;
  15076. A_UINT32 rx_msdu_byte_cnt_hi;
  15077. /* Rx msdu cnt */
  15078. A_UINT32 rx_msdu_cnt_lo;
  15079. A_UINT32 rx_msdu_cnt_hi;
  15080. /* tx msdu byte cnt */
  15081. A_UINT32 tx_msdu_byte_cnt_lo;
  15082. A_UINT32 tx_msdu_byte_cnt_hi;
  15083. /* tx msdu cnt */
  15084. A_UINT32 tx_msdu_cnt_lo;
  15085. A_UINT32 tx_msdu_cnt_hi;
  15086. /* tx excessive retry discarded msdu cnt*/
  15087. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15088. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15089. /* TX congestion ctrl msdu drop cnt */
  15090. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15091. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15092. /* discarded tx msdus cnt coz of time to live expiry */
  15093. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15094. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15095. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15096. #endif